コード例 #1
0
ファイル: MultiFields.php プロジェクト: ekowabaka/wyf
 public function setTemplate($template)
 {
     $this->template = $template;
     $buttons = new ButtonBar();
     $buttons->setId("multi-form-buttons");
     $buttons->addButton("Clear");
     $buttons->buttons[0]->addAttribute("onclick", "fapiMultiFormRemove('--index--')");
     $this->template->setName($this->template->getName() . "[]");
     $this->templateName = $template->getName();
     $template->setId("multiform-content---index--");
     return $this;
 }
コード例 #2
0
ファイル: MultiElements.php プロジェクト: ekowabaka/cfx
 public function setTemplate($template)
 {
     $this->template = $template;
     $template->addCssClass("fapi-multiform-sub");
     $buttons = new ButtonBar();
     $buttons->setId("multi-form-buttons");
     $buttons->addButton("Clear");
     $buttons->buttons[0]->addAttribute("onclick", "fapiMultiFormRemove('--index--')");
     $elements = $template->getFields();
     foreach ($elements as $element) {
         if ($element->getType() == "Field") {
             $element->setId($element->getId() == "" ? $element->getName() : $element->getId());
             $element->setName($template->getName() . "." . $element->getName() . "[]");
         }
         $element->setId($element->getId() . "_--index--");
     }
     $this->templateName = $template->getName();
     $template->setId("multiform-content---index--");
     $template->add($buttons);
     return $this;
 }