Пример #1
0
 function __construct($Model)
 {
     parent::__construct();
     if (is_a($Model, 'ifx_Model')) {
         $this->Obj = $Model;
     } elseif (is_string($Model)) {
         $this->Obj = new $Model();
     }
     //Load some settings
     $Saved = $this->ci->session->flashdata($this->Obj->_table());
     if ($Saved) {
         $this->sortedBy = $Saved['sortedBy'];
     }
     if (isset($_POST['ifxTable'])) {
         foreach ($_POST['ifxTable'] as $key => $value) {
             if ($key === 'sortBy') {
                 if (!isset($this->sortedBy[$value])) {
                     $this->sortedBy[$value] = 'DESC';
                 } elseif ($this->sortedBy[$value] === 'DESC') {
                     $this->sortedBy[$value] = 'ASC';
                 } else {
                     unset($this->sortedBy[$value]);
                 }
             } else {
                 $this->{$key} = $value;
             }
         }
     }
 }
Пример #2
0
 function __construct()
 {
     parent::__construct();
     $this->ci->load->config('ifx.pagedata', true);
     $this->ci->load->database();
     foreach ($this->ci->config->item('ifx.pagedata') as $Key => $Value) {
         static::${$Key} = $Value;
     }
 }
Пример #3
0
 function __construct($Init)
 {
     parent::__construct();
     if (is_a($Init, 'ifx_Model')) {
         $this->Obj = $Init;
     } elseif (is_string($Init)) {
         $this->Obj = $this->ci->session->userdata($Init);
     }
     if (isset($_POST['ifxTable'])) {
         foreach ($_POST['ifxTable'] as $key => $value) {
             $this->{$key} = $value;
         }
     }
 }
Пример #4
0
 public function __construct($Config = array())
 {
     parent::__construct();
     $this->ci->load->helper('url');
     $this->ci->load->library('session');
     if (!in_array('title_seperator', $Config)) {
         $this->title_seperator = '-';
     } else {
         $this->title_seperator = $Config['title_seperator'];
     }
     if (!in_array('page_title', $Config)) {
         $this->page_title = site_url();
     } else {
         $this->page_title = $Config['page_title'];
     }
     if (!in_array('js_path', $Config)) {
         $this->js_path = 'assets/js';
     } else {
         $this->js_path = $Config['js_path'];
     }
     if (!in_array('css_path', $Config)) {
         $this->css_path = 'assets/css';
     } else {
         $this->css_path = $Config['css_apth'];
     }
     if (!in_array('version', $Config)) {
         if (ENVIRONMENT == 'production') {
             $this->version = date('Ym');
         } else {
             $this->version = rand();
         }
     } else {
         $this->version = $Config['version'];
     }
     $this->data = $this->ci->session->userdata(self::SESSION);
 }