/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $canDo = BwPostmanHelper::getActions(0, 'mailinglists'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_MLS')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_MLS'), 'list'); // Set toolbar items for the page if ($canDo->get('core.create')) { JToolBarHelper::addNew('mailinglist.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('mailinglist.edit'); } JToolBarHelper::divider(); if ($canDo->get('core.edit.state')) { JToolBarHelper::publishList('mailinglists.publish'); JToolBarHelper::unpublishList('mailinglists.unpublish'); JToolBarHelper::divider(); } if ($canDo->get('core.archive')) { JToolBarHelper::archiveList('mailinglist.archive'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.manage')) { JToolBarHelper::checkin('mailinglists.checkin'); JToolBarHelper::divider(); } JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * 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(); $layout = $this->getLayout(); $document = JFactory::getDocument(); $params = $app->getPageParameters(); $templateName = $app->getTemplate(); $css_filename = '/templates/' . $templateName . '/css/com_bwpostman.css'; $this->captcha = BwPostmanHelper::getCaptcha(1); $document->setTitle($params->get('page_title')); $document->addStyleSheet(JURI::root(true) . '/components/com_bwpostman/assets/css/bwpostman.css'); if (file_exists(JPATH_BASE . $css_filename)) { $document->addStyleSheet(JURI::root(true) . $css_filename); } switch ($layout) { case "error_accountblocked": case "error_accountgeneral": case "error_accountnotactivated": case "error_email": case "error_geteditlink": $this->_displayError($tpl); return; break; case "success_msg": $this->_displaySuccess($tpl); return; break; default: $this->_displayDefault($tpl); return; break; } 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); }
/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $canDo = BwPostmanHelper::getActions(0, 'campaign'); $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('bwpostman'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_CAMS')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_CAMS'), 'list'); // Set toolbar items for the page if ($canDo->get('core.create')) { JToolBarHelper::addNew('campaign.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('campaign.edit'); } JToolBarHelper::divider(); JToolBarHelper::spacer(); // Special archive button because we need a confirm dialog with 3 options if ($canDo->get('core.archive')) { $bar = JToolBar::getInstance('toolbar'); $alt = "COM_BWPOSTMAN_ARC"; $bar->appendButton('Popup', 'archive', $alt, 'index.php?option=com_bwpostman&controller=campaigns&tmpl=component&view=campaigns&layout=default_confirmarchive', 500, 110); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.manage')) { JToolBarHelper::checkin('campaigns.checkin'); JToolBarHelper::divider(); } // trigger BwTimeControl event $dispatcher->trigger('onBwPostmanCampaignsPrepareToolbar', array($canDo)); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $tab = $this->state->get('tab', 'unsent'); $canDo = BwPostmanHelper::getActions(0, 'newsletters'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_NLS')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_NLS'), 'envelope'); // Set toolbar items for the page switch ($tab) { // The layout-variable tells us which tab we are in case "sent": if ($canDo->get('core.edit.state')) { JToolBarHelper::publishList('newsletters.publish'); JToolBarHelper::unpublishList('newsletters.unpublish'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.create')) { JToolBarHelper::custom('newsletter.copy', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.admin')) { JToolBarHelper::checkin('newsletters.checkin'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.archive')) { JToolBarHelper::archiveList('newsletter.archive'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } break; case "queue": $bar = JToolBar::getInstance('toolbar'); $alt = "COM_BWPOSTMAN_NL_CONTINUE_SENDING"; if ($canDo->get('core.send')) { JToolBarHelper::custom('newsletters.resetSendAttempts', 'unpublish.png', 'unpublish_f2.png', 'COM_BWPOSTMAN_NL_RESET_TRIAL', false); $bar->appendButton('Popup', 'envelope', $alt, 'index.php?option=com_bwpostman&view=newsletter&layout=queue_modal&format=raw&task=continue_sending', 600, 600); JToolBarHelper::custom('newsletters.clear_queue', 'delete.png', 'delete_f2.png', 'COM_BWPOSTMAN_NL_CLEAR_QUEUE', false); } break; case "unsent": default: if ($canDo->get('core.create')) { JToolBarHelper::addNew('newsletter.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('newsletter.edit'); } if ($canDo->get('core.create')) { JToolBarHelper::custom('newsletter.copy', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } JToolBarHelper::divider(); JToolBarHelper::spacer(); if ($canDo->get('core.send')) { JToolBarHelper::custom('newsletter.sendOut', 'envelope', 'send_f2.png', 'COM_BWPOSTMAN_NL_SEND', true); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.archive')) { JToolBarHelper::archiveList('newsletter.archive'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.manage')) { JToolBarHelper::checkin('newsletters.checkin'); JToolBarHelper::divider(); } break; } JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
} ?> <table class="adminlist"> <tr> <td> <div id="cpanel" class="cpanel_j3"> <?php $option = $jinput->getCmd('option', 'com_bwpostman'); $link = 'index.php?option=' . $option . '&view=maintenance&layout=checkTables'; BwPostmanHTMLHelper::quickiconButton($link, 'icon-48-tablecheck.png', JText::_("COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES"), '', ''); $link = 'index.php?option=' . $option . '&view=maintenance&task=maintenance.saveTables'; BwPostmanHTMLHelper::quickiconButton($link, 'icon-48-tablestore.png', JText::_("COM_BWPOSTMAN_MAINTENANCE_SAVE_TABLES"), 0, 0); $link = 'index.php?option=' . $option . '&view=maintenance&task=maintenance.restoreTables'; BwPostmanHTMLHelper::quickiconButton($link, 'icon-48-tablerestore.png', JText::_("COM_BWPOSTMAN_MAINTENANCE_RESTORE_TABLES"), 0, 0); $canDo = BwPostmanHelper::getActions(); if ($canDo->get('core.manage')) { $link = 'index.php?option=com_config&view=component&component=' . $option . '&path='; BwPostmanHTMLHelper::quickiconButton($link, 'icon-48-config.png', JText::_("COM_BWPOSTMAN_SETTINGS"), '', ''); } $link = 'http://www.boldt-webservice.de/forum/bwpostman.html'; BwPostmanHTMLHelper::quickiconButton($link, 'icon-48-forum.png', JText::_("COM_BWPOSTMAN_FORUM"), 0, 0, 'new'); ?> </div> </td> </tr> </table> </div> <div id="loading" style="display: none;"></div> </div> <div class="clr clearfix"></div>
/** * Overloaded check method to ensure data integrity of a subscriber * * @access public * @return boolean True on success */ public function check() { //Initialize jimport('joomla.mail.helper'); $params = JComponentHelper::getParams('com_bwpostman'); $app = JFactory::getApplication(); $import = $app->getUserState('com_bwpostman.subscriber.import', false); $data = $app->getUserState('com_bwpostman.subscriber.register.data', array()); $session = JFactory::getSession(); $err = $session->get('session_error'); $fault = false; $_db = $this->_db; $query = $_db->getQuery(true); $tester = false; $format_txt = array(0 => 'Text', 1 => 'HTML'); if ($xtest = !'9') { $tester = true; } if ($import && $this->status == '9') { $tester = true; } // Remove all HTML tags from the name, firstname, email and special $filter = new JFilterInput(array(), array(), 0, 0); $this->name = $filter->clean($this->name); $this->firstname = $filter->clean($this->firstname); $this->email = $filter->clean($this->email); $this->special = $filter->clean($this->special); if (!$import) { // Check for valid firstname if ($data['show_firstname_field'] && $data['firstname_field_obligation']) { if (trim($this->firstname) == '') { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_SUB_ERROR_FIRSTNAME'), 'error'); $fault = true; } } // Check for valid name if ($data['show_name_field'] && $data['name_field_obligation']) { if (trim($this->name) == '') { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_SUB_ERROR_NAME'), 'error'); $fault = true; } } // Check for valid additional field if ($data['show_special'] && $data['special_field_obligation']) { if (trim($this->special) == '') { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_SPECIAL', JText::_($params->get('special_label'))), 'error'); $fault = true; } } } // Check for valid email address if (trim($this->email) == '') { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_SUB_ERROR_EMAIL'), 'error'); $fault = true; } elseif (!JMailHelper::isEmailAddress(trim($this->email))) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_EMAIL_INVALID', $this->email), 'error'); $fault = true; } if ($app->isSite() && !$this->id) { // Check if any mailinglist is checked if (!$data['mailinglists']) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_LISTCHECK'), 'error'); $fault = true; } // agreecheck if (JComponentHelper::getParams('com_bwpostman')->get('disclaimer') == 1) { if (!isset($data['agreecheck']) && !isset($data['agreecheck_mod'])) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_AGREECHECK'), 'error'); $fault = true; } } // Spamcheck 1 // Set error message if a not visible (top: -5000px) inputfield is empty if ($data['falle'] != '') { // input wrong - set error $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_SPAMCHECK'), 'error'); $fault = true; } // Spamcheck 2 // Set error message if check of a dynamic time variable failed if (!isset($data['bwp-' . BwPostmanHelper::getCaptcha(1)]) && !isset($data['bwp-' . BwPostmanHelper::getCaptcha(2)])) { // input wrong - set error $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_SPAMCHECK2'), 'error'); $fault = true; } // Captchacheck 1 // Set error message if captchatest failed if (JComponentHelper::getParams('com_bwpostman')->get('use_captcha') == 1) { // start check if (trim($data['stringQuestion']) != trim(JComponentHelper::getParams('com_bwpostman')->get('security_answer'))) { // input wrong - set error $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_CAPTCHA'), 'error'); $fault = true; } } // Captchacheck 2 if (JComponentHelper::getParams('com_bwpostman')->get('use_captcha') == 2) { // Temp folder of captcha-images $captchaDir = JPATH_COMPONENT_SITE . '/assets/capimgdir/'; // del old images after ? minutes $delFile = 10; // start check $resultCaptcha = BwPostmanHelper::CheckCaptcha($data['codeCaptcha'], $data['stringCaptcha'], $captchaDir, $delFile); if (!$resultCaptcha) { // input wrong - set error $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ERROR_CAPTCHA'), 'error'); $fault = true; } } } if ($fault) { $app->setUserState('com_bwpostman.edit.subscriber.data', $this); // $app->setUserState('com_bwpostman.edit.subscriber.register.errors', $err); $session->set('session_error', $err); // $session->close(); return false; } // Check for existing email $query->select($_db->quoteName('id')); $query->from($_db->quoteName('#__bwpostman_subscribers')); $query->where($_db->quoteName('email') . ' = ' . $_db->Quote($this->email)); if (!$tester) { $query->where($_db->quoteName('status') . ' != ' . (int) 9); } $_db->setQuery($query); $_db->query(); if (!$tester) { $xid = intval($this->_db->loadResult()); } else { $xids = $this->_db->loadColumn(); } //Test-recipient may have multiple entries, but may not be archived if ($tester) { foreach ($xids as $xid) { $xid = intval($xid); if ($xid && $xid != intval($this->id)) { $query = $_db->getQuery(true); $query->select($_db->quoteName('id')); $query->select($_db->quoteName('emailformat')); $query->select($_db->quoteName('archive_flag')); $query->from($_db->quoteName('#__bwpostman_subscribers')); $query->where($_db->quoteName('id') . ' = ' . (int) $xid); $this->_db->setQuery($query); $testrecipient = $this->_db->loadObject(); // Account with this emailformat already exists if ($testrecipient->archive_flag == 0 && $testrecipient->emailformat == $this->emailformat) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTEXISTS', $this->email, $format_txt[$this->emailformat], $testrecipient->id), 'error'); $err['err_code'] = 409; $err['err_msg'] = JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTEXISTS', $this->email, $format_txt[$this->emailformat], $testrecipient->id); $err['err_id'] = $xid; $app->setUserState('com_bwpostman.subscriber.register.error', $err); $this->setError(JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTEXISTS', $this->email, $format_txt[$this->emailformat], $testrecipient->id)); $session->set('session_error', $err); return false; } // Account is archived if ($testrecipient->archive_flag == 1 && $testrecipient->emailformat == $this->emailformat) { $app->enqueueMessage(JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTARCHIVED', $this->email, $format_txt[$this->emailformat], $testrecipient->id), 'error'); $err['err_code'] = 410; $err['err_msg'] = JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTARCHIVED', $this->email, $format_txt[$this->emailformat], $testrecipient->id); $err['err_id'] = $xid; $app->setUserState('com_bwpostman.subscriber.register.error', $err); $this->setError(JText::sprintf('COM_BWPOSTMAN_TEST_ERROR_ACCOUNTARCHIVED', $this->email, $format_txt[$this->emailformat], $testrecipient->id)); $session->set('session_error', $err); return false; } } } } else { if ($xid && $xid != intval($this->id)) { $query = $_db->getQuery(true); $query->select($_db->quoteName('id')); $query->select($_db->quoteName('status')); $query->select($_db->quoteName('archive_flag')); $query->select($_db->quoteName('archived_by')); $query->from($_db->quoteName('#__bwpostman_subscribers')); $query->where($_db->quoteName('id') . ' = ' . (int) $xid); $_db->setQuery($query); $_db->query(); $subscriber = $this->_db->loadObject(); // Account is blocked by system/administrator if ($subscriber->archive_flag == 1 && $subscriber->archived_by > 0) { $err['err_code'] = 405; $err['err_msg'] = JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTBLOCKED_BY_SYSTEM', $this->email, $xid); $err['err_id'] = $xid; $err['err_email'] = $this->email; $app->setUserState('com_bwpostman.subscriber.register.error', $err); $this->setError(JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTBLOCKED_BY_SYSTEM', $this->email, $xid)); $session->set('session_error', $err); return false; } // Account is not activated if ($subscriber->status == 0) { $err['err_code'] = 406; $err['err_msg'] = JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTNOTACTIVATED', $this->email, $xid); $err['err_id'] = $xid; $err['err_email'] = $this->email; $app->setUserState('com_bwpostman.subscriber.register.error', $err); $this->setError(JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTNOTACTIVATED', $this->email, $xid)); $session->set('session_error', $err); return false; } // Account already exists if ($subscriber->status == 1 && $subscriber->archive_flag != 1) { $err['err_code'] = 407; $err['err_msg'] = JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTEXISTS', $this->email, JRoute::_('index.php?option=com_bwpostman&view=edit')); $err['err_id'] = $xid; $err['err_email'] = $this->email; $app->setUserState('com_bwpostman.subscriber.register.error', $err); $this->setError(JText::sprintf('COM_BWPOSTMAN_SUB_ERROR_DB_ACCOUNTEXISTS', $this->email, JRoute::_('index.php?option=com_bwpostman&view=edit'))); $session->set('session_error', $err); return false; } } } return true; }
/** * 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); } }
/** * Method to show a captcha * * @since 1.0.1 */ public function showCaptcha() { BwPostmanHelper::showCaptcha(); }
/** * Add the page title, styles and toolbar. * * @since 1.1.0 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $uri = JFactory::getURI(); $userId = JFactory::getUser()->get('id'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('BWP_TPL_DETAILS')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Get the user browser --> if the user has msie load the ie-css to show the tabs in the correct way jimport('joomla.environment.browser'); $browser = JBrowser::getInstance(); $user_browser = $browser->getBrowser(); if ($user_browser == 'msie') { $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend_ie.css'); } // Set toolbar title depending on the state of the item: Is it a new item? --> Create; Is it an existing record? --> Edit $isNew = $this->item->id < 1; // Set toolbar title and items $canDo = BwPostmanHelper::getActions($this->item->id, 'template'); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); $this->canDo = $canDo; // For new records, check the create permission. if ($isNew && $canDo->get('core.create')) { JToolBarHelper::save('template.save'); JToolBarHelper::apply('template.apply'); JToolBarHelper::cancel('template.cancel'); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_TPL_DETAILS') . ': <small>[ ' . JText::_('NEW') . ' ]</small>', 'plus'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::save('template.save'); JToolBarHelper::apply('template.apply'); } } // If checked out, we can still copy if ($canDo->get('core.create')) { JToolBarHelper::save2copy('template.save2copy'); } // Rename the cancel button for existing items JToolBarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE'); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_TPL_DETAILS') . ': <strong>' . $this->item->title . ' </strong><small>[ ' . JText::_('EDIT') . ' ]</small> ', 'edit'); } $backlink = $_SERVER['HTTP_REFERER']; $siteURL = $uri->base(); // If we came from the cover page we will show a back-button if ($backlink == $siteURL . 'index.php?option=com_bwpostman') { JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::back(); } JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * Method to remove one or more mailinglists * --> is called by the archive-controller * * @access public * * @param array &$pks Mailinglist IDs * * @return boolean */ public function delete(&$pks) { $app = JFactory::getApplication(); // Access check. foreach ($pks as $i) { if (!BwPostmanHelper::allowDelete($i, 0, 'mailinglist')) { return false; } } if (count($pks)) { JArrayHelper::toInteger($pks); $_db = $this->getDbo(); $lists_table = JTable::getInstance('mailinglists', 'BwPostmanTable'); // Delete all entries from the mailinglists-table foreach ($pks as $id) { if (!$lists_table->delete($id)) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ARC_ERROR_REMOVING_MLS_NO_ML_DELETED'), 'error'); return false; } } // Delete all entries from the subscribers_mailinglists-table $query = $_db->getQuery(true); $query->delete(); $query->from($_db->quoteName('#__bwpostman_subscribers_mailinglists')); $query->where('mailinglist_id IN (' . implode(',', $pks) . ')'); $_db->setQuery($query); if (!$_db->query()) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ARC_ERROR_REMOVING_MLS_NO_SUBS_DELETED'), 'warning'); } // Delete all entries from the newsletters_mailinglists-table $query = $_db->getQuery(true); $query->delete(); $query->from($_db->quoteName('#__bwpostman_newsletters_mailinglists')); $query->where('mailinglist_id IN (' . implode(',', $pks) . ')'); $_db->setQuery($query); if (!$_db->query()) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ARC_ERROR_REMOVING_MLS_NO_MLS_DELETED'), 'warning'); } } return true; }
/** * Method to remove one or more templates * --> is called by the archive-controller * * @access public * * @param array $pks template IDs * * @return boolean * * @since 1.1.0 */ public function delete(&$pks) { $app = JFactory::getApplication(); // Access check. foreach ($pks as $i) { if (!BwPostmanHelper::allowDelete($i, 0, 'template')) { return false; } } if (count($pks)) { JArrayHelper::toInteger($pks); $lists_table = JTable::getInstance('templates', 'BwPostmanTable'); // Delete all entries from the templates-table foreach ($pks as $id) { if (!$lists_table->delete($id)) { $app->enqueueMessage(JText::_('COM_BWPOSTMAN_ARC_ERROR_REMOVING_TPLS_NO_TPL_DELETED'), 'error'); return false; } } } return true; }
/** * Add the page title, styles and toolbar. * */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $uri = JFactory::getURI(); $userId = JFactory::getUser()->get('id'); $layout = JFactory::getApplication()->input->get('layout', ''); $tester = false; $status = 1; if (is_object($this->item)) { $status = $this->item->status; } if (JFactory::getApplication()->getUserState('com_bwpostman.subscriber.new_test', $status) == '9') { $tester = true; } // Get document object, set document title and add css $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); switch ($layout) { case 'export': // Get document object, set document title and add css $document->setTitle(JText::_('COM_BWPOSTMAN_SUB_EXPORT_SUBS')); // Set toolbar items JToolBarHelper::title(JText::_('COM_BWPOSTMAN_SUB_EXPORT_SUBS'), 'upload'); JToolBarHelper::cancel('subscriber.cancel'); break; case 'import': // Set toolbar items $document->setTitle(JText::_('COM_BWPOSTMAN_SUB_IMPORT_SUBS')); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_SUB_IMPORT_SUBS'), 'download'); JToolBarHelper::cancel('subscriber.cancel'); break; case 'import1': $document->setTitle(JText::_('COM_BWPOSTMAN_SUB_IMPORT_SUBS')); $backlink = 'index.php?option=com_bwpostman&view=subscriber&layout=import'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_SUB_IMPORT_SUBS'), 'download'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::cancel('subscriber.cancel'); break; case 'import2': $document->setTitle(JText::_('COM_BWPOSTMAN_SUB_IMPORT_RESULT')); $backlink = 'index.php?option=com_bwpostman&view=subscriber&layout=import1'; JToolBarHelper::title(JText::_('COM_BWPOSTMAN_SUB_IMPORT_RESULT'), 'info'); $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::cancel('subscriber.cancel'); break; case 'edit': default: if ($tester) { $title = JText::_('COM_BWPOSTMAN_TEST_DETAILS'); } else { $title = JText::_('COM_BWPOSTMAN_SUB_DETAILS'); } $document->setTitle($title); // Set toolbar title and items $canDo = BwPostmanHelper::getActions($this->item->id, 'subscriber'); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); $this->canDo = $canDo; // Set toolbar title depending on the state of the item: Is it a new item? --> Create; Is it an existing record? --> Edit // For new records, check the create permission. if ($this->item->id < 1 && $canDo->get('core.create')) { JToolBarHelper::save('subscriber.save'); JToolBarHelper::apply('subscriber.apply'); JToolBarHelper::cancel('subscriber.cancel'); JToolBarHelper::title($title . ': <small>[ ' . JText::_('NEW') . ' ]</small>', 'plus'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::save('subscriber.save'); JToolBarHelper::apply('subscriber.apply'); } } // Rename the cancel button for existing items JToolBarHelper::cancel('subscriber.cancel', 'JTOOLBAR_CLOSE'); JToolBarHelper::title($title . ': <small>[ ' . JText::_('EDIT') . ' ]</small>', 'edit'); } $backlink = $_SERVER['HTTP_REFERER']; $siteURL = $uri->base(); // If we came from the cover page we will show a back-button if ($backlink == $siteURL . 'index.php?option=com_bwpostman') { JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::back(); } } JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); }
/** * Method to remove one or more newsletters from the newsletters-table * --> is called by the archive-controller * * @access public * * @param array $pks Newsletter IDs * * @return boolean */ public function delete(&$pks) { // Access check. foreach ($pks as $i) { $data = self::getItem($i); if (!BwPostmanHelper::allowDelete($i, $data->created_by, 'newsletter')) { return false; } } if (count($pks)) { JArrayHelper::toInteger($pks); // Delete newsletter from newsletters-table $nl_table = JTable::getInstance('newsletters', 'BwPostmanTable'); foreach ($pks as $id) { if (!$nl_table->delete($id)) { return false; } } // Delete assigned mailinglists from newsletters_mailinglists-table $lists_table = JTable::getInstance('newsletters_mailinglists', 'BwPostmanTable'); foreach ($pks as $id) { if (!$lists_table->delete($id)) { return false; } } } return true; }
/** * Method to remove one or more subscribers/test-recipients * --> is called by the archive-controller * * @access public * * @param array $pks Subscriber/Test-recipient IDs * * @return boolean */ public function delete(&$pks) { // Access check. foreach ($pks as $i) { if (!BwPostmanHelper::allowDelete($i, 0, 'subscriber')) { return false; } } if (count($pks)) { JArrayHelper::toInteger($pks); $_db = $this->getDbo(); // Delete subscriber from subscribers-table if (!parent::delete($pks)) { $this->setError($_db->getErrorMsg()); return false; } // Delete subscribed mailinglists from subscribers_mailinglists-table $query = $_db->getQuery(true); $query->delete(); $query->from($_db->quoteName('#__bwpostman_subscribers_mailinglists')); $query->where('subscriber_id IN (' . implode(',', $pks) . ')'); $_db->setQuery($query); if (!$_db->query()) { $this->setError($_db->getErrorMsg()); return false; } } return true; }
/** * Add the page title, styles and toolbar. * */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $userId = JFactory::getUser()->get('id'); $layout = JFactory::getApplication()->input->get('layout', ''); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle('COM_BWPOSTMAN_NL_DETAILS'); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); $document->addScript(JURI::root(true) . '/administrator/components/com_bwpostman/assets/js/bwpostman_nl.js'); // Set toolbar title and items $canDo = BwPostmanHelper::getActions($this->item->id, 'newsletter'); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); $this->canDo = $canDo; $isNew = $this->item->id == 0; // If we come from sent newsletters, we have to do other stuff than normal if ($layout == 'edit_publish') { JToolBarHelper::save('newsletter.publish_save'); JToolBarHelper::cancel('newsletter.cancel'); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_NL_PUBLISHING_DETAILS') . ': <small>[ ' . JText::_('NEW') . ' ]</small>', 'plus'); } else { // For new records, check the create permission. if ($isNew && $canDo->get('core.create')) { JToolBarHelper::title(JText::_('COM_BWPOSTMAN_NL_DETAILS') . ': <small>[ ' . JText::_('EDIT') . ' ]</small>', 'edit'); JToolBarHelper::save('newsletter.save'); JToolBarHelper::apply('newsletter.apply'); $task = JFactory::getApplication()->input->get('task', '', 'string'); // If we came from the main page we will show a back button if ($task == 'add') { JToolBarHelper::back(); } else { JToolBarHelper::cancel('newsletter.cancel'); } } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::save('newsletter.save'); JToolBarHelper::apply('newsletter.apply'); } } // Rename the cancel button for existing items JToolBarHelper::cancel('newsletter.cancel', 'COM_BWPOSTMAN_CLOSE'); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_NL_DETAILS') . ': <small>[ ' . JText::_('EDIT') . ' ]</small>', 'edit'); } /* JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); if ($canDo->get('core.create') || $canDo->get('core.edit') || $canDo->get('core.send')) JToolBarHelper::custom('newsletter.checkForm', 'thumbs-up', 'checkform_f2', 'COM_BWPOSTMAN_NL_CHECK_FORM', false); */ } JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * Method to remove one or more campaigns and if the user want also the assigned newsletters * --> is called by the archive-controller * * @access public * * @param array &$pks Campaign IDs * * @return boolean */ public function delete(&$pks) { $jinput = JFactory::getApplication()->input; $remove_nl = $jinput->get('remove_nl', false); // Access check. foreach ($pks as $i) { if (!BwPostmanHelper::allowDelete($i, 0, 'campaign')) { return false; } } if (count($pks)) { JArrayHelper::toInteger($pks); // Delete campaigns from campaigns-table $cams_table = JTable::getInstance('campaigns', 'BwPostmanTable'); foreach ($pks as $id) { if (!$cams_table->delete($id)) { return false; } } // Remove_nl = 1 if the user want to delete the assigned newsletters if ($remove_nl) { // Delete newsletter from newsletters-table $nl_table = JTable::getInstance('newsletters', 'BwPostmanTable'); $_db = $this->getDbo(); $query = $_db->getQuery(true); $query->select($_db->quoteName('id')); $query->from($_db->quoteName('#__bwpostman_newsletters')); $query->where($_db->quoteName('campaign_id') . ' IN (' . implode(',', $pks) . ')'); $_db->setQuery($query); $nl_ids = $_db->loadColumn(); foreach ($nl_ids as $id) { if (!$nl_table->delete($id)) { return false; } } } } return true; }
/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $jinput = JFactory::getApplication()->input; $layout = $jinput->getCmd('layout', ''); $canDo = BwPostmanHelper::getActions(0, 'template'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_TPL')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); switch ($layout) { case 'uploadtpl': $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); $backlink = 'index.php?option=com_bwpostman&view=templates'; $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_TPL_UPLOADTPL'), 'upload'); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); break; case 'installtpl': $alt = "COM_BWPOSTMAN_BACK"; $bar = JToolBar::getInstance('toolbar'); $backlink = 'index.php?option=com_bwpostman&view=templates'; $bar->appendButton('Link', 'arrow-left', $alt, $backlink); JToolBarHelper::title(JText::_('COM_BWPOSTMAN_TPL_INSTALLTPL'), 'plus'); JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); break; default: // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_TPL'), 'picture'); // Set toolbar items for the page if ($canDo->get('core.create')) { JToolBarHelper::custom('template.addhtml', 'calendar', 'HTML', 'COM_BWPOSTMAN_TPL_ADDHTML', false); } if ($canDo->get('core.create')) { JToolBarHelper::custom('template.addtext', 'new', 'TEXT', 'COM_BWPOSTMAN_TPL_ADDTEXT', false); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('template.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::makeDefault('template.setDefault', 'COM_BWPOSTMAN_TPL_SET_DEFAULT'); JToolBarHelper::publishList('templates.publish'); JToolBarHelper::unpublishList('templates.unpublish'); } JToolBarHelper::divider(); JToolBarHelper::spacer(); if ($canDo->get('core.archive')) { JToolBarHelper::archiveList('template.archive'); JToolBarHelper::divider(); JToolBarHelper::spacer(); } if ($canDo->get('core.manage')) { JToolBarHelper::checkin('templates.checkin'); JToolBarHelper::divider(); } // templateupload if ($canDo->get('core.create')) { $bar = JToolBar::getInstance('toolbar'); JHTML::_('behavior.modal'); $html = '<a class="btn btn-small" href="' . JURI::root(true) . '/administrator/index.php?option=com_bwpostman&view=templates&layout=uploadtpl" rel="{handler: \'iframe\', size: {x: 850, y: 500}}" ><span class="icon-upload"></span>' . JText::_('COM_BWPOSTMAN_TPL_INSTALLTPL') . '</a>'; $bar->appendButton('Custom', $html); } } JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $jinput = JFactory::getApplication()->input; $canDo = BwPostmanHelper::getActions(0, 'archive'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_ARC')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_ARC'), 'list'); // Set toolbar items for the page (depending on the tab which we are in) $layout = $jinput->get('layout', 'newsletters'); switch ($layout) { // Which tab are we in? case "newsletters": if ($canDo->get('core.restore')) { JToolBarHelper::unarchiveList('archive.unarchive', JText::_('COM_BWPOSTMAN_UNARCHIVE')); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_BWPOSTMAN_ARC_CONFIRM_REMOVING_NL'), 'archive.delete'); } break; case "subscribers": if ($canDo->get('core.restore')) { JToolBarHelper::unarchiveList('archive.unarchive', JText::_('COM_BWPOSTMAN_UNARCHIVE')); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_BWPOSTMAN_ARC_CONFIRM_REMOVING_SUB'), 'archive.delete'); } break; case "campaigns": // Special unarchive and delete button because we need a confirm dialog with 3 options $bar = JToolBar::getInstance('toolbar'); $alt_archive = "unarchive"; if ($canDo->get('core.restore')) { $bar->appendButton('Popup', 'unarchive', $alt_archive, 'index.php?option=com_bwpostman&view=archive&format=raw&layout=campaigns_confirmunarchive', 500, 130); } $alt_delete = "delete"; if ($canDo->get('core.delete')) { $bar->appendButton('Popup', 'delete', $alt_delete, 'index.php?option=com_bwpostman&view=archive&format=raw&layout=campaigns_confirmdelete', 500, 150); } break; case "mailinglists": if ($canDo->get('core.restore')) { JToolBarHelper::unarchiveList('archive.unarchive', JText::_('COM_BWPOSTMAN_UNARCHIVE')); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_BWPOSTMAN_ARC_CONFIRM_REMOVING_ML'), 'archive.delete'); } break; case "templates": if ($canDo->get('core.restore')) { JToolBarHelper::unarchiveList('archive.unarchive', JText::_('COM_BWPOSTMAN_UNARCHIVE')); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_BWPOSTMAN_ARC_CONFIRM_REMOVING_TPL'), 'archive.delete'); } break; } JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); JToolBarHelper::spacer(); }
/** * Add the page title, submenu and toolbar. * */ protected function addToolbar() { $app = JFactory::getApplication(); $tab = $app->getUserState($this->context . '.tab', 'confirmed'); $canDo = BwPostmanHelper::getActions(0, 'subscribers'); $user = JFactory::getUser(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // Get document object, set document title and add css $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_BWPOSTMAN_CAMS')); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_bwpostman/assets/css/bwpostman_backend.css'); // Set toolbar title JToolBarHelper::title(JText::_('COM_BWPOSTMAN_SUB'), 'users'); // Set toolbar items for the page switch ($tab) { // The layout-variable tells us which tab we are in default: case "confirmed": case "unconfirmed": if ($canDo->get('core.create')) { JToolBarHelper::addNew('subscriber.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('subscriber.edit'); } JToolBarHelper::spacer(); JToolBarHelper::divider(); JToolBarHelper::spacer(); if ($canDo->get('core.create')) { JToolBarHelper::custom('subscribers.importSubscribers', 'download', 'import_f2', 'COM_BWPOSTMAN_SUB_IMPORT', false); } if ($canDo->get('core.edit')) { JToolBarHelper::custom('subscribers.exportSubscribers', 'upload', 'export_f2', 'COM_BWPOSTMAN_SUB_EXPORT', false); } if ($canDo->get('core.archive')) { JToolBarHelper::divider(); JToolBarHelper::spacer(); JToolBarHelper::archiveList('subscriber.archive'); } // Add a batch button if ($user->authorise('core.create', 'com_bwpostman') && $user->authorise('core.edit', 'com_bwpostman') && $user->authorise('core.edit.state', 'com_bwpostman')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } break; case "testrecipients": if ($canDo->get('core.create')) { JToolBarHelper::addNew('subscriber.add_test'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('subscriber.edit'); } JToolBarHelper::spacer(); JToolBarHelper::divider(); if ($canDo->get('core.archive')) { JToolBarHelper::archiveList('subscriber.archive'); } break; } JToolBarHelper::divider(); JToolBarHelper::spacer(); if ($canDo->get('core.manage')) { JToolBarHelper::checkin('subscribers.checkin'); JToolBarHelper::divider(); } JToolBarHelper::help(JText::_("COM_BWPOSTMAN_FORUM"), false, 'http://www.boldt-webservice.de/forum/bwpostman.html'); }
} // Get document object, set document title and add css $templateName = $app->getTemplate(); $css_filename = '/templates/' . $templateName . '/css/mod_bwpostman.css'; $document->addStyleSheet(JURI::root(true) . '/modules/mod_bwpostman/css/bwpostman.css'); if (file_exists(JPATH_BASE . $css_filename)) { $document->addStyleSheet(JURI::root(true) . $css_filename); } if (!JComponentHelper::isEnabled('com_bwpostman', true)) { $app->enqueueMessage(JText::_('Module requires the com_bwpostman component'), 'error'); } else { $user = JFactory::getUser(); $userid = $user->get('id'); $usertype = ''; $subscriberid = modBwPostmanHelper::getSubscriberID(); $captcha = BwPostmanHelper::getCaptcha(1); // use module or component parameters if ($params->get('com_params') == 0) { // Moduleparams $paramsComponent = $params; } else { // Get the parameters of the component // --> we need these parameters because we have to ensure that both the component and the module will work with the same settings $paramsComponent = $app->getPageParameters('com_bwpostman'); } if ($subscriberid) { $layout = "_linktocomponent"; } else { $layout = "default"; if ($userid > 0) { $subscriber = modBwPostmanHelper::getUserData($userid);