Commits

Anonymous committed 4c350ca

Comments (0)

Files changed (1)

system/libraries/Hooks.php

 	// --------------------------------------------------------------------
 
 	/**
-	 * Does a given hook exist?
-	 *
-	 * Returns TRUE/FALSE based on whether a given hook exists
-	 *
-	 * @access	private
-	 * @param	string
-	 * @return	bool
-	 */
-	function _hook_exists($which = '')
-	{
-		if ( ! $this->enabled)
-		{
-			return FALSE;
-		}
-
-		if ( ! isset($this->hooks[$which]))
-		{
-			return FALSE;
-		}
-
-		return TRUE;
-	}
-  	// END hook_exists()
-  	
-  	
-	// --------------------------------------------------------------------
-
-	/**
 	 * Call Hook
 	 *
 	 * Calls a particular hook
 	 */
 	function _call_hook($which = '')
 	{
+		if ( ! $this->enabled OR ! isset($this->hooks[$which]))
+		{
+			return FALSE;
+		}
+	
 		if (isset($this->hooks[$which][0]) AND is_array($this->hooks[$which][0]))
 		{
 			foreach ($this->hooks[$which] as $val)
 		{
 			$this->_run_hook($this->hooks[$which]);
 		}
+		
+		return TRUE;
 	}
   	// END hook_exists()
 
 		// -----------------------------------
 	
 		// If the script being called happens to have the same 
-		// extension call within it a loop can happen
+		// hook call within it a loop can happen
 		
 		if ($this->in_progress == TRUE)
 		{