Ejemplo n.º 1
0
 public function addRow($headline, $content, $index = self::END, $class = NULL)
 {
     if ($index === self::END) {
         $indexHeadline = $indexContent = self::END;
     } else {
         // wenn bei 0 eingefügt werden soll ist head = 0 und div = 1
         $indexHeadline = $index * 2;
         // wenn bei 2 eingefügt werden soll ist head = 4 (weil div+head 0 und div+head1 davor sind) und div = 5
         $indexContent = $indexHeadline + 1;
     }
     \Webforge\Common\ArrayUtil::insert($this->html->content, $head = new HTMLTag($this->getOption('headlineTag'), $headline, array('class' => $class)), $indexHeadline);
     \Webforge\Common\ArrayUtil::insert($this->html->content, $div = new HTMLTag($this->getOption('contentTag'), $content, array('class' => $class)), $indexContent);
     $head->addClass('ui-accordion-header');
     $div->setOption('br.openTag', TRUE)->setOption('tag.indent', $this->indent + 2);
 }
Ejemplo n.º 2
0
 /**
  * Eine Gruppe von Element mit einer Überschrift
  *
  * der Inhalt ist eingerückt und es befindet sich ein Rahmen herum
  * @param mixed $legend der inhalt der Überschrift
  * @param mixed $content der Inhalt des Containers
  */
 public function __construct($legend, $content = NULL, $flags = 0x0)
 {
     parent::__construct('fieldset', new \stdClass());
     $this->addClass('ui-corner-all')->addClass('ui-widget-content')->addClass('\\Psc\\group');
     $this->contentTemplate = "%legend%\n  %div%";
     $this->content->legend = HTML::tag('legend', $legend);
     $this->content->div = HTML::tag('div', $content, array('class' => 'content'));
     $this->flags = $flags;
     if ($this->flags & self::COLLAPSIBLE) {
         $this->setCollapsible();
     }
     if ($this->flags & self::CONTAINING_BLOCK) {
         $this->addClass('containing-block');
     }
 }