Example #1
0
 function ReceiveSettings()
 {
     $this->dataset = manage_receive_dataset_from_selector($this->GetClassName());
     if ($this->dataset == null) {
         return false;
     }
     if ($this->dataset->GetID() < 0) {
         add_info('Не указан набор данных');
         return false;
     }
     $this->dataset->Ref();
     $this->settings['dataset'] = array('id' => $this->dataset->GetID(), 'settings' => $this->dataset->GetSettings());
     $this->settings['content'] = content_create_support_table($this->content_id, $this->dataset->GetID(), $this->dataset->GenCreateFields());
     $this->settings['script'] = -1;
     return true;
 }
Example #2
0
 function AppendCatFromDataset($name, $dataset)
 {
     if ($dataset == nil) {
         return false;
     }
     if (trim($name) == '') {
         add_info('Название подкаталога не может быть пустым.');
         return false;
     }
     $fields = array('pid' => 'INT', 'uid' => 'INT', 'order' => 'INT');
     $arr = $dataset->GenCreateFields();
     foreach ($arr as $k => $v) {
         $fields[$k] = $v;
     }
     db_insert($this->settings['content'], array('name' => db_html_string($name), 'dataset' => $dataset->GetID(), 'timestamp' => time(), 'user_id' => user_id(), 'ip' => db_html_string(get_real_ip())));
     $cat_id = db_last_insert();
     $this->settings['cat_' . $cat_id . '_dsset'] = $dataset->settings;
     content_create_support_table($this->content_id, $dataset->GetID(), $fields, $cat_id);
     $dataset->Ref();
     $this->SaveSettings();
     return true;
 }
Example #3
0
 function ReceiveSettings($formname = '')
 {
     $this->dataset = manage_receive_dataset_from_selector($formname);
     if ($this->dataset == null) {
         return false;
     }
     if ($this->dataset->GetID() < 0) {
         add_info('Не указан набор данных');
         return false;
     }
     $this->dataset->Ref();
     $fields = array('uid' => 'INT', 'order' => 'INT');
     $arr = $this->dataset->GenCreateFields();
     foreach ($arr as $k => $v) {
         $fields[$k] = $v;
     }
     $this->settings['dataset'] = array('id' => $this->dataset->GetID(), 'settings' => $this->dataset->GetSettings());
     $this->settings['content'] = content_create_support_table($this->content_id, $this->dataset->GetID(), $fields);
     $this->settings['script'] = -1;
     $this->settings['itemScript'] = -1;
     $this->settings['fullScript'] = -1;
     $this->settings['detailed'] = $_POST[$formname . '_detailed'] ? 1 : 0;
     $this->UpdateScripts();
     $s = 'content_' . $this->content_id . '_count';
     manage_settings_create('Количество элементов на странице для раздела ' . '«' . htmlspecialchars($this->GetName()) . '»', 'Разделы', $s, 'CSCSignedNumber');
     opt_set($s, '10');
     return true;
 }