/**
     * htmlProvider
     *
     * @return  array
     */
    public function htmlProvider()
    {
        return array(array('p', 'Hello world', array('id' => 'test-id', 'class' => 'test-class'), '<p id="test-id" class="test-class">Hello world</p>'), array('ul', HtmlBuilder::create('li', 'Hello world', array()) . HtmlBuilder::create('li', 'Hello world', array()), array('id' => 'test-id', 'class' => 'test-class'), '<ul id="test-id" class="test-class">
					<li>Hello world</li>
					<li>Hello world</li>
				</ul>'), array('select', HtmlBuilder::create('option', 'BOY', array('value' => 1, 'selected' => true)) . HtmlBuilder::create('option', 'GIRL', array('value' => 2)), array('id' => 'test-id', 'class' => 'test-class'), '<select id="test-id" class="test-class">
					<option value="1" selected="selected">BOY</option>
					<option value="2">GIRL</option>
				</select>'), array('img', null, array('id' => 'test-id', 'class' => 'test-class', 'src' => 'http://placehold.it/100x100'), '<img id="test-id" class="test-class" src="http://placehold.it/100x100" />'), array('br', null, array(), '<br />'), array('video', '', array('id' => 'test-id', 'controls' => true, 'muted' => true), '<video id="test-id" controls muted></video>'));
    }
 /**
  * doRender
  *
  * @param string            $name
  * @param \SimpleXmlElement $element
  * @param mixed             $data
  *
  * @throws \UnexpectedValueException
  * @return  mixed
  */
 protected static function doRender($name, XulEngine $engine, \SimpleXmlElement $element, $data)
 {
     $formVar = XmlHelper::get($element, 'form', 'form');
     $fieldset = XmlHelper::get($element, 'name');
     if (!$fieldset) {
         throw new \UnexpectedValueException('Need "name" attribute in XUL <fieldset> element.');
     }
     $form = $data->{$formVar};
     if (!$form instanceof \JForm) {
         throw new \UnexpectedValueException(sprintf('No form data found in $data->%s.', $formVar));
     }
     $option = $data->view->option ?: 'LIB_WINDWALKER';
     $label = XmlHelper::get($element, 'label', $option . '_EDIT_FIELDSET_' . $fieldset);
     $label = String::parseVariable($label, $data);
     $html = '<legend>' . \JText::_(strtoupper($label)) . '</legend>';
     foreach ($form->getFieldset($fieldset) as $field) {
         $html .= $field->getControlGroup() . "\n\n";
     }
     $html = HtmlBuilder::create('fieldset', $html, XmlHelper::getAttributes($element));
     return $html;
 }
Example #3
0
 /**
  * renderGridFooter
  *
  * @return  string
  */
 protected static function renderGridFooter()
 {
     $children = '';
     $children .= HtmlBuilder::create('input', null, array('type' => 'hidden', 'name' => 'boxchecked', 'value' => ''));
     return $children;
 }
 /**
  * contentProvider
  *
  * @return  array
  */
 public function contentProvider()
 {
     $string = 'Hello world';
     return array(array('div', $string, $string), array('ul', HtmlBuilder::create('li', $string), '<li>' . $string . '</li>'));
 }