protected function getInput() { $this->element['onchange'] = 'ajax_reloadTypes(\'' . $this->formControl . $this->group . $this->element['type_elem_name'] . '\', this.value);'; $html = parent::getInput(); $doc = JFactory::getDocument(); $uri = JFactory::getURI(); $doc->addScriptDeclaration("\n\t\t\tfunction ajax_reloadTypes(id, value)\n\t\t\t{\n\t\t\t\tvar sel = \$(id);\n\t\t\t\tnew Request.HTML({\n\t\t\t\t\turl:'" . JURI::root() . "administrator/index.php?option=com_cobalt&task=ajax.loadsectiontypes&no_html=1',\n\t\t\t\t\tmethod:'post',\n\t\t\t\t\tautoCancel:true,\n\t\t\t\t\tdata:{section_id: value, selected: selected_types},\n\t\t\t\t\tupdate: \$(id),\n\t\t }).send();\n\t\t\t}\n\t\t\t\t\n\t\t\twindow.addEvent('domready', function(){\n\t\t\t\tajax_reloadTypes('" . $this->formControl . $this->group . $this->element['type_elem_name'] . "', '" . $this->value . "');\n\t\t\t});\n\t\t"); return $html; }
protected function getInput() { $html = parent::getInput(); if ($this->element['prepend']) { $html = $this->element['prepend'] . "<br>{$html}"; } if ($this->element['append']) { $html .= '<br><br>' . $this->element['append']; } return $html; }