receivers = $attributes['receivers']; $this->receivers_selected = $attributes['receivers_selected']; unset($attributes['receivers']); unset($attributes['receivers_selected']); $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes); $this->_persistantFreeze = true; $this->_appendName = true; $this->_type = 'receivers'; } /** * Create the form elements to build this element group */ function _createElements() { $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')')); $this->_elements[0]->setChecked(true); $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')')); $this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers); $this->_elements[2]->setSelected($this->receivers_selected); } /** * HTML representation */ function toHtml() { include_once ('HTML/QuickForm/Renderer/Default.php'); $this->_separator = '
'; $renderer = & new HTML_QuickForm_Renderer_Default(); $renderer->setElementTemplate('{element}'); $select_boxes = $this->_elements[2]; $select_boxes->setElementTemplate('
'.$select_boxes->_elementTemplate.'
'); parent :: accept($renderer); $js = $this->getElementJS(); return $renderer->toHtml().$js; } /** * Get the necessary javascript */ function getElementJS() { $js = "\n"; return $js; } /** * accept renderer */ function accept(& $renderer, $required = false, $error = null) { $renderer->renderElement($this, $required, $error); } } ?>