Ejemplo n.º 1
0
 /**
  * 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();
 }