Esempio n. 1
0
 public function addList($items = array())
 {
     $list = new HtmlList("", $items);
     $list->setClass("list");
     $this->content["list"] = $list;
     return $list;
 }
Esempio n. 2
0
 public function addCheckedList($items = array(), $masterItem = NULL, $values = array())
 {
     $count = $this->count();
     $identifier = $this->identifier . "-" . $count;
     if (isset($masterItem)) {
         $masterO = new HtmlFormCheckbox("master-" . $identifier, $masterItem);
         $masterO->getField()->addToProperty("class", "master");
         $masterO->setClass("item");
         $this->addItem($masterO);
     }
     $fields = array();
     $i = 0;
     foreach ($items as $val => $caption) {
         $itemO = new HtmlFormCheckbox($identifier . "-" . $i++, $caption, $val, "child");
         if (\array_search($val, $values) !== false) {
             $itemO->getField()->getField()->setProperty("checked", "");
         }
         $itemO->setClass("item");
         $fields[] = $itemO;
     }
     if (isset($masterO) === true) {
         $list = new HtmlList("", $fields);
         $list->setClass("list");
         $masterO->addContent($list);
     } else {
         $this->addList($fields);
     }
     $this->_hasCheckedList = true;
     return $this;
 }