Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: class_plugins.php 5624 2011-10-02 19:07:56Z ralgith $
| * $Id: class_plugins.php 5828 2012-05-08 16:06:16Z Tomm $
|
*/
class pluginSystem
| */
class pluginSystem
|
Zeile 78 | Zeile 78 |
---|
* @param string The argument for the hook that is run. The passed value MUST be a variable * @return string The arguments for the hook. */
|
* @param string The argument for the hook that is run. The passed value MUST be a variable * @return string The arguments for the hook. */
|
function run_hooks($hook, $arguments="")
| function run_hooks($hook, &$arguments="")
|
{ if(!is_array($this->hooks[$hook])) {
| { if(!is_array($this->hooks[$hook])) {
|
Zeile 113 | Zeile 113 |
---|
} /**
|
} /**
|
* Run the hooks that have plugins but passes REQUIRED argument that is received by reference. * This argument must be received by reference in the plugin file! * This is a separate function to allow by reference calls for things you cannot use the $var = $plugins->run_hooks("hook_name", $var) syntax. * * @param string The name of the hook that is run. * @param string The argument for the hook that is run - passed by reference. The passed value MUST be a variable
| * Run hooks by ref * Wrapper for run hooks to maintain backwards compatibility
|
*/ function run_hooks_by_ref($hook, &$arguments) {
|
*/ function run_hooks_by_ref($hook, &$arguments) {
|
if(empty($this->hooks[$hook]) && !is_array($this->hooks[$hook])) { return $arguments; } $this->current_hook = $hook; ksort($this->hooks[$hook]); foreach($this->hooks[$hook] as $priority => $hooks) { if(is_array($hooks)) { foreach($hooks as $hook) { if($hook['file']) { require_once $hook['file']; } $func = $hook['function']; $returnargs = $func($arguments); } } } $this->current_hook = '';
| $this->run_hooks($hook, $arguments);
|
}
/**
| }
/**
|