/** * Display method * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); // Set the toolbar JToolbarHelper::title(JText::_('JSN_EASYSLIDER_CONFIGURATION_SETTING')); // Add toolbar menu JSNEasySliderHelper::addToolbarMenu(); // Set the submenu JSNEasySliderHelper::addSubmenu('maintenance'); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('CONFIGURATION'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Assign variables for rendering $this->msgs = $msgs; if (!empty($_GET['g']) && $_GET['g'] == 'data') { echo JSNHtmlAsset::loadScript('jsn/data', array('language' => array('JSN_EXTFW_GENERAL_CLOSE' => JText::_('JSN_EXTFW_GENERAL_CLOSE'))), true); } // Add assets JSNEasySliderHelper::addAssets(); $this->_addAssets(); // Display the template parent::display($tpl); }
/** * Method for display page. * * @param boolean $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Exception object. */ function display($tpl = null) { // Set the toolbar JToolBarHelper::title(JText::_('JSN_EASYSLIDER_UPDATE_PRODUCT')); // Add assets JSNEasySliderHelper::addAssets(); // Display the template parent::display($tpl); }
/** * 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 an Exception object. */ function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); $session = JFactory::getSession(); $objJSNEasySliderSliders = new JSNEasySliderSliders(); $totalSliders = $objJSNEasySliderSliders->countSilderItems(); $layout = $this->getLayout(); $this->totalSliders = $totalSliders; /*Check if it is FREE edition then show warning message to alert that FREE edition only allows create maximum of 3 sliders*/ $this->edition = defined('JSN_EASYSLIDER_EDITION') ? JSN_EASYSLIDER_EDITION : "free"; if (strtolower($this->edition) == 'free') { if ($totalSliders !== false && $totalSliders >= 3) { if ($layout == 'default') { JFactory::getApplication()->enqueueMessage(JText::_('JSN_EASYSLIDER_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_SLIDERS_IN_FREE_EDITION'), 'warning'); } } } if ($session->has('JSN_EASYSLIDER_BACKUP_OLD_DATA_PATH') && (string) $session->get('JSN_EASYSLIDER_BACKUP_OLD_DATA_PATH') != '') { JFactory::getApplication()->enqueueMessage('The data backup file of version 1.x.x has been created from the update process. You can download it <a href="' . JUri::root() . str_replace(JPATH_ROOT . '/', '', (string) $session->get('JSN_EASYSLIDER_BACKUP_OLD_DATA_PATH')) . '"><strong>here<strong></a>', 'notice'); } // Set the toolbar JToolbarHelper::title(JText::_('JSN_EASYSLIDER_SLIDERS')); // Add toolbar menu JToolbarHelper::addNew('slider.add', 'JSN_EASYSLIDER_CREATE_NEW'); JToolbarHelper::editList('slider.edit', 'JTOOLBAR_EDIT'); JToolbarHelper::custom('sliders.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); JToolbarHelper::divider(); JToolbarHelper::publish('sliders.publish'); JToolbarHelper::unpublish('sliders.unpublish'); JToolbarHelper::divider(); JToolbarHelper::deleteList('JSN_EASYSLIDER_CONFIRM_DELETE', 'sliders.delete', 'JTOOLBAR_DELETE'); // JToolbarHelper::preferences(); // JToolbarHelper::help(); JToolbarHelper::custom('', ' jsnes-import fa fa-download', ' jsnes-import fa fa-download', 'JSN_EASYSLIDER_IMPORT'); JToolbarHelper::custom('', ' jsnes-export fa fa-upload', ' jsnes-export fa fa-upload', 'JSN_EASYSLIDER_EXPORT'); JToolbarHelper::divider(); JSNEasySliderHelper::addToolbarMenu(); // Set the submenu // JSNEasySliderHelper::addSubmenu('sliders'); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('SLIDERS'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } $this->sliders = $objJSNEasySliderSliders->getSlidersWithoutState(); // Assign variables for rendering $this->msgs = $msgs; $this->objJSNEasySliderSliders = $objJSNEasySliderSliders; // Add assets JSNEasySliderHelper::addAssets(); $this->_addAssets(); // Display the template parent::display($tpl); }
/** * Method for display page. * * @param boolean $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Exception object. */ function display($tpl = null) { try { $this->state = $this->get('State'); $this->slider = $this->get('Item'); $this->form = $this->get('Form'); } catch (Exception $e) { throw $e; } $config = JSNConfigHelper::get(); // Get input object $input = JFactory::getApplication()->input; if (empty($this->slider->slider_id)) { $objJSNEasySliderSliders = new JSNEasySliderSliders(); $totalSliders = $objJSNEasySliderSliders->countSilderItems(); /*Check if it is FREE edition then show warning message to alert that FREE edition only allows create maximum of 3 sliders*/ $edition = defined('JSN_EASYSLIDER_EDITION') ? JSN_EASYSLIDER_EDITION : "free"; if (strtolower($edition) == 'free') { if ($totalSliders !== false && $totalSliders >= 3) { JFactory::getApplication()->redirect('index.php?option=com_easyslider&view=sliders'); return false; } } } // Setup toolbar $input->set('hidemainmenu', true); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('SLIDER'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Assign variables for rendering $this->assignRef('msgs', $msgs); // Set the toolbar JToolBarHelper::title(JText::_('JSN_EASYSLIDER_EDIT_PRODUCT')); // Add assets JSNEasySliderHelper::addAssets(); $this->objUtils = new JSNEasySliderUtils(); // Display the template parent::display($tpl); }
/** * Display method * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); // Set the toolbar JToolbarHelper::title(JText::_('JSN_EASYSLIDER_ABOUT_TITLE')); // Add toolbar menu JSNEasySliderHelper::addToolbarMenu(); // Set the submenu JSNEasySliderHelper::addSubmenu('about'); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('ABOUT'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Assign variables for rendering $this->assignRef('msgs', $msgs); // Add assets JSNEasySliderHelper::addAssets(); // Display the template parent::display($tpl); }