envErrors[] = Text::_('COM_PATCHTESTER_REQUIREMENT_OPENSSL'); } if (!in_array('https', stream_get_wrappers(), true)) { $this->envErrors[] = Text::_('COM_PATCHTESTER_REQUIREMENT_HTTPS'); } if (!count($this->envErrors)) { $model = $this->getModel(); $this->state = $model->getState(); $this->items = $model->getItems(); $this->pagination = $model->getPagination(); $this->filterForm = $model->getFilterForm(); $this->activeFilters = $model->getActiveFilters(); $this->trackerAlias = TrackerHelper::getTrackerAlias($this->state->get('github_user'), $this->state->get('github_repo')); } // Change the layout if there are environment errors if (count($this->envErrors)) { $this->setLayout('errors'); } $this->addToolbar(); Text::script('COM_PATCHTESTER_CONFIRM_RESET'); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 2.0.0 */ protected function addToolbar(): void { ToolbarHelper::title(Text::_('COM_PATCHTESTER'), 'patchtester fas fa-save'); if (!count($this->envErrors)) { $toolbar = Toolbar::getInstance('toolbar'); $toolbar->appendButton('Popup', 'sync', 'COM_PATCHTESTER_TOOLBAR_FETCH_DATA', 'index.php?option=com_patchtester&view=fetch&tmpl=component', 500, 210, 0, 0, 'window.parent.location.reload()', Text::_('COM_PATCHTESTER_HEADING_FETCH_DATA')); // Add a reset button. $toolbar->appendButton('Standard', 'expired', 'COM_PATCHTESTER_TOOLBAR_RESET', 'reset', false); } ToolbarHelper::preferences('com_patchtester'); } }