Provides a mechanism to extend the base system without hacking. Most of this class is borrowed from Paul's Extension class in ExpressionEngine.
Author: ExpressionEngine Dev Team
 protected function callHook($hook)
 {
     if ($this->enableHooks) {
         return $this->hooks->call_hook($hook);
     }
     return false;
 }
 /**
  * @method __construct
  * @param string/int $init - user id or email of user to load      
  * @access public    
  * @return none
  */
 public function __construct($init = false)
 {
     parent::__construct();
     $this->CI =& get_instance();
     $this->CI->load->library('session');
     $this->CI->load->helper(array('form', 'url', 'cookie'));
 }
Example #3
0
 function _run_hook($data)
 {
     if (is_callable($data)) {
         call_user_func_array($data, array());
     } else {
         return parent::_run_hook($data);
     }
 }
Example #4
0
 function _call_hook($which = '')
 {
     if (!isset($this->myhooks[$which])) {
         return parent::_call_hook($which);
     }
     if (isset($this->myhooks[$which][0]) and is_array($this->myhooks[$which][0])) {
         foreach ($this->myhooks[$which] as $val) {
             $this->_my_run_hook($val);
         }
     } else {
         $this->_my_run_hook($this->myhooks[$which]);
     }
     return parent::_call_hook($which);
 }
 /**
  * Run Hook
  *
  * Runs a particular hook
  *
  * @param	array	$data	Hook details
  * @return	bool	TRUE on success or FALSE on failure
  */
 protected function _run_hook($data)
 {
     if (is_array($data)) {
         $a_path = APPPATH . trim($data['filepath'], '/') . '/' . $data['filename'];
         if (!file_exists($a_path)) {
             // Let's try to load a hook outside
             $repeater = rtrim(str_repeat('../', substr_count(APPPATH, '/')), '/');
             $b_path = $repeater . '/' . trim($data['filepath'], '/');
             if (realpath(APPPATH . $b_path)) {
                 $data['filepath'] = rtrim($b_path, '/') . '/';
             }
         }
     }
     return parent::_run_hook($data);
 }
 protected function callHook($hook)
 {
     if ($this->enableHooks) {
         $this->hooks->call_hook($hook);
     }
 }
Example #7
0
 function __construct()
 {
     parent::__construct();
     log_message('debug', 'Plain_Hooks Class Initialized');
 }
 /**
  * @method __construct
  * @param string/int $init - user id or email of user to load      
  * @access public    
  * @return none
  */
 public function __construct($init = false)
 {
     parent::__construct();
 }