src/Webtrees/Hook/Hook.php
public function getNumberActiveModules(){
		if(HookProvider::getInstance()->isModuleOperational()){
			$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 modules FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'"
			)->execute($sqlparams)->fetchOneColumn();
			return count($module_names);
		}
		return 0;
	}
public function getNumberActiveModules(){
		if(HookProvider::getInstance()->isModuleOperational()){
			$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 modules FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'"
			)->execute($sqlparams)->fetchOneColumn();
			return count($module_names);
		}
		return 0;
	}
public function getNumberActiveModules ( ) { if ( HookProvider :: getInstance ( ) -> isModuleOperational ( ) ) { $ 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 modules FROM `##maj_hooks`" . " WHERE majh_hook_function = ? AND (majh_hook_context='all'" . $ sqlquery . ") AND majh_status='enabled'" ) -> execute ( $ sqlparams ) -> fetchOneColumn ( ) ; return count ( $ module_names ) ; } return 0 ; }
Returns the number of active modules linked to a hook

@return int Number of active modules
Returns the number of active modules linked to a hook