Example #1
0
 /**
  * Constructor
  * Initialize site model
  * 
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct('sites');
     // get area
     $this->area = $this->set_data();
     // if no language is set by route set area predefined language
     $this->lang = empty(X4Route_core::$lang) ? $this->area->lang : X4Route_core::$lang;
     // set language
     X4Route_core::set_lang($this->lang);
     // get site
     $this->site = $this->get_site($this->area->id);
     if (!$this->area || !$this->site) {
         header('Location: ' . ROOT . 'public/msg/message/_page_not_found');
         die;
     }
     // set now
     $this->now = time();
     // Load site parameters
     $this->to_define();
 }