예제 #1
0
파일: table.php 프로젝트: poef/ariadne
 private function getRows($list)
 {
     $nodes = ar_html::nodes();
     foreach ($list as $key => $content) {
         if (!is_array($content)) {
             $content = array($content);
         }
         $cells = $this->getCells($content, 'td')->setAttribute('class', array('tableOddEven' => ar::listPattern('(tableOdd tableEven?)*'), 'tableFirstLast' => ar::listPattern('tableFirst .*', '.* tableLast')));
         $nodes[] = ar_html::tag('tr', ar_html::nodes($header, $cells));
     }
     return $nodes;
 }
예제 #2
0
파일: form.php 프로젝트: poef/ariadne
 protected function getButtons($name, $options, $value, $attributes)
 {
     $content = ar_html::nodes();
     if (!isset($options)) {
         $options = $this->options;
     }
     if (is_array($options)) {
         foreach ($options as $key => $button) {
             if (!is_array($button)) {
                 $button = array('label' => $button);
             }
             if (!isset($button['value'])) {
                 $button['value'] = $key;
             }
             $content[] = $this->getButton($key, $name, $button, $value, $attributes);
         }
     }
     $content->setAttribute('class', array('formButtonList' => ar::listPattern('formButtonListFirst .*', '.* formButtonListLast')));
     if (!$this->multiple) {
         $content->insertBefore(ar_html::el('input', array('type' => 'hidden', 'name' => $name, 'value' => $value)), $content->firstChild);
     }
     return $content;
 }
예제 #3
0
파일: menu.php 프로젝트: poef/ariadne
 public function stripe($options = array())
 {
     $options += array('striping' => ar::listPattern('menuFirst .*', '(menuOdd menuEven?)*', '.* menuLast'), 'stripingContinue' => false);
     if ($options['striping']) {
         if ($options['stripingContinue']) {
             $this->getElementsByTagName($this->options['itemTag'])->setAttribute('class', array('menuStriping' => $options['striping']));
         } else {
             $this->childNodes->setAttribute('class', array('menuStriping' => $options['striping']));
             $uls = $this->getElementsByTagName($this->options['listTag']);
             foreach ($uls as $ul) {
                 $ul->childNodes->setAttribute('class', array('menuStriping' => $options['striping']));
             }
         }
     }
     $this->stripeOptions = $options;
     return $this;
 }