Beispiel #1
0
 /**
  * Success.
  */
 protected function success()
 {
     $this->setBuilder($this->createBuilder());
     $dataDescription = new DataDescription();
     $ddi = new FieldDescription('result');
     $ddi->setType(FieldDescription::FIELD_TYPE_TEXT);
     $ddi->setMode(FieldDescription::FIELD_MODE_READ);
     $ddi->removeProperty('title');
     $dataDescription->addFieldDescription($ddi);
     $data = new Data();
     $di = new Field('result');
     $di->setData($this->translate('TXT_FEEDBACK_SUCCESS_SEND'));
     $data->addField($di);
     $this->setDataDescription($dataDescription);
     $this->setData($data);
     $this->setAction('');
     $this->addToolbar($this->loadToolbar());
 }
Beispiel #2
0
 /**
  * Show registration result.
  */
 protected function success()
 {
     //если в сессии нет переменной saved значит этот метод пытаются вызвать напрямую. Не выйдет!
     /*if (!isset($_SESSION['saved'])) {
           throw new SystemException('ERR_404', SystemException::ERR_404);
       }*/
     //unset($_SESSION['saved']);
     if ($textBlock = $this->document->componentManager->getBlockByName('RegTextBlock')) {
         $textBlock->disable();
     }
     $this->setBuilder($this->createBuilder());
     $dataDescription = new DataDescription();
     $ddi = new FieldDescription('success_message');
     $ddi->setType(FieldDescription::FIELD_TYPE_TEXT);
     $ddi->setMode(FieldDescription::FIELD_MODE_READ);
     $ddi->removeProperty('title');
     $dataDescription->addFieldDescription($ddi);
     $data = new Data();
     $di = new Field('success_message');
     $di->setData($this->translate('TXT_USER_REGISTRED'));
     $data->addField($di);
     $this->setDataDescription($dataDescription);
     $this->setData($data);
 }
Beispiel #3
0
 protected function prepare()
 {
     parent::prepare();
     if (in_array($this->getState(), array('add', 'edit'))) {
         $fd = new FieldDescription('domains');
         $fd->setType(FieldDescription::FIELD_TYPE_TAB);
         $fd->setProperty('title', $this->translate('TAB_DOMAINS'));
         $this->getDataDescription()->addFieldDescription($fd);
         $field = new Field('domains');
         $state = $this->getState();
         $tab_url = ($state != 'add' ? $this->getData()->getFieldByName($this->getPK())->getRowData(0) : '') . '/domains/';
         $field->setData($tab_url, true);
         $this->getData()->addField($field);
         $fd = $this->getDataDescription()->getFieldDescriptionByName('site_folder');
         $fd->setType(FieldDescription::FIELD_TYPE_SELECT);
         $fd->loadAvailableValues($this->loadFoldersData(), 'key', 'value');
         if ($this->getData()->getFieldByName('site_is_default')->getRowData(0) == 1) {
             $this->getDataDescription()->getFieldDescriptionByName('site_is_default')->setMode(FieldDescription::FIELD_MODE_READ);
         }
         $tagField = new FieldDescription('tags');
         $tagField->setType(FieldDescription::FIELD_TYPE_STRING);
         $tagField->removeProperty('pattern');
         $this->getDataDescription()->addFieldDescription($tagField);
         if ($this->getState() == 'add') {
             //Добавляем селект позволяющий скопировать структуру одного из существующих сайтов в новый
             $fd = new FieldDescription('copy_site_structure');
             $fd->setType(FieldDescription::FIELD_TYPE_SELECT);
             $fd->loadAvailableValues($this->dbh->select('SELECT ss.site_id, site_name FROM share_sites ss LEFT JOIN share_sites_translation sst ON ss.site_id = sst.site_id WHERE lang_id =%s ', $this->document->getLang()), 'site_id', 'site_name');
             $this->getDataDescription()->addFieldDescription($fd);
         } else {
             $this->getDataDescription()->getFieldDescriptionByName($this->getPK())->setType(FieldDescription::FIELD_TYPE_INT)->setMode(FieldDescription::FIELD_MODE_READ);
             $tm = new TagManager($this->getDataDescription(), $this->getData(), $this->getTableName());
             $tm->createFieldDescription();
             $tm->createField();
         }
     }
 }
Beispiel #4
0
 /**
  * Show message about incorrect password.
  *
  * @throws SystemException 'ERR_404'
  */
 protected function error()
 {
     //если в сессии нет переменной error, значит этот метод пытаются дернуть напрямую. Не выйдет!
     if (!isset($_SESSION['error'])) {
         throw new SystemException('ERR_404', SystemException::ERR_404);
     }
     //Мавр сделал свое дело...
     unset($_SESSION['error']);
     $this->setBuilder($this->createBuilder());
     $dd = new DataDescription();
     $this->setDataDescription($dd);
     $ddi = new FieldDescription('error_message');
     $ddi->setType(FieldDescription::FIELD_TYPE_TEXT);
     $ddi->setMode(FieldDescription::FIELD_MODE_READ);
     $ddi->removeProperty('title');
     $dd->addFieldDescription($ddi);
     $d = new Data();
     $this->setData($d);
     $di = new Field('error_message');
     $di->setData($this->translate('TXT_USER_PROFILE_WRONG_PWD'));
     $d->addField($di);
     $this->document->componentManager->getBlockByName('breadCrumbs')->addCrumb();
 }
Beispiel #5
0
 /**
  * Call this by successful captcha.
  */
 protected function success()
 {
     $this->setBuilder($this->createBuilder());
     $dataDescription = new DataDescription();
     $ddi = new FieldDescription('result');
     $ddi->setType(FieldDescription::FIELD_TYPE_TEXT);
     $ddi->setMode(FieldDescription::FIELD_MODE_READ);
     $ddi->removeProperty('title');
     $dataDescription->addFieldDescription($ddi);
     $data = new Data();
     $di = new Field('result');
     $di->setData($this->translate('TXT_FORM_SUCCESS_SEND'));
     $data->addField($di);
     $this->setDataDescription($dataDescription);
     $this->setData($data);
     $this->setTitle($this->dbh->getScalar('frm_forms_translation', ['form_name'], ['form_id' => $this->formID, 'lang_id' => E()->getLanguage()->getCurrent()]));
 }