Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }