Esempio n. 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.
  */
 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);
     }
 }
Esempio 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 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);
 }
Esempio n. 3
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.
  *
  * @see     fetch()
  * @since   1.1.0
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $template = $app->getTemplate();
     $uri = JFactory::getURI();
     $uri_string = str_replace('&', '&', $uri->toString());
     $app->setUserState('com_bwpostman.edit.template.id', JFactory::getApplication()->input->getInt('id', 0));
     //check for queue entries
     $this->queueEntries = BwPostmanHelper::checkQueueEntries();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->canDo = BwPostmanHelper::getActions($this->item->id, 'template');
     // Save a reference into view
     $this->request_url = $uri_string;
     $this->template = $template;
     $this->addToolbar();
     // call usermade html template
     if ($this->item->tpl_id == '0') {
         $tpl = 'html';
     }
     // call usermade text template
     if ($this->item->tpl_id == '998') {
         $tpl = 'text';
     }
     // call standard text template
     if ($this->item->tpl_id > '999') {
         $tpl = 'text_std';
     }
     // Call parent display
     parent::display($tpl);
 }
Esempio n. 4
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.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $template = $app->getTemplate();
     $uri = JFactory::getURI();
     $uri_string = str_replace('&', '&', $uri->toString());
     $app->setUserState('com_bwpostman.edit.mailinglist.id', JFactory::getApplication()->input->getInt('id', 0));
     //check for queue entries
     $this->queueEntries = BwPostmanHelper::checkQueueEntries();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->canDo = BwPostmanHelper::getActions($this->item->id, 'mailinglist');
     // Save a reference into view
     $this->request_url = $uri_string;
     $this->template = $template;
     $this->addToolbar();
     // Call parent display
     parent::display($tpl);
 }
Esempio n. 5
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.
  */
 public function display($tpl = null)
 {
     // Initialize variables
     $dispatcher = JEventDispatcher::getInstance();
     $app = JFactory::getApplication();
     //check for queue entries
     $this->queueEntries = BwPostmanHelper::checkQueueEntries();
     // Get input data
     $jinput = $app->input;
     $referrer = $jinput->get->get('referrer', '', 'string');
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->canDo = BwPostmanHelper::getActions($this->item->id, 'newsletter');
     $this->template = $app->getTemplate();
     $this->params = JComponentHelper::getParams('com_bwpostman');
     $dispatcher->trigger('onBwPostmanBeforeNewsletterEdit', array(&$this->item, $referrer));
     // set some needed flags
     // flag, if rendered content exists or not
     if ($this->item->html_version || $this->item->text_version) {
         $this->content_exists = true;
     } else {
         $this->content_exists = false;
     }
     // flag for selected content before editing
     if (is_array($this->item->selected_content)) {
         $this->selected_content_old = implode(',', $this->item->selected_content);
     } elseif (isset($this->item->selected_content)) {
         $this->selected_content_old = $this->item->selected_content;
     } else {
         $this->selected_content_old = '';
     }
     // flags for template ids before editing
     $this->template_id_old = $this->item->template_id_old;
     $this->text_template_id_old = $this->item->text_template_id_old;
     $this->addToolbar();
     // reset temporary state
     $app->setUserState('com_bwpostman.edit.newsletter.changeTab', false);
     // Call parent display
     parent::display($tpl);
 }
Esempio n. 6
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.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $dispatcher = JEventDispatcher::getInstance();
     JPluginHelper::importPlugin('bwpostman', 'bwtimecontrol');
     $app->setUserState('com_bwpostman.edit.campaign.id', JFactory::getApplication()->input->getInt('id', 0));
     //check for queue entries
     $this->queueEntries = BwPostmanHelper::checkQueueEntries();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->canDo = BwPostmanHelper::getActions($this->item->id, 'campaign');
     // Get the assigned newsletters
     $this->newsletters = $this->get('Newsletters');
     // trigger Plugin BwTimeControl event and get results
     $dispatcher->trigger('onBwPostmanCampaignPrepare', array(&$this->item, &$this->newsletters, &$document));
     $this->addToolbar();
     // Call parent display
     parent::display($tpl);
 }
Esempio n. 7
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.
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $jinput = JFactory::getApplication()->input;
     $params = JComponentHelper::getParams('com_bwpostman');
     //check for queue entries
     $this->queueEntries = BwPostmanHelper::checkQueueEntries();
     $layout = $jinput->get('layout', '');
     switch ($layout) {
         case 'export':
             self::_displayExportForm($tpl);
             break;
         case 'import':
         case 'import1':
         case 'import2':
             self::_displayImportForm($tpl);
             break;
         case 'edit':
         default:
             // get templatename
             $this->template = $app->getTemplate();
             // Get the data from the model
             $this->form = $this->get('Form');
             $this->item = $this->get('Item');
             $this->state = $this->get('State');
             $this->canDo = BwPostmanHelper::getActions($this->item->id, 'subscriber');
             if ($this->item->id) {
                 $app->setUserState('com_bwpostman.subscriber.new_test', $this->item->status);
                 $app->setUserState('com_bwpostman.subscriber.subscriber_id', $this->item->id);
             }
             // Get show fields
             if (!$params->get('show_name_field')) {
                 $this->form->setFieldAttribute('name', 'type', 'hidden');
             }
             if (!$params->get('show_firstname_field')) {
                 $this->form->setFieldAttribute('firstname', 'type', 'hidden');
             }
             if (!$params->get('show_gender')) {
                 $this->form->setFieldAttribute('gender', 'type', 'hidden');
             }
             if (!$params->get('show_special')) {
                 $this->form->setFieldAttribute('special', 'type', 'hidden');
             }
             if (!$params->get('show_emailformat')) {
                 $this->form->setFieldAttribute('emailformat', 'type', 'hidden');
             } else {
                 $this->form->setFieldAttribute('default_emailformat', 'default', $params->get('default_emailformat'));
             }
             // Set required fields
             $this->obligation['name'] = $params->get('name_field_obligation');
             $this->obligation['firstname'] = $params->get('firstname_field_obligation');
             $this->obligation['special'] = $params->get('special_field_obligation');
             $this->obligation['special_label'] = JText::_($params->get('special_label'));
             if ($params->get('name_field_obligation')) {
                 $this->form->setFieldAttribute('name', 'required', 'true');
             }
             if ($params->get('firstname_field_obligation')) {
                 $this->form->setFieldAttribute('firstname', 'required', 'true');
             }
             if ($params->get('special_field_obligation')) {
                 $this->form->setFieldAttribute('special', 'required', true);
             }
             // Set label and description/tooltip for additional field
             if ($params->get('special_desc') != '') {
                 $this->form->setFieldAttribute('special', 'description', $params->get('special_desc'));
             }
             if ($params->get('special_label') != '') {
                 $this->form->setFieldAttribute('special', 'label', $params->get('special_label'));
             }
             $this->addToolbar();
     }
     parent::display($tpl);
 }
Esempio n. 8
0
 /**
  * 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);
     }
 }