defined('_JEXEC') or die; /* @var $this JoomDOCViewLicense */ JHtml::_('behavior.formvalidation'); JHtml::_('behavior.keepalive'); jimport('joomla.html.pane'); $document = JFactory::getDocument(); /* @var $document JDocumentHTML */ $js[] = 'Joomla.submitbutton = function (task) {'; $js[] = ' var form = document.getElementById(\'item-form\');'; $js[] = ' if (task == \'' . JoomDOCHelper::getTask(JOOMDOC_LICENSE, JOOMDOC_TASK_CANCEL) . '\' || document.formvalidator.isValid(form))'; $js[] = ' Joomla.submitform(task, form);'; $js[] = ' else alert(\'' . JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true) . '\');'; $js[] = '}'; $js[] = 'function submitform(pressbutton){Joomla.submitbutton(pressbutton);}'; $document->addScriptDeclaration(PHP_EOL . implode(PHP_EOL, $js) . PHP_EOL); echo '<form action="' . JRoute::_(JoomDOCRoute::saveLicense($this->license->id)) . '" method="post" name="adminForm" id="item-form" class="form-validate">'; echo '<div class="fltlft col"><fieldset class="adminform"><legend>' . JText::_('JOOMDOC_DOCUMENT') . '</legend><table class="admintable">'; echo '<tr><td class="key">' . $this->form->getLabel('title') . '</td><td>' . $this->form->getInput('title') . '</td></tr>'; echo '<tr><td class="key">' . $this->form->getLabel('alias') . '</td><td>' . $this->form->getInput('alias') . '</td></tr>'; echo '<tr><td class="key">' . $this->form->getLabel('default') . '</td><td>' . $this->form->getInput('default') . '</td></tr>'; echo '<tr><td class="key">' . $this->form->getLabel('state') . '</td><td>' . $this->form->getInput('state') . '</td></tr>'; echo '</table><div class="clr"></div>'; echo $this->form->getLabel('text') . '<div class="clr"></div>'; echo JoomDOCAccess::licenses() ? $this->form->getInput('text') : $this->form->getValue('text'); echo '<div class="clr"></div></fieldset></div>'; if ($this->license->id) { echo '<div class="fltlft col">'; require_once JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/html/joomdoc.php'; echo JHtmlJoomDOC::startSliders('license', 'publishing'); echo JHtmlJoomDOC::addSlide('license', 'JOOMDOC_PUBLISHING', 'publishing'); echo '<fieldset class="panelform"><table class="admintable">';