public static function set_initialized($bool) { self::$is_initialized = $bool; if ($bool == true) { self::$is_initializing = false; //PC::EventManager("Preparing to process ".count(self::$events)." elements in queue"); foreach (self::$queue as $event) { //PC::EventManager("Processing ".$event['event']." elements in queue"); self::fire($event['event'], $event['arg']); } } }
function BE_Controller() { $this->page_path = false; global $active_controller; global $active_show; $active_controller = $this; parent::__construct(); $this->load->helper("url"); if (!$this->is_installed() && $this->uri->segment(2) != "install" && $this->uri->segment(1) != "api") { redirect('/admin/install/index', 'location'); } if ($this->is_installed()) { $this->load->database(); @$this->load->library('datamapper'); } if (!$active_show) { $this->show = new Show($this); } else { $this->show =& $active_show; } $this->load->model('BuilderEngine'); $this->load->model('users'); if ($this->is_installed()) { $this->load->model('user'); global $cache; $this->load->model("cache"); $cache = $this->cache; $this->BuilderEngine->load_settings(); if (!EventManager::is_initialized() && !EventManager::is_initializing()) { EventManager::set_initializing(true); $this->load->model('module'); $modules = $this->module; // $modules = new Module(); foreach ($modules->get() as $module) { if ($module->folder == "module_system") { continue; } Modules::run($module->folder . "/register_events"); } EventManager::set_initialized(true); } if (self::$s_user == null) { self::$s_user = new User(); $session = $this->session; self::$s_user->_init($session); } $user_model = $this->users; global $user; $user = self::$s_user; $this->user =& self::$s_user; $CI =& get_instance(); $this->load->model('links'); $this->links_array = $this->links->get(); foreach ($this->links_array as $link) { $link->target = str_replace("%site_root%", home_url('/'), $link->target); } } $this->BuilderEngine->set_option("active_backend_theme", "dashboard", false); $this->load->library('module_parser'); $this->load->library('parser'); //$this->BuilderEngine->activate_theme("default"); //echo $this->get_page_path(); $this->load->module("layout_system"); $this->layout_system->load->model("blocks"); $this->layout_system->load->model('versions'); $this->versions =& $this->layout_system->versions; if ($this->is_installed()) { $this->load->model('Module'); $this->load->model('Group'); $this->load->model('Group_module_permission'); } }