예제 #1
0
 public function __construct()
 {
     parent::__construct();
     $this->design_page_name = '';
     $this->add_event(PAGE_INIT, 'check_login');
     $this->add_event(PAGE_INIT, 'on_init');
     if ($dh = opendir(CMS . 'modules/')) {
         while (($name = readdir($dh)) !== false) {
             if (is_dir(CMS . 'modules/' . $name)) {
                 if (@file_exists(CMS . 'modules/' . $name . '/admin.php')) {
                     require_once CMS . 'modules/' . $name . '/admin.php';
                     $class_name = Cms::capitalize_words($name) . 'AdminModule';
                     $this->modules[$name] = new $class_name();
                     $this->modules[$name]->owner = $this;
                 }
             }
         }
         closedir($dh);
     }
     uasort($this->modules, create_function('$a,$b', 'return Cms::path_parts_count($b->get_tree_subpath())-Cms::path_parts_count($a->get_tree_subpath());'));
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     $this->design_page_name = '';
     $this->add_event(PAGE_INIT, 'check_login');
     $this->add_event(PAGE_INIT, 'on_init');
     $this->add_event(AJ_INIT, 'ajax_check_login');
     if ($dh = opendir(CMS . 'modules/')) {
         while (($name = readdir($dh)) !== false) {
             if (is_dir(CMS . 'modules/' . $name)) {
                 if (@file_exists(CMS . 'modules/' . $name . '/admin.php')) {
                     require_once CMS . 'modules/' . $name . '/admin.php';
                     $class_name = Cms::capitalize_words($name) . 'AdminModule';
                     $this->modules[$name] = new $class_name();
                     $this->modules[$name]->owner = $this;
                 }
             }
         }
         closedir($dh);
         foreach ($this->modules as $module) {
             $module->register();
         }
     }
 }