/** * Gets and load the page related action file */ function get_action() { $action_name = strtolower(end($this->folders)); //Make sure this action exists $core_action = CORE_DIR . "view/" . $this->page_dir . '/action.php'; if (file_exists($core_action)) { include $core_action; $action = $action_name . "_Action"; } else { if (!($action = Core_Framework_View::get_cms_page($this))) { Core_Framework_Helper::error404(); } else { $this->page_dir = '../layouts_cms/' . $action->page_dir; } } //See if there is a custom action file $account_action = ACCOUNT_DIR . "view/" . $this->page_dir . '/action.php'; if (file_exists($account_action)) { include $account_action; $action = $action_name . "_Action"; } if (is_string($action)) { $action = new $action(); } $action->pre(); $action->init(); $action->post(); }
/** * Redirect to the 404 page * Page URL taken from config file * To be called statically */ public static function error404() { $config = Core_Framework_Singleton::config()->ini; Core_Framework_Helper::redirect($config['cross_site']['error404']); }
/** * Simple header redirect to be called statically * @param string $url */ public static function redirect($url) { Core_Framework_Helper::redirect($url); }