function __construct(Context $context) { $this->load = new Loader($context); $this->db = new DatabaseProxy($this->load); $this->context = $context; $this->view = new ShellView($context); $this->args = array_merge((array) $this->args, (array) $context->getArguments()); }
/** * Initializes controller * @param Context $context * @param View $view */ function __construct(Context $context, View $view) { $this->load = new Loader($context); $this->context = $context; $this->view = $view; $this->args = array_merge((array) $this->args, (array) $context->getArguments()); $base_module = $context->getBaseModuleName(); $this->config = isset(AppConfig::$modules[$base_module]) ? AppConfig::$modules[$base_module] : array(); }
function __construct(Context $context) { $this->context = $context; $history = $this->history = AdminHistory::getInstance(); $url = $this->url = new AdminUrlBuilder(); $node = $this->node = $url->getNode($context->getArguments()); $schema = $this->schema = new AdminSchema(); $menu = $this->menu = new AdminMenu($this); $load = new Loader($context); $components = $this->components = new AdminComponentList($load, $this); $modules = array(); $dirs = scandir(APPD_APPLICATION); foreach ($dirs as $dir) { if ($dir[0] != '.') { $file = APPD_APPLICATION . DS . $dir . DS . 'admin' . DS . $dir . 'admin.utility.php'; if (file_exists($file)) { $utility = $load->utility("/{$dir}/admin/{$dir}admin"); $utility->initialize($this, $components); $modules[$dir] = $utility; } $file_config = APPD_APPLICATION . DS . $dir . DS . 'admin' . DS . $dir . 'config.utility.php'; if (file_exists($file_config)) { $utility_config = $load->utility("/{$dir}/admin/{$dir}config"); $utility_config->configureSchema($schema); $utility_config->configureMenu($menu); } } } $this->modules = $modules; $current_module = $this->node->getModule(); $module = false; if (isset($this->modules[$current_module])) { $module = $this->modules[$current_module]; } if (!$module) { return false; } $module->execute(); }