/** * 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, '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(); }
/** * 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, 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'); }
/** * 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(); }
/** * 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); } }
/** * 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(); }
/** * 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'); }
} ?> <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>
/** * 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(); }
/** * 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(); }