Beispiel #1
0
 protected function createComponentTagForm()
 {
     $form = $this->tagFormFactory->create();
     unset($form['name']);
     $form->getElementPrototype()->id = 'form-tag-' . $this->tag->getId();
     $form['color']->setHtmlId('tag-color-input-' . $this->tag->getId())->setDefaultValue($this->tag->getColor());
     $form['save']->setHtmlId('tag-submit-' . $this->tag->getId());
     $form->onSuccess[] = [$this, 'processTag'];
     $form->addProtection();
     if (!$this->authorizator->isAllowed($this->user, 'page_tag', 'edit')) {
         $form['save']->setDisabled();
     }
     return $form;
 }
Beispiel #2
0
 protected function createComponentTagForm()
 {
     $form = $this->tagFormFactory->create();
     $form->getElementPrototype()->id = '#new-tag-form';
     $form['color']->setHtmlId('creation-form-color');
     if ($this->isAjaxified) {
         $form->getElementPrototype()->class = 'ajax';
     }
     $form->onSuccess[] = [$this, 'processNewTag'];
     if (!$this->authorizator->isAllowed($this->user, 'page_tag', 'create')) {
         $form['save']->setDisabled();
     }
     $form->addProtection();
     return $form;
 }