function _advanced_forum_process_plugin in Advanced Forum 7.2
Same name and namespace in other branches
- 6.2 includes/plugins.inc \_advanced_forum_process_plugin()
- 6 advf-plugins.inc \_advanced_forum_process_plugin()
Process a single hook implementation of a advanced_forum plugin.
Parameters
string $module: The module that owns the hook.
string $identifier: Either the module or 'advanced_forum_' . $file->name
string $hook: The name of the hook being invoked.
Return value
array|null Data about module.
1 call to _advanced_forum_process_plugin()
- advanced_forum_load_hooks in includes/
plugins.inc - Load plugin info for all hooks; this is handled separately from plugins from files.
File
- includes/
plugins.inc, line 101 - Allows modules to contribute styles.
Code
function _advanced_forum_process_plugin($module, $identifier, $path, $hook) {
$function = $identifier . '_' . $hook;
if (!function_exists($function)) {
return NULL;
}
$result = $function();
if (!isset($result) || !is_array($result)) {
return NULL;
}
// Fill in defaults.
foreach ($result as $name => $plugin) {
if (!is_dir($path . '/' . $plugin['directory'])) {
unset($result[$name]);
continue;
}
$result[$name] += array(
'module' => $module,
'name' => $name,
'path' => $path . '/' . $plugin['directory'],
);
}
return !empty($result) ? $result : NULL;
}