src/Webtrees/Hook/Hook.php
public function execute(){
		$result = array();
		if(HookProvider::getInstance()->isModuleOperational()){
			$params = func_get_args();
			$sqlquery = '';
			$sqlparams = array($this->hook_function);
			if($this->hook_context != 'all') {
				$sqlparams = array($this->hook_function, $this->hook_context);
				$sqlquery = " OR majh_hook_context=?";
			}
			$module_names=Database::prepare(
					"SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'".
					" ORDER BY majh_module_priority ASC, module ASC"
			)->execute($sqlparams)->fetchAssoc();
			asort($module_names);
			array_unshift($params, array_keys($module_names));
			$result = call_user_func_array(array(&$this, 'executeOnlyFor'), $params);
		}
		return $result;
	}
public function execute(){
		$result = array();
		if(HookProvider::getInstance()->isModuleOperational()){
			$params = func_get_args();
			$sqlquery = '';
			$sqlparams = array($this->hook_function);
			if($this->hook_context != 'all') {
				$sqlparams = array($this->hook_function, $this->hook_context);
				$sqlquery = " OR majh_hook_context=?";
			}
			$module_names=Database::prepare(
					"SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'".
					" ORDER BY majh_module_priority ASC, module ASC"
			)->execute($sqlparams)->fetchAssoc();
			asort($module_names);
			array_unshift($params, array_keys($module_names));
			$result = call_user_func_array(array(&$this, 'executeOnlyFor'), $params);
		}
		return $result;
	}
public function execute ( ) { $ result = array ( ) ; if ( HookProvider :: getInstance ( ) -> isModuleOperational ( ) ) { $ params = func_get_args ( ) ; $ sqlquery = '' ; $ sqlparams = array ( $ this -> hook_function ) ; if ( $ this -> hook_context != 'all' ) { $ sqlparams = array ( $ this -> hook_function , $ this -> hook_context ) ; $ sqlquery = " OR majh_hook_context=?" ; } $ module_names = Database :: prepare ( "SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`" . " WHERE majh_hook_function = ? AND (majh_hook_context='all'" . $ sqlquery . ") AND majh_status='enabled'" . " ORDER BY majh_module_priority ASC, module ASC" ) -> execute ( $ sqlparams ) -> fetchAssoc ( ) ; asort ( $ module_names ) ; array_unshift ( $ params , array_keys ( $ module_names ) ) ; $ result = call_user_func_array ( array ( & $ this , 'executeOnlyFor' ) , $ params ) ; } return $ result ; }
Return the results of the execution of the hook function for all subscribed and enabled modules, in the order defined by their priority.
Parameters can be passed if the hook requires them.

@return array Results of the hook executions
Return the results of the execution of the hook function for all subscribed and enabled modules in the order defined by their priority . Parameters can be passed if the hook requires them .