Exemple #1
0
 /**
  * Обновляет данные конфига и данные о скрипте
  */
 public function postConfig($name, $url_key, $move_id = null)
 {
     if (!is_null($move_id)) {
         $this->updateScript($move_id, $name, $url_key);
         SitemapCMSForms::updateSitemapPageFromPost($this->aSitemap);
     }
     parent::post();
 }
 public function actionCreate($id = 0)
 {
     $id = (int) $id;
     $model = $id > 0 ? AdminConfig::model()->findByPk($id) : new AdminConfig();
     if (request()->getIsPostRequest() && isset($_POST['AdminConfig'])) {
         $model->attributes = $_POST['AdminConfig'];
         $model->category_id = AdminConfig::CATEGORY_CUSTOM;
         if ($model->save()) {
             user()->setFlash('save_config_success', t('cofig_save_success', 'admin'));
             request()->redirect(url('admin/config/view', array('categoryid' => AdminConfig::CATEGORY_CUSTOM)));
         }
     }
     $this->adminTitle = t('create_custom_param', 'admin');
     $this->render('create', array('model' => $model));
 }
 public function actionStep4()
 {
     error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
     $conf_form = new InstallConfig();
     $conf_form_long = new AdminConfig();
     $conf_form->getAvailableStep();
     if ($conf_form->available_step < 4) {
         $this->redirect($this->createUrl('install/step3'));
     }
     if (Yii::app()->request->isPostRequest && isset($_POST['schedule'])) {
         $conf_form->setSchedule();
         $conf_form_long->deleteSync();
         $conf_form_long->createSync();
     }
     $conf_form->getAvailableStep();
     $this->render('step4', array('conf_form' => $conf_form, 'conf_form_long' => $conf_form_long));
 }
 public function actionLongDbTask()
 {
     $conf_form = new AdminConfig();
     if (!$conf_form->status) {
         $this->redirect($this->createUrl('superadmin/longdbsetup'));
     }
     // $conf_form->init_sync();
     if (Yii::app()->request->isPostRequest and (isset($_POST['save_db_sync']) or isset($_POST['delete_db_sync']))) {
         $conf_form->attributes = $_POST['AdminConfig'];
         if ($conf_form->validate()) {
             $conf_form->saveDBSYNCConfig();
             $conf_form->deleteSync();
             if (isset($_POST['save_db_sync'])) {
                 $conf_form->createSync();
             }
         }
     }
     $this->render('longdbtask', array('conf_form' => $conf_form, 'const' => Yii::app()->params['CONST']['delete_periodicity'], 'periodicity' => Yii::app()->params['CONST']['periodicity']));
 }