[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_users/src/View/Mail/ -> HtmlView.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_users
   6   *
   7   * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Users\Administrator\View\Mail;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\Language\Text;
  15  use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
  16  use Joomla\CMS\Router\Route;
  17  use Joomla\CMS\Toolbar\ToolbarHelper;
  18  
  19  // phpcs:disable PSR1.Files.SideEffects
  20  \defined('_JEXEC') or die;
  21  // phpcs:enable PSR1.Files.SideEffects
  22  
  23  /**
  24   * Users mail view.
  25   *
  26   * @since  1.6
  27   */
  28  class HtmlView extends BaseHtmlView
  29  {
  30      /**
  31       * The Form object
  32       *
  33       * @var  \Joomla\CMS\Form\Form
  34       */
  35      protected $form;
  36  
  37      /**
  38       * Display the view
  39       *
  40       * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  41       *
  42       * @return  void
  43       *
  44       * @throws  \Exception
  45       */
  46      public function display($tpl = null)
  47      {
  48          // Redirect to admin index if mass mailer disabled in conf
  49          if (Factory::getApplication()->get('massmailoff', 0) == 1) {
  50              Factory::getApplication()->redirect(Route::_('index.php', false));
  51          }
  52  
  53          // Get data from the model
  54          $this->form = $this->get('Form');
  55  
  56          $this->addToolbar();
  57          parent::display($tpl);
  58      }
  59  
  60      /**
  61       * Add the page title and toolbar.
  62       *
  63       * @return  void
  64       *
  65       * @since   1.6
  66       * @throws  \Exception
  67       */
  68      protected function addToolbar()
  69      {
  70          Factory::getApplication()->input->set('hidemainmenu', true);
  71  
  72          ToolbarHelper::title(Text::_('COM_USERS_MASS_MAIL'), 'users massmail');
  73          ToolbarHelper::custom('mail.send', 'envelope', '', 'COM_USERS_TOOLBAR_MAIL_SEND_MAIL', false);
  74          ToolbarHelper::cancel('mail.cancel');
  75          ToolbarHelper::divider();
  76          ToolbarHelper::preferences('com_users');
  77          ToolbarHelper::divider();
  78          ToolbarHelper::help('Mass_Mail_Users');
  79      }
  80  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer