Ejemplo n.º 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;
 }