[ 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_installer 6 * 7 * @copyright (C) 2011 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\Installer\Administrator\View\Database; 12 13 use Joomla\CMS\Factory; 14 use Joomla\CMS\Form\Form; 15 use Joomla\CMS\Language\Text; 16 use Joomla\CMS\Pagination\Pagination; 17 use Joomla\CMS\Toolbar\ToolbarHelper; 18 use Joomla\Component\Installer\Administrator\Model\DatabaseModel; 19 use Joomla\Component\Installer\Administrator\View\Installer\HtmlView as InstallerViewDefault; 20 21 // phpcs:disable PSR1.Files.SideEffects 22 \defined('_JEXEC') or die; 23 // phpcs:enable PSR1.Files.SideEffects 24 25 /** 26 * Extension Manager Database View 27 * 28 * @since 1.6 29 */ 30 class HtmlView extends InstallerViewDefault 31 { 32 /** 33 * List of change sets 34 * 35 * @var array 36 * @since 4.0.0 37 */ 38 protected $changeSet = array(); 39 40 /** 41 * The number of errors found 42 * 43 * @var integer 44 * @since 4.0.0 45 */ 46 protected $errorCount = 0; 47 48 /** 49 * List pagination. 50 * 51 * @var Pagination 52 * @since 4.0.0 53 */ 54 protected $pagination; 55 56 /** 57 * The filter form 58 * 59 * @var Form 60 * @since 4.0.0 61 */ 62 public $filterForm; 63 64 /** 65 * A list of form filters 66 * 67 * @var array 68 * @since 4.0.0 69 */ 70 public $activeFilters = array(); 71 72 /** 73 * Display the view. 74 * 75 * @param string $tpl Template 76 * 77 * @return void 78 * 79 * @throws \Exception 80 * 81 * @since 1.6 82 */ 83 public function display($tpl = null) 84 { 85 // Get the application 86 $app = Factory::getApplication(); 87 88 // Get data from the model. 89 /** @var DatabaseModel $model */ 90 $model = $this->getModel(); 91 92 try { 93 $this->changeSet = $model->getItems(); 94 } catch (\Exception $exception) { 95 $app->enqueueMessage($exception->getMessage(), 'error'); 96 } 97 98 $this->errorCount = $model->getErrorCount(); 99 $this->pagination = $model->getPagination(); 100 $this->filterForm = $model->getFilterForm(); 101 $this->activeFilters = $model->getActiveFilters(); 102 103 if ($this->changeSet) { 104 ($this->errorCount === 0) 105 ? $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_OK'), 'info') 106 : $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_ERRORS'), 'warning'); 107 } 108 109 parent::display($tpl); 110 } 111 112 /** 113 * Add the page title and toolbar. 114 * 115 * @return void 116 * 117 * @since 1.6 118 */ 119 protected function addToolbar() 120 { 121 /* 122 * Set toolbar items for the page. 123 */ 124 ToolbarHelper::custom('database.fix', 'refresh', '', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', true); 125 ToolbarHelper::divider(); 126 parent::addToolbar(); 127 ToolbarHelper::help('Information:_Database'); 128 } 129 }
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 |