本文整理汇总了PHP中HTML_QuickForm_group类的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm_group类的具体用法?PHP HTML_QuickForm_group怎么用?PHP HTML_QuickForm_group使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML_QuickForm_group类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setElements
function setElements($elements)
{
parent::setElements($elements);
foreach ($this->_elements as $element) {
if (method_exists($element, 'setHiddenLabel')) {
$element->setHiddenLabel(true);
}
}
}
示例2: toHtml
/**
* HTML representation
*/
function toHtml()
{
include_once 'HTML/QuickForm/Renderer/Default.php';
$this->_separator = '<br/>';
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
$select_boxes = $this->_elements[2];
$select_boxes->setElementTemplate('<div style="margin-left:20px;display:block;" id="receivers_' . $select_boxes->getName() . '">' . $select_boxes->_elementTemplate . '</div>');
parent::accept($renderer);
$js = $this->getElementJS();
return $renderer->toHtml() . $js;
}
示例3: onQuickFormEvent
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' == $event) {
// we need to call setValue(), 'cause the default/constant value
// may be in fact a timestamp, not an array
return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller);
} else {
return parent::onQuickFormEvent($event, $arg, $caller);
}
}
示例4: onQuickFormEvent
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' == $event) {
// we need to call setValue() so that the secondary option
// matches the main option
return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller);
} else {
$ret = parent::onQuickFormEvent($event, $arg, $caller);
// add onreset handler to form to properly reset hierselect (see bug #2970)
if ('addElement' == $event) {
$onReset = $caller->getAttribute('onreset');
if (strlen($onReset)) {
if (strpos($onReset, '_hs_setupOnReset')) {
$caller->updateAttributes(array('onreset' => str_replace('_hs_setupOnReset(this, [', "_hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "', ", $onReset)));
} else {
$caller->updateAttributes(array('onreset' => "var temp = function() { {$onReset} } ; if (!temp()) { return false; } ; if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } "));
}
} else {
$caller->updateAttributes(array('onreset' => "if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } "));
}
}
return $ret;
}
}
示例5: toHtml
function toHtml()
{
include_once 'HTML/QuickForm/Renderer/Default.php';
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate($this->_wrap[0] . '{element}' . $this->_wrap[1]);
// $renderer->setGroupElementTemplate('{element}', $this->getName());
parent::accept($renderer);
return $renderer->toHtml();
}
示例6: onQuickFormEvent
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* If this function is overridden and parent is not called the element must be responsible for
* storing the MoodleQuickForm object, see {@link MoodleQuickForm_group::setMoodleForm()}
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param mixed $caller calling object
*/
public function onQuickFormEvent($event, $arg, &$caller)
{
$this->setMoodleForm($caller);
return parent::onQuickFormEvent($event, $arg, $caller);
}
示例7: getValue
function getValue()
{
$ret = parent::getValue();
return $this->translateRetValues($ret);
}