/** * 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. */ public function display($tpl = null) { $app = JFactory::getApplication(); if (!BwPostmanHelper::canView('campaigns')) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_VIEW_NOT_ALLOWED', JText::_('COM_BWPOSTMAN_CAMS')), 'error'); $app->redirect('index.php?option=com_bwpostman'); } else { $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('bwpostman', 'bwtimecontrol'); // Get data from the model $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $this->pagination = $this->get('Pagination'); $this->total = $this->get('total'); $this->auto_nbr = 0; // trigger Plugin BwTimeControl event and get results $this->auto_nbr = $dispatcher->trigger('onBwPostmanCampaignsPrepare', array(&$this->items)); $this->addToolbar(); BwPostmanHelper::addSubmenu('campaigns'); $this->sidebar = JHtmlSidebar::render(); // Call parent display 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 a JError object. */ public function display($tpl = null) { $uri = JFactory::getURI(); $uri_string = $uri->toString(); $canDo = BwPostmanHelper::getActions(); //check for queue entries $this->queueEntries = BwPostmanHelper::checkQueueEntries(); // Get data from the model $this->archive = $this->get('Archivedata'); $this->general = $this->get('Generaldata'); $this->canDo = $canDo; $this->request_url = $uri_string; // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN'), 'envelope'); // Set toolbar items for the page if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_bwpostman', '500', '900'); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); } JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); BwPostmanHelper::addSubmenu('bwpostman'); $this->sidebar = JHtmlSidebar::render(); 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 a JError object. */ public function display($tpl = null) { $app = JFactory::getApplication(); if (!BwPostmanHelper::canView('mailinglists')) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_VIEW_NOT_ALLOWED', JText::_('COM_BWPOSTMAN_MLS')), 'error'); $app->redirect('index.php?option=com_bwpostman'); } else { // Get data from the model $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $this->pagination = $this->get('Pagination'); $this->total = $this->get('total'); $this->addToolbar(); BwPostmanHelper::addSubmenu('mailinglists'); $this->sidebar = JHtmlSidebar::render(); // Call parent display parent::display($tpl); } }
/** * Display * * @access public * * @param string $tpl Template * * @return void */ public function display($tpl = null) { $app = JFactory::getApplication(); if (!BwPostmanHelper::canView('archive')) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_VIEW_NOT_ALLOWED', JText::_('COM_BWPOSTMAN_ARC')), 'error'); $app->redirect('index.php?option=com_bwpostman'); } else { $uri = JFactory::getURI(); $uri_string = str_replace('&', '&', $uri->toString()); // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $this->state = $this->get('State'); $this->request_url = $uri_string; $this->addToolbar(); BwPostmanHelper::addSubmenu('archive'); $this->sidebar = JHtmlSidebar::render(); // Call parent display 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 a JError object. */ public function display($tpl = null) { $app = JFactory::getApplication(); if (!BwPostmanHelper::canView('newsletters')) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_VIEW_NOT_ALLOWED', JText::_('COM_BWPOSTMAN_NLS')), 'error'); $app->redirect('index.php?option=com_bwpostman'); } else { $jinput = JFactory::getApplication()->input; $uri = JFactory::getURI(); //check for queue entries $this->queueEntries = BwPostmanHelper::checkQueueEntries(); $app->setUserState('com_bwpostman.edit.newsletter.referrer', 'newsletters'); // The query always contains the tab which we are in, but this might be confusing // That's why we will set the query only to controller = newsletters $uri_query = 'option=com_bwpostman&view=newsletters'; $uri->setQuery($uri_query); // Get data from the model $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // $this->queue = $this->get('Queue'); $this->pagination = $this->get('Pagination'); $this->total = $this->get('total'); $this->count_queue = $this->get('CountQueue'); $this->context = 'com_bwpostman.newsletters'; $this->addToolbar(); BwPostmanHelper::addSubmenu('newsletters'); $this->sidebar = JHtmlSidebar::render(); // Show the layout depending on the tab $tpl = $jinput->get('tab', 'unsent'); // Call parent display parent::display($tpl); } }
/** * Execute and display a template script. * * @access public * @param string Template */ public function display($tpl = null) { $app = JFactory::getApplication(); JHtml::_('bootstrap.framework'); JHtml::_('jquery.framework'); if (!BwPostmanHelper::canView('maintenance')) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_VIEW_NOT_ALLOWED', JText::_('COM_BWPOSTMAN_MAINTENANCE')), 'error'); $app->redirect('index.php?option=com_bwpostman'); } else { $jinput = JFactory::getApplication()->input; $model = $this->getModel(); $layout = $jinput->getCmd('layout', ''); //check for queue entries $this->queueEntries = BwPostmanHelper::checkQueueEntries(); $this->template = $app->getTemplate(); $dest = $app->getUserState('com_bwpostman.maintenance.dest', ''); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MAINTENANCE'), 'wrench'); $canDo = BwPostmanHelper::getActions(); // Set toolbar items for the page if ($layout == 'restoreTables') { $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); $document->setTitle(JText::_('COM_BWPOSTMAN_MAINTENANCE_RESTORE')); $backlink = 'index.php?option=com_bwpostman&view=maintenance'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MAINTENANCE_RESTORE'), 'download'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($layout == 'doRestore') { $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); $document->setTitle(JText::_('COM_BWPOSTMAN_MAINTENANCE_RESTORE_DO_RESTORE')); $backlink = 'index.php?option=com_bwpostman&view=maintenance'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MAINTENANCE_RESTORE_DO_RESTORE'), 'download'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($layout == 'checkTables') { JFactory::getApplication()->input->set('hidemainmenu', true); $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); $document->setTitle(JText::_('COM_BWPOSTMAN_MAINTENANCE_CHECKTABLES')); $backlink = 'index.php?option=com_bwpostman&view=maintenance'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MAINTENANCE_CHECKTABLES'), 'download'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($layout == 'updateCheckSave') { $alt = "COM_BWPOSTMAN_INSTALL_GO_BWPOSTMAN"; $bar = JToolBar::getInstance('toolbar'); $document->setTitle(JText::_('COM_BWPOSTMAN_MAINTENANCE_UPDATECHECKSAVE')); $backlink = 'javascript:window.close()'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MAINTENANCE_UPDATECHECKSAVE'), 'download'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); $style = '.layout-updateCheckSave .navbar {display:none;}' . '.layout-updateCheckSave .subhead-fixed {position: relative;top: 0;}' . 'body {padding-top:0;}'; $document->addStyleDeclaration($style); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/install.css'); } if ($canDo->get('core.manage')) { JToolBarHelper::preferences('com_bwpostman', '500', '900'); } JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); BwPostmanHelper::addSubmenu('maintenance'); switch ($layout) { case 'updateCheckSave': break; case 'checkTables': break; case 'saveTables': $this->check_res = $model->saveTables(false); break; case 'restoreTables': break; case 'doRestore': /* echo '<div class="well">'; $this->check_res = $model->restoreTables($dest); echo '</div>'; */ break; default: } if (empty($layout)) { $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); } }