Exemple #1
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 a JError object.
  */
 function display($tpl = null)
 {
     // Get config parameters
     $this->_document = JFactory::getDocument();
     $this->_config = JSNConfigHelper::get();
     // Initialize toolbar
     JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PAGE_CONFIGURATION_TITLE', 'mobilize-config', false);
     // Get messages
     $msgs = '';
     if (!$this->_config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('CONFIGURATION');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Load the submenu.
     $input = JFactory::getApplication()->input;
     JSNMobilizeHelper::addSubmenu($input->get('view', 'configuration'));
     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);
     }
     // Load assets
     JSNMobilizeHelper::loadAssets();
     // Display the template
     parent::display($tpl);
 }
Exemple #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 a JError object.
  */
 function display($tpl = null)
 {
     // Get config parameters
     $config = JSNConfigHelper::get();
     // Initialize toolbar
     JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PAGE_ABOUT_TITLE', 'mobilize-about', false);
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('ABOUT');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Load the submenu.
     $input = JFactory::getApplication()->input;
     JSNMobilizeHelper::addSubmenu($input->get('view', 'about'));
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the template
     parent::display($tpl);
     // Load assets
     JSNMobilizeHelper::loadAssets();
 }
Exemple #3
0
 /**
  * Setup toolbar.
  *
  * @return void
  */
 protected function initToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::apply('profile.apply');
     JToolBarHelper::save('profile.save');
     JToolBarHelper::cancel('profile.cancel', 'JSN_MOBILIZE_CLOSE');
     !JSNVersion::isJoomlaCompatible('2.5') or JToolBarHelper::divider();
     JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PROFILE_PAGETITLE', 'mobilize-profiles', false);
 }
Exemple #4
0
 /**
  * Add the page title and toolbar.
  *
  * @return void
  *
  * @since        1.6
  */
 protected function initToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     $edition = defined('JSN_MOBILIZE_EDITION') ? JSN_MOBILIZE_EDITION : "free";
     if (strtolower($edition) == "free") {
         $dataListForm = JSNMobilizeHelper::getProfiles();
         $countForm = 1 - count($dataListForm) > 0 ? 1 - count($dataListForm) : 0;
         $msg = JText::sprintf('JSN_MOBILIZE_YOU_HAVE_REACHED_THE_LIMITATION_OF_1_PROFILE_IN_FREE_EDITION', (int) $countForm) . ' <a class="jsn-link-action" href="index.php?option=com_mobilize&view=upgrade">' . JText::_("JSN_MOBILIZE_UPGRADE_EDITION") . '</a>';
         if (count($dataListForm) < 1) {
             JToolBarHelper::addNew('profile.add', 'JTOOLBAR_NEW');
             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>');
             $session = JFactory::getSession();
             $seesionQueue = $session->get('application.queue');
             if ($seesionQueue[0]['type'] != "error") {
                 JError::raiseNotice(100, $msg);
             }
         }
     } else {
         JToolBarHelper::addNew('profile.add', 'JTOOLBAR_NEW');
     }
     JToolBarHelper::editList('profile.edit', 'JTOOLBAR_EDIT');
     !JSNVersion::isJoomlaCompatible('2.5') or JToolBarHelper::divider();
     JToolBarHelper::publish('profiles.publish', 'JSN_MOBILIZE_PUBLISH', true);
     JToolBarHelper::unpublish('profiles.unpublish', 'JSN_MOBILIZE_UNPUBLISH', true);
     !JSNVersion::isJoomlaCompatible('2.5') or JToolBarHelper::divider();
     JToolBarHelper::deleteList('JSN_MOBILIZE_CONFIRM_DELETE', 'profiles.delete', 'JTOOLBAR_DELETE');
     !JSNVersion::isJoomlaCompatible('2.5') or JToolBarHelper::divider();
     JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PROFILES_MANAGER', 'mobilize-profiles');
 }