Esempio n. 1
0
 protected function add()
 {
     parent::add();
     if ($fd = $this->getDataDescription()->getFieldDescriptionByName('lang_default')) {
         $fd->setType(FieldDescription::FIELD_TYPE_HIDDEN);
     }
 }
 public function add()
 {
     parent::add();
     $data = $this->getData();
     if ($subscription_id = $this->getParam('subscriptionID')) {
         $f = $data->getFieldByName('subscription_id');
         $f->setRowData(0, $subscription_id);
     }
 }
 /**
  * @copydoc Grid::add
  */
 protected function add()
 {
     parent::add();
     $this->getData()->getFieldByName('vote_question_counter')->setData(0, true);
 }
Esempio n. 4
0
 /**
  * @copydoc Grid::add
  */
 protected function add()
 {
     parent::add();
     //@todo Тут пришлось пойти на извращение
     $actionParams = $this->getStateParams(true);
     $this->buildRightsTab($actionParams['pid']);
     $this->getDataDescription()->getFieldDescriptionByName('smap_segment')->removeProperty('nullable');
     $site = E()->getSiteManager()->getSiteByPage($actionParams['pid']);
     $sitemap = E()->getMap($site->id);
     $this->getData()->getFieldByName('site_id')->setData($site->id, true);
     $field = $this->getData()->getFieldByName('smap_pid');
     $smapSegment = $sitemap->getURLByID($actionParams['pid']);
     foreach ([Document::TMPL_CONTENT, Document::TMPL_LAYOUT] as $type) {
         if ($f = $this->getDataDescription()->getFieldDescriptionByName('smap_' . $type)) {
             $f->setType(FieldDescription::FIELD_TYPE_SELECT);
             $f->loadAvailableValues($this->loadTemplateData($type, $site->folder), 'key', 'value');
         }
     }
     if ($name = $this->dbh->getScalar($this->getTranslationTableName(), ['smap_name'], ['smap_id' => $actionParams['pid'], 'lang_id' => $this->document->getLang()])) {
         for ($i = 0, $langCount = count(E()->getLanguage()->getLanguages()); $i < $langCount; $i++) {
             $field->setRowData($i, $actionParams['pid']);
             $field->setRowProperty($i, 'data_name', $name);
             $field->setRowProperty($i, 'segment', $smapSegment);
         }
     }
     $tm = new TagManager($this->getDataDescription(), $this->getData(), $this->getTableName());
     $tm->createFieldDescription();
     $tm->createField('menu');
     //Ads
     if (class_exists('AdsManager', false) && AdsManager::isActive()) {
         $ads = new AdsManager();
         $ads->add($this->getDataDescription());
     }
 }