public function __construct($parent = NULL, $name = NULL) { parent::__construct($parent, $name); $this->form = new AppForm($this, 'form'); $this->form->addSubmit('yes', _('Yes'))->onClick[] = array($this, 'confirmClicked'); $this->form->addSubmit('no', _('No'))->onClick[] = array($this, 'cancelClicked'); $this->form->addHidden('token'); $this->question = Html::el('p'); $this->session = Environment::getSession('ConfirmationDialog/tokens'); }
protected function createPageFormBase($name, $new) { $form = new AppForm($this, $name); if (!$new) { $form->addHidden("id"); } $form->addText("name", "Name", 40, 50); $form->addTextArea("description", "Description", 40, 3); $form->addTextArea("text", "Text", 40, 15); $form->addMultiSelect("tags", "Tags", Tag::findAll()->fetchPairs("id", "name"))->setOption("description", Html::el("a")->href($this->link("Tag:"))->setText("Edit tags")); $form->addCheckbox("allowed", "Allowed"); $form->addSubmit("s", "Save"); return $form; }