Exemple #1
0
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     // default display value
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     array_push($this->twig_include_path, root);
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
Exemple #2
0
 /**
  * constructor
  * @param boolean $object controller
  */
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $this->data->display['main'] = "content/main/layout.html";
     $this->data->display['home'] = "content/home/display.html";
     $this->data->display['cp'] = "content_cp/home/layout.html";
     $this->data->display['account'] = "content_account/home/layout.html";
     $this->data->template['header'] = 'content/template/header.html';
     $this->data->template['sidebar'] = 'content/template/sidebar.html';
     $this->data->template['footer'] = 'content/template/footer.html';
     $this->data->saloos['version'] = \lib\saloos::getLastVersion();
     $this->data->saloos['lastUpdate'] = \lib\saloos::getLastUpdate();
     $this->data->saloos['langlist'] = ['fa_IR' => 'Persian - فارسی', 'en_US' => 'English', 'ar_SU' => 'Arabic - العربية'];
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }