13 require_once
'Dataface/SkinTool.php';
17 require_once
'HTML/QuickForm/Renderer/Default.php';
19 define(
'DATAFACE_RENDERER_FIELD_NOT_FOUND',2005);
34 parent::HTML_QuickForm_Renderer_Default();
35 $this->setRequiredNoteTemplate(
'');
44 $context = array(
"field"=>$element->getFieldDef(),
"element"=>$element->toHtml(),
"required"=>$required,
"error"=>$error,
"frozen"=>$element->isFrozen());
45 $context[
'properties'] =& $element->getProperties();
52 if ( !$this->_inGroup ){
54 $this->_skinTool->display($context, $this->elementTemplate);
55 $html = ob_get_contents();
57 $this->_html .= $html;
61 $this->_skinTool->display($context, $this->groupElementTemplate);
62 $html = ob_get_contents();
64 $this->_groupElements[] =& $html;
70 $name = $group->getName();
71 if ( isset( $this->_groupWraps[$name] ) )
72 $this->_groupTemplate = $this->_groupWraps[$name] ;
74 $this->_groupTemplate =
'';
75 $this->_groupElementTemplate = empty($this->_groupTemplates[$name])?
'': $this->_groupTemplates[$name];
76 $this->_groupWrap = empty($this->_groupWraps[$name])?
'': $this->_groupWraps[$name];
77 $this->_groupElements = array();
78 $this->_inGroup =
true;
84 $separator = $group->_separator;
85 if (is_array($separator)) {
86 $count = count($separator);
88 for ($i = 0; $i < count($this->_groupElements); $i++) {
89 $html .= (0 == $i?
'': $separator[($i - 1) % $count]) . $this->_groupElements[$i];
92 if (is_null($separator)) {
97 $html = implode((
string)$separator, $this->_groupElements);
99 if (!empty($this->_groupWrap)) {
100 $html = str_replace(
'{content}', $html, $this->_groupWrap);
103 $this->_html .= $html;
104 $this->_inGroup =
false;