You are here

function _filebrowser_externals in Filebrowser 7.4

Same name and namespace in other branches
  1. 8 filebrowser.common.inc \_filebrowser_externals()
  2. 6.2 includes/helpers.inc \_filebrowser_externals()
  3. 7.2 filebrowser.common.inc \_filebrowser_externals()
  4. 7.3 filebrowser.common.inc \_filebrowser_externals()

This function is used to invoke filebrowser_$kind hooks. Difference with a direct module_invoke_all is that result is cached in a static way (for now, real caching perhaps later).

Parameters

string $kind name of the hook (complete hook will be filebrowser_$kind):

string $name the name of the resource retrieved by the hook (used as hook: parameter and cache index)

Return value

array

5 calls to _filebrowser_externals()
filebrowser_form in ./filebrowser.module
Implements hook_form(). @inheritdoc
filebrowser_form_metadata in ./filebrowser.pages.inc
filebrowser_view in ./filebrowser.module
Implements hook_init(). @inheritdoc
theme_dir_listing_list_view in ./filebrowser.theme.inc
Theming function for list view.
_filebrowser_prepare_record in ./filebrowser.common.inc
Prepare node record to be used. This is mainly about default stuff.

File

./filebrowser.common.inc, line 163
Misc filebrowser common functions.

Code

function _filebrowser_externals($kind, $name = NULL) {
  static $externals = array();
  if (!isset($externals[$kind])) {
    $externals[$kind] = module_invoke_all("filebrowser_{$kind}");
  }
  if (!is_null($name)) {
    return isset($externals[$kind][$name]) ? $externals[$kind][$name] : NULL;
  }
  return $externals[$kind];
}