Esempio n. 1
0
 public function do_submit($no_session = false)
 {
     if (!$no_session) {
         foreach ($this->fields as $field) {
             if ($field instanceof field_boolean && !$this->{$field->field_name}) {
                 session::un_set('cms', 'filter', $this->_mid, $field->field_name);
             } else {
                 session::set($this->{$field->field_name}, 'cms', 'filter', $this->_mid, $field->field_name);
             }
         }
     }
     $module = new _cms_module();
     $module->do_retrieve([], ['where_equals' => ['mid' => $this->_mid]]);
     $list = new _cms_table_list($module, 1);
     ajax::update($list->get_table());
 }
Esempio n. 2
0
 public function do_delete()
 {
     $module = new _cms_module([], $_REQUEST['mid']);
     $object = $module->get_class();
     $class = $module->get_class_name();
     $class::$retrieve_deleted = true;
     $object->do_retrieve_from_id(['deleted'], $_REQUEST['id']);
     if ($object->get_primary_key()) {
         if ($object->deleted) {
             db::delete(get::__class_name($class))->filter($object->get_primary_key_name() . '=' . $_REQUEST['id'])->execute();
         } else {
             $object->deleted = true;
             $object->do_save();
         }
     }
     $list = new object\_cms_table_list($module, 1);
     ajax::update($list->get_table());
 }
Esempio n. 3
0
 public function do_toggle_expand()
 {
     if (isset($_REQUEST['id'])) {
         $module = new _cms_module();
         $module->do_retrieve([], ['where_equals' => ['mid' => $_REQUEST['mid']]]);
         if (_session::is_set('cms', 'expand', $module->mid)) {
             $value = _session::get('cms', 'expand', $module->mid);
             if (($key = array_search($_REQUEST['id'], $value)) !== false) {
                 unset($value[$key]);
             } else {
                 $value[] = $_REQUEST['id'];
             }
             _session::set($value, 'cms', 'expand', $module->mid);
         } else {
             _session::set([$_REQUEST['id']], 'cms', 'expand', $module->mid);
         }
         $list = new _cms_table_list($module, 1);
         _ajax::update($list->get_table());
     }
 }