/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); // Initialize toolbar JSNUniformHelper::initToolbar('JSN_UNIFORM_ABOUT', 'uniform-about', false); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('ABOUT'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Load assets JSNUniformHelper::addAssets(); // Assign variables for rendering $this->assignRef('msgs', $msgs); // Load the submenu. $input = JFactory::getApplication()->input; JSNUniformHelper::addSubmenu($input->get('view', 'about')); // Display the template parent::display($tpl); }
/** * Setup toolbar. * * @return void */ protected function initToolbar() { JToolBarHelper::apply('form.apply'); JToolBarHelper::save('form.save'); // Create a toolbar button that drop-down a sub-menu when clicked JSNMenuHelper::addEntry('toolbar-save', 'JSN_UNIFORM_SAVE_AND_SHOW', '', false, 'jsn-icon16 jsn-icon-file', 'toolbar'); // Declare 1st-level menu items JSNMenuHelper::addEntry('component', 'JSN_UNIFORM_FORM_VIA_MENU_ITEM_COMPONENT', '', false, '', 'toolbar-save'); JSNMenuHelper::addEntry('module', 'JSN_UNIFORM_FORM_IN_MODULE_POSITION_MODULE', 'index.php?option=com_uniform&task=launchAdapter&type=module', false, '', 'toolbar-save', 'action-save-show'); JSNMenuHelper::addEntry('article-content-plugin', 'JSN_UNIFORM_FORM_INSIDE_ARTICLE_CONTENT_PLUGIN', '', false, '', 'toolbar-save'); if (count($optionMenus = JSNUniformHelper::getOptionMenus())) { foreach ($optionMenus as $option) { JSNMenuHelper::addEntry(preg_replace('/[^a-z0-9\\-_]/', '-', $option->text), $option->text, 'index.php?option=com_uniform&task=launchAdapter&type=menu&menutype=' . $option->value, false, '', 'toolbar-save.component', 'action-save-show'); } } JToolBarHelper::cancel('form.cancel', 'JSN_UNIFORM_CLOSE'); JSNUniformHelper::initToolbar('JSN_UNIFORM_FORM_PAGETITLE', 'uniform-forms', false); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function initToolbar() { $bar = JToolBar::getInstance('toolbar'); if (!empty($this->_formId)) { $bar->appendButton('Custom', '<ul class="jsn-menu clearafter"> <li class="menu-name"><a href="#" onclick="return false;"><span class="icon-32-save icon-menu"></span>' . JText::_('JSN_UNIFORM_EXPORT') . '</a> <ul class="jsn-submenu"> <li class="parent primary first"><a target="_blank" href="' . JRoute::_('index.php?option=com_uniform&view=submissions&task=submissions.export_excel&form_id=' . $this->_formId) . '"><span class="jsn-icon24 jsn-icon-joomla jsn-icon-component"></span>' . JText::_('JSN_UNIFORM_EXPORT_TO_EXCEL') . '</a></li> <li class="parent primary"><a target="_blank" href="' . JRoute::_('index.php?option=com_uniform&view=submissions&task=submissions.export_cvs&form_id=' . $this->_formId) . '"><span class="jsn-icon24 jsn-icon-joomla jsn-icon-module"></span>' . JText::_('JSN_UNIFORM_EXPORT_TO_CVS') . '</a></li> </ul> </li> </ul>'); JToolBarHelper::deleteList('JSN_UNIFROM_CONFIRM_DELETE', 'submissions.delete', 'JTOOLBAR_DELETE'); JSNUniformHelper::initToolbar('JSN_UNIFORM_SUBMISSIONS_MANAGER', 'uniform-submission'); } }
/** * Add the page title and toolbar. * * @return void */ protected function initToolbar() { $bar = JToolBar::getInstance('toolbar'); if (!empty($this->_formId)) { if (!empty($this->_items)) { // Create a toolbar button that drop-down a sub-menu when clicked JSNMenuHelper::addEntry('toolbar-export', 'JSN_UNIFORM_EXPORT', '', false, 'jsn-icon16 jsn-icon-download', 'toolbar'); // Declare 1st-level menu items JSNMenuHelper::addEntry('excel', 'JSN_UNIFORM_EXPORT_TO_EXCEL', 'index.php?option=com_uniform&view=submissions&layout=export&format=raw&e=excel', false, 'administrator/components/com_uniform/assets/images/icons-24/xls_file.png', 'toolbar-export', 'jsn-export'); JSNMenuHelper::addEntry('csv', 'JSN_UNIFORM_EXPORT_TO_CSV', 'index.php?option=com_uniform&view=submissions&layout=export&format=raw&e=csv', false, 'administrator/components/com_uniform/assets/images/icons-24/csv_file.png', 'toolbar-export', 'jsn-export'); } else { // Create a toolbar button that drop-down a sub-menu when clicked JSNMenuHelper::addEntry('toolbar-export', 'JSN_UNIFORM_EXPORT', '', false, 'jsn-icon16 jsn-icon-download', 'toolbar'); // Declare 1st-level menu items JSNMenuHelper::addEntry('excel', 'JSN_UNIFORM_EXPORT_TO_EXCEL', '', false, 'administrator/components/com_uniform/assets/images/icons-24/xls_file.png', 'toolbar-export', 'jsn-no-export'); JSNMenuHelper::addEntry('csv', 'JSN_UNIFORM_EXPORT_TO_CSV', '', false, 'administrator/components/com_uniform/assets/images/icons-24/csv_file.png', 'toolbar-export', 'jsn-no-export'); } JToolBarHelper::deleteList('JSN_UNIFROM_CONFIRM_DELETE', 'submissions.delete', 'JTOOLBAR_DELETE'); } JSNUniformHelper::initToolbar('JSN_UNIFORM_SUBMISSIONS_MANAGER', 'uniform-submission'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function initToolbar() { $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Custom', '<button id="previous-submission" class="btn btn-small hide" ><i class="icon-arrow-left"></i>' . JText::_('JSN_UNIFORM_PREVIOUS') . '</button>'); $bar->appendButton('Custom', '<button id="next-submission" class="btn btn-small hide" >' . JText::_('JSN_UNIFORM_NEXT') . '<i class="icon-arrow-right"></i></button>'); JToolBarHelper::apply('submission.apply'); JToolBarHelper::save('submission.save'); JToolBarHelper::cancel('submission.cancel', 'JTOOLBAR_CLOSE'); JSNUniformHelper::initToolbar('JSN_UNIFORM_SUBMISSIONS_DETAIL', 'uniform-submission'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function initToolbar() { $bar = JToolBar::getInstance('toolbar'); $edition = defined('JSN_UNIFORM_EDITION') ? JSN_UNIFORM_EDITION : "free"; if (strtolower($edition) == "free") { $dataListForm = JSNUniformHelper::getForms(); $countForm = 3 - count($dataListForm) > 0 ? 3 - count($dataListForm) : 0; $msg = JText::sprintf('JSN_UNIFORM_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_FORM_IN_FREE_EDITION', (int) $countForm) . ' <a class="jsn-link-action" href="index.php?option=com_uniform&view=upgrade">' . JText::_("JSN_UNIFORM_UPGRADE_EDITION") . '</a>'; if (count($dataListForm) < 3) { JToolBarHelper::addNew('form.add', 'JTOOLBAR_NEW'); JToolBarHelper::editList('form.edit', 'JTOOLBAR_EDIT'); JToolBarHelper::custom('forms.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); JFactory::getApplication()->enqueueMessage($msg); } else { $bar->appendButton('Custom', '<button class="btn btn-small btn-success disabled jsn-popup-upgrade" onclick="return false;"><i class="icon-new icon-white"></i>' . JText::_('JTOOLBAR_NEW') . '</button>'); JToolBarHelper::editList('form.edit', 'JTOOLBAR_EDIT'); $bar->appendButton('Custom', '<button class="btn btn-small disabled jsn-popup-upgrade" onclick="return false;"><i class="icon-copy "></i>' . JText::_('JTOOLBAR_DUPLICATE') . '</button>'); $session = JFactory::getSession(); $seesionQueue = $session->get('application.queue'); if ($seesionQueue[0]['type'] != "error") { JError::raiseNotice(100, $msg); } } } else { JSNUniformHelper::buttonAddNewForm(); JToolBarHelper::editList('form.edit', 'JTOOLBAR_EDIT'); JToolBarHelper::custom('forms.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } JToolBarHelper::publish('forms.publish', 'JSN_UNIFORM_PUBLISH', true); JToolBarHelper::unpublish('forms.unpublish', 'JSN_UNIFORM_UNPUBLISH', true); JToolBarHelper::deleteList('JSN_UNIFROM_CONFIRM_DELETE', 'forms.delete', 'JTOOLBAR_DELETE'); JSNUniformHelper::initToolbar('JSN_UNIFORM_FORMS_MANAGER', 'uniform-forms'); }