Пример #1
0
 /**
  * doRender
  *
  * @param string            $name
  * @param \SimpleXmlElement $element
  * @param mixed             $data
  *
  * @throws \UnexpectedValueException
  * @return  mixed
  */
 protected static function doRender($name, XulEngine $engine, \SimpleXmlElement $element, $data)
 {
     XmlHelper::def($element, 'action', $data->uri->path);
     XmlHelper::def($element, 'method', 'post');
     XmlHelper::def($element, 'id', $data->view->name . '-form');
     XmlHelper::def($element, 'name', 'adminForm');
     XmlHelper::def($element, 'class', 'form-validate');
     XmlHelper::def($element, 'enctype', 'multipart/form-data');
     $attributes = XmlHelper::getAttributes($element);
     $footerHandler = XmlHelper::get($element, 'type', 'default');
     $footerHandler = array(__CLASS__, 'render' . ucfirst($footerHandler) . 'Footer');
     // Build hidden inputs
     $footer = HtmlBuilder::create('input', null, array('type' => 'hidden', 'name' => 'option', 'value' => $data->view->option));
     $footer .= HtmlBuilder::create('input', null, array('type' => 'hidden', 'name' => 'task', 'value' => ''));
     $footer .= is_callable($footerHandler) ? call_user_func_array($footerHandler, array()) : '';
     $footer .= JHtml::_('form.token');
     // Wrap inputs
     $children = static::renderChildren($engine, $element, $data);
     $children .= HtmlBuilder::create('div', $footer, array('id' => 'hidden-inputs'));
     return HtmlBuilder::create($name, $children, $attributes);
 }