示例#1
0
 /**
  * @param $filter
  * @param $callback
  * @param int $priority
  */
 public static function unregister($filter, $callback, $priority = 100)
 {
     if (!isset(self::$FilterSections[$filter]['handler'])) {
         if (!isset(self::$FilterSections)) {
             self::$FilterSections = [];
         }
         $id = generate_hash_for_array($callback);
         unset(self::$FilterSections[$filter][$priority][$id]);
         return;
     }
 }
示例#2
0
 /**
  * Register a section.
  *
  * @param $section
  * @param $callback
  * @param int $priority
  */
 public static function register($section, $callback, $priority = 100)
 {
     if (!isset(self::$ViewSections[$section]['handler'])) {
         if (!isset(self::$ViewSections)) {
             self::$ViewSections = array();
         }
         $id = generate_hash_for_array($callback);
         self::$ViewSections[$section][$priority][$id] = $callback;
         return;
     }
     $handler = self::$ViewSections[$section]['handler'];
     call_user_func($handler, $section, $callback);
 }
示例#3
0
 /**
  * @param $hook
  * @param $callback
  * @param int $priority
  */
 public static function removeCallback($hook, $callback, $priority = 100)
 {
     $id = generate_hash_for_array($callback);
     unset(self::$Hooks[$hook][$priority][$id]);
 }