Esempio n. 1
0
 public function items()
 {
     $fields = $this->tableFields;
     if ($this->uri->suffix == 'json') {
         $data = $this->Languages_Model->ajax($this->form->ajaxTableField($fields));
         return json_datatable($data);
     }
     $this->smarty->assign('buttons', array('create_new' => 'languages/add'));
     $this->smarty->view('blocks/tableajax', array('fields' => $fields, 'json' => uri_suffix('json')));
 }
Esempio n. 2
0
 public function slides()
 {
     if ($this->uri->segment(3) == 'add') {
         return self::form(0, 'slide');
     } elseif ($this->uri->segment(3) == 'edit') {
         return self::form($this->uri->segment(4), 'slide');
     } else {
         $fields = $this->slideTableFields;
         if ($this->uri->suffix == 'json') {
             $data = $this->Data_Model->ajax($this->form->ajaxTableField($fields), array('d.type' => 'slide'), 'slide');
             return json_datatable($data);
         }
         $this->smarty->assign('buttons', array('create_new' => 'data/slides/add'));
         $this->smarty->view('blocks/tableajax', array('fields' => $fields, 'json' => uri_suffix('json')));
     }
 }