library/core/class.pluginmanager.php
private function _PluginHook($PluginName, $ForAction, $Callback = FALSE) {

      switch ($ForAction) {
         case self::ACTION_ENABLE:  $HookMethod = 'Setup'; break;
         case self::ACTION_DISABLE: $HookMethod = 'OnDisable'; break;
         case self::ACTION_REMOVE:  $HookMethod = 'CleanUp'; break;
         case self::ACTION_ONLOAD:  $HookMethod = 'OnLoad'; break;
      }

      $PluginInfo      = ArrayValue($PluginName, $this->AvailablePlugins(), FALSE);
      $PluginFolder    = ArrayValue('Folder', $PluginInfo, FALSE);
      $PluginClassName = ArrayValue('ClassName', $PluginInfo, FALSE);

      if ($ForAction === self::ACTION_REMOVE) {
         $this->_RemovePluginFolder($PluginFolder);
      }

      if ($PluginFolder !== FALSE && $PluginClassName !== FALSE && class_exists($PluginClassName) === FALSE) {
         if ($ForAction !== self::ACTION_DISABLE) {
            $this->IncludePlugins(array($PluginName => TRUE));
         }

         $this->_PluginCallbackExecution($PluginClassName, $HookMethod);
      } elseif ($Callback === TRUE) {
         $this->_PluginCallbackExecution($PluginClassName, $HookMethod);
      }
   }
private function _PluginHook($PluginName, $ForAction, $Callback = FALSE) {

      switch ($ForAction) {
         case self::ACTION_ENABLE:  $HookMethod = 'Setup'; break;
         case self::ACTION_DISABLE: $HookMethod = 'OnDisable'; break;
         case self::ACTION_REMOVE:  $HookMethod = 'CleanUp'; break;
         case self::ACTION_ONLOAD:  $HookMethod = 'OnLoad'; break;
      }

      $PluginInfo      = ArrayValue($PluginName, $this->AvailablePlugins(), FALSE);
      $PluginFolder    = ArrayValue('Folder', $PluginInfo, FALSE);
      $PluginClassName = ArrayValue('ClassName', $PluginInfo, FALSE);

      if ($ForAction === self::ACTION_REMOVE) {
         $this->_RemovePluginFolder($PluginFolder);
      }

      if ($PluginFolder !== FALSE && $PluginClassName !== FALSE && class_exists($PluginClassName) === FALSE) {
         if ($ForAction !== self::ACTION_DISABLE) {
            $this->IncludePlugins(array($PluginName => TRUE));
         }

         $this->_PluginCallbackExecution($PluginClassName, $HookMethod);
      } elseif ($Callback === TRUE) {
         $this->_PluginCallbackExecution($PluginClassName, $HookMethod);
      }
   }
private function _PluginHook ( $ PluginName , $ ForAction , $ Callback = FALSE ) { switch ( $ ForAction ) { case self :: ACTION_ENABLE : $ HookMethod = 'Setup' ; break ; case self :: ACTION_DISABLE : $ HookMethod = 'OnDisable' ; break ; case self :: ACTION_REMOVE : $ HookMethod = 'CleanUp' ; break ; case self :: ACTION_ONLOAD : $ HookMethod = 'OnLoad' ; break ; } $ PluginInfo = ArrayValue ( $ PluginName , $ this -> AvailablePlugins ( ) , FALSE ) ; $ PluginFolder = ArrayValue ( 'Folder' , $ PluginInfo , FALSE ) ; $ PluginClassName = ArrayValue ( 'ClassName' , $ PluginInfo , FALSE ) ; if ( $ ForAction === self :: ACTION_REMOVE ) { $ this -> _RemovePluginFolder ( $ PluginFolder ) ; } if ( $ PluginFolder !== FALSE && $ PluginClassName !== FALSE && class_exists ( $ PluginClassName ) === FALSE ) { if ( $ ForAction !== self :: ACTION_DISABLE ) { $ this -> IncludePlugins ( array ( $ PluginName => TRUE ) ) ; } $ this -> _PluginCallbackExecution ( $ PluginClassName , $ HookMethod ) ; } elseif ( $ Callback === TRUE ) { $ this -> _PluginCallbackExecution ( $ PluginClassName , $ HookMethod ) ; } }
Hooks to the various actions, i.e. enable, disable and remove.

@param string $PluginName
@param string $ForAction which action to hook it to, i.e. enable, disable or remove
@param boolean $Callback whether to perform the hook method
@return void
Hooks to the various actions i . e . enable disable and remove .