Ejemplo n.º 1
0
 function set_page()
 {
     $this->page_object = new page();
     if (!isset($this->pid)) {
         $this->page_object->do_retrieve(self::$page_fields_to_retrieve, ['where_equals' => ['module_name' => _get::__namespace($this, 0)]]);
     } else {
         $this->page_object->do_retrieve_from_id(self::$page_fields_to_retrieve, $this->pid);
     }
 }
Ejemplo n.º 2
0
 public function __controller(array $path)
 {
     if (!isset($path[0])) {
         $this->current->do_retrieve_from_id([], static::$homepage_id);
         $this->view = 'home';
     } else {
         $this->current->do_retrieve_from_id([], $path[0]);
     }
     if (!$this->current->pid) {
         $this->current->do_retrieve([], ['order' => 'position']);
     } else {
         if (uri != trim($this->current->get_url(), '/')) {
             get::header_redirect($this->current->get_url());
         }
     }
     parent::__controller($path);
 }
Ejemplo n.º 3
0
 /**
  *
  */
 public function set_page_from_path()
 {
     $this->page = new page();
     if (is_numeric($this->path[0])) {
         $this->page->do_retrieve_from_id([], (int) $this->path[0]);
     } else {
         $this->page->do_retrieve([], ['where_equals' => ['module_name' => $this->path[0]]]);
     }
     $this->pid = isset($this->page->pid) ? $this->page->pid : 0;
 }