[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_privacy 6 * 7 * @copyright (C) 2018 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\Privacy\Administrator\View\Requests; 12 13 use Joomla\CMS\Component\ComponentHelper; 14 use Joomla\CMS\Factory; 15 use Joomla\CMS\Form\Form; 16 use Joomla\CMS\Language\Text; 17 use Joomla\CMS\MVC\View\GenericDataException; 18 use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; 19 use Joomla\CMS\Object\CMSObject; 20 use Joomla\CMS\Pagination\Pagination; 21 use Joomla\CMS\Toolbar\ToolbarHelper; 22 use Joomla\Component\Privacy\Administrator\Model\RequestsModel; 23 24 // phpcs:disable PSR1.Files.SideEffects 25 \defined('_JEXEC') or die; 26 // phpcs:enable PSR1.Files.SideEffects 27 28 /** 29 * Requests view class 30 * 31 * @since 3.9.0 32 */ 33 class HtmlView extends BaseHtmlView 34 { 35 /** 36 * The active search tools filters 37 * 38 * @var array 39 * @since 3.9.0 40 * @note Must be public to be accessed from the search tools layout 41 */ 42 public $activeFilters; 43 44 /** 45 * Form instance containing the search tools filter form 46 * 47 * @var Form 48 * @since 3.9.0 49 * @note Must be public to be accessed from the search tools layout 50 */ 51 public $filterForm; 52 53 /** 54 * The items to display 55 * 56 * @var array 57 * @since 3.9.0 58 */ 59 protected $items; 60 61 /** 62 * The pagination object 63 * 64 * @var Pagination 65 * @since 3.9.0 66 */ 67 protected $pagination; 68 69 /** 70 * Flag indicating the site supports sending email 71 * 72 * @var boolean 73 * @since 3.9.0 74 */ 75 protected $sendMailEnabled; 76 77 /** 78 * The state information 79 * 80 * @var CMSObject 81 * @since 3.9.0 82 */ 83 protected $state; 84 85 /** 86 * The age of urgent requests 87 * 88 * @var integer 89 * @since 3.9.0 90 */ 91 protected $urgentRequestAge; 92 93 /** 94 * Execute and display a template script. 95 * 96 * @param string $tpl The name of the template file to parse; automatically searches through the template paths. 97 * 98 * @return void 99 * 100 * @see BaseHtmlView::loadTemplate() 101 * @since 3.9.0 102 * @throws \Exception 103 */ 104 public function display($tpl = null) 105 { 106 /** @var RequestsModel $model */ 107 $model = $this->getModel(); 108 $this->items = $model->getItems(); 109 $this->pagination = $model->getPagination(); 110 $this->state = $model->getState(); 111 $this->filterForm = $model->getFilterForm(); 112 $this->activeFilters = $model->getActiveFilters(); 113 $this->urgentRequestAge = (int) ComponentHelper::getParams('com_privacy')->get('notify', 14); 114 $this->sendMailEnabled = (bool) Factory::getApplication()->get('mailonline', 1); 115 116 if (!count($this->items) && $this->get('IsEmptyState')) { 117 $this->setLayout('emptystate'); 118 } 119 120 // Check for errors. 121 if (count($errors = $this->get('Errors'))) { 122 throw new Genericdataexception(implode("\n", $errors), 500); 123 } 124 125 $this->addToolbar(); 126 127 parent::display($tpl); 128 } 129 130 /** 131 * Add the page title and toolbar. 132 * 133 * @return void 134 * 135 * @since 3.9.0 136 */ 137 protected function addToolbar() 138 { 139 ToolbarHelper::title(Text::_('COM_PRIVACY_VIEW_REQUESTS'), 'lock'); 140 141 // Requests can only be created if mail sending is enabled 142 if (Factory::getApplication()->get('mailonline', 1)) { 143 ToolbarHelper::addNew('request.add'); 144 } 145 146 ToolbarHelper::preferences('com_privacy'); 147 ToolbarHelper::help('Privacy:_Information_Requests'); 148 } 149 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |