/** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $name = $this->name; $app = JFactory::getApplication(); if (!$this->value) { $this->value = $app->getUserState('com_uniform.add.form_id'); } return JSNUniformHelper::getSelectForm($name, $this->id, "menuform", $this->value, true); }
/** * view select form * * @return html code */ public function viewSelectForm() { $user = JFactory::getUser(); $userId = $user->get('id'); $isCreate = (bool) $user->authorise('core.create'); $isEdit = (bool) $user->authorise('core.edit'); if (!$userId || !$isCreate && !$isEdit) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); } $uri = JUri::root(true); $document = JFactory::getDocument(); $document->addScript($uri . '/media/system/js/mootools-core.js'); $document->addScript($uri . '/media/system/js/core.js'); $document->addScript($uri . '/media/system/js/mootools-more.js'); JHtml::_('jquery.framework'); $jsCode = '(function($){ $(document).ready(function () { var form = $("select.jform_request_form_id"); form.change(function () { if (form.val() == 0) { $(this).css("background", "#CC0000").css("color", "#fff") $("#select-forms").attr("disabled", "disabled"); } else { $("#select-forms").removeAttr("disabled"); form.css("background", "#FFFFDD").css("color", "#000") } }).trigger("change"); $("#select-forms").click(function () { if (window.parent) { window.parent.jsnSelectForm($("select.jform_request_form_id").val()); } }); }); })(jQuery)'; $document->addScriptDeclaration($jsCode); echo JSNUniformHelper::getSelectForm('jform[params][form_id]', 'jform_params_form_id', "contentfrontend"); }
/** * view select form * * @return html code */ public function viewSelectForm() { $document = JFactory::getDocument(); $document->addScript('../media/system/js/mootools-core.js'); $document->addScript('../media/system/js/core.js'); $document->addScript('../media/system/js/mootools-more.js'); //$document->addStyleSheet(JSN_URL_ASSETS . '/3rd-party/bootstrap/css/bootstrap.min.css'); echo JSNUniformHelper::getSelectForm('jform[params][form_id]', 'jform_params_form_id', "content"); }