From 764672b45108814fc643be65b53b18f0b6507112 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:02:05 +0000 Subject: --- system/libraries/Hooks.php | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'system/libraries/Hooks.php') diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 389e7ac14..7ff0592ff 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -66,34 +66,6 @@ class CI_Hooks { } // END CI_Hooks() - // -------------------------------------------------------------------- - - /** - * 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() - - // -------------------------------------------------------------------- /** @@ -107,6 +79,11 @@ class CI_Hooks { */ 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) @@ -118,6 +95,8 @@ class CI_Hooks { { $this->_run_hook($this->hooks[$which]); } + + return TRUE; } // END hook_exists() @@ -144,7 +123,7 @@ class CI_Hooks { // ----------------------------------- // 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) { -- cgit v1.2.3-24-g4f1b