Skip to content

Commit

Permalink
Merge branch '5.2-dev' into 5.2-langhomemenuitem
Browse files Browse the repository at this point in the history
  • Loading branch information
QuyTon authored Aug 17, 2024
2 parents 7d82dcd + a1c3876 commit ea5b52c
Show file tree
Hide file tree
Showing 228 changed files with 2,945 additions and 1,904 deletions.
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ steps:
- ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
- echo $(date)

- name: phan
image: joomlaprojects/docker-images:php8.1-ast
- name: phpstan
image: joomlaprojects/docker-images:php8.2
depends_on: [ phpcs ]
failure: ignore
commands:
- ./libraries/vendor/bin/phan
- ./libraries/vendor/bin/phpstan

- name: npm
image: node:20-bullseye-slim
Expand Down Expand Up @@ -430,6 +430,6 @@ trigger:

---
kind: signature
hmac: 66d331abed02e76707b26cbf12fef3ec4506858cc748acdb5aee2c256e92ba4f
hmac: 903759c59028cc757ba3faef044e3b9122d00f99ea0367caadceb710cb88030f

...
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogsModel;
Expand Down Expand Up @@ -134,7 +133,7 @@ public function display($tpl = null)
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_ACTIONLOGS_MANAGER_USERLOGS'), 'icon-list-2');
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

$toolbar->standardButton('download', 'COM_ACTIONLOGS_EXPORT_CSV', 'actionlogs.exportSelectedLogs')
->icon('icon-download')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Admin\Administrator\Model\SysinfoModel;

Expand Down Expand Up @@ -111,7 +110,7 @@ public function display($tpl = null): void
protected function addToolbar(): void
{
ToolbarHelper::title(Text::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info-circle systeminfo');
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();
$toolbar->linkButton('download', 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_TEXT')
->url(Route::_('index.php?option=com_admin&view=sysinfo&format=text&' . Session::getFormToken() . '=1'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\Component\Associations\Administrator\Model\AssociationModel;
Expand Down Expand Up @@ -358,7 +357,7 @@ protected function addToolbar(): void
'language assoc'
);

$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();
$toolbar->customButton('reference')
->html('<joomla-toolbar-button><button onclick="Joomla.submitbutton(\'reference\')" '
. 'class="btn btn-success"><span class="icon-save" aria-hidden="true"></span>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;

Expand Down Expand Up @@ -66,6 +65,56 @@ class HtmlView extends BaseHtmlView
*/
public $itemType = null;

/**
* Main Extension Name
*
* @var string
*
* @since __DEPLOY_VERSION__
*/
public $extensionName;

/**
* Subtype of the extension
*
* @var string
*
* @since __DEPLOY_VERSION__
*/
public $typeName;

/**
* Supported features
*
* @var string[]
*
* @since __DEPLOY_VERSION__
*/
public $typeSupports;

/**
* Fields
*
* @var string[]
*
* @since __DEPLOY_VERSION__
*/
public $typeFields;

/**
* Form object for search filters
*
* @var \Joomla\CMS\Form\Form
*/
public $filterForm;

/**
* The active search filters
*
* @var array
*/
public $activeFilters;

/**
* Display the view
*
Expand Down Expand Up @@ -218,7 +267,7 @@ protected function addToolbar()
ToolbarHelper::title(Text::_('COM_ASSOCIATIONS_TITLE_LIST_SELECT'), 'language assoc');
}

$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

if ($user->authorise('core.admin', 'com_associations') || $user->authorise('core.options', 'com_associations')) {
if (!isset($this->typeName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function addToolbar(): void
$userId = $user->id;
$isNew = ($this->item->id == 0);
$checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $userId);
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

// Since we don't track these assets at the item level, use the category id.
$canDo = ContentHelper::getActions('com_banners', 'category', $this->item->catid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Button\DropdownButton;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\BannersModel;
use Joomla\Registry\Registry;
Expand Down Expand Up @@ -142,7 +141,7 @@ protected function addToolbar(): void
{
$canDo = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id'));
$user = $this->getCurrentUser();
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_BANNERS'), 'bookmark banners');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function addToolbar(): void
$isNew = ($this->item->id == 0);
$checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id);
$canDo = $this->canDo;
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

ToolbarHelper::title(
$isNew ? Text::_('COM_BANNERS_MANAGER_CLIENT_NEW') : Text::_('COM_BANNERS_MANAGER_CLIENT_EDIT'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\ClientsModel;

Expand Down Expand Up @@ -124,7 +123,7 @@ public function display($tpl = null): void
protected function addToolbar(): void
{
$canDo = ContentHelper::getActions('com_banners');
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_CLIENTS'), 'bookmark banners-clients');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\TracksModel;

Expand Down Expand Up @@ -124,7 +123,7 @@ public function display($tpl = null): void
protected function addToolbar(): void
{
$canDo = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id'));
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Cache\Administrator\Model\CacheModel;

Expand Down Expand Up @@ -126,7 +125,7 @@ protected function addToolbar(): void
ToolbarHelper::title(Text::_('COM_CACHE_CLEAR_CACHE'), 'bolt clear');

// Get the toolbar object instance
$toolbar = Toolbar::getInstance('toolbar');
$toolbar = $this->getDocument()->getToolbar();

if (\count($this->data)) {
$toolbar->delete('delete')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ protected function batchCopy($value, $pks, $contexts)
}

// Get the new item ID
$newId = $this->table->get('id');
$newId = $this->table->id;

// Add the new ID to the array
$newIds[$pk] = $newId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Button\DropdownButton;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Filesystem\Path;

Expand Down Expand Up @@ -168,7 +167,7 @@ protected function addToolbar()
$section = $this->state->get('filter.section');
$canDo = ContentHelper::getActions($component, 'category', $categoryId);
$user = $this->getCurrentUser();
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

// Avoid nonsense situation.
if ($component == 'com_categories') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ class HtmlView extends BaseHtmlView
*/
protected $checkTags = false;

/**
* Array of fieldsets not to display
*
* @var string[]
*
* @since __DEPLOY_VERSION__
*/
public $ignore_fieldsets = [];

/**
* Display the view.
*
Expand Down Expand Up @@ -145,7 +154,7 @@ protected function addToolbar()

$user = $this->getCurrentUser();
$userId = $user->id;
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

$isNew = ($this->item->id == 0);
$checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $userId);
Expand Down Expand Up @@ -327,7 +336,7 @@ protected function addModalToolbar()
$user = $this->getCurrentUser();
$userId = $user->id;
$isNew = ($this->item->id == 0);
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

// Avoid nonsense situation.
if ($extension == 'com_categories') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

// phpcs:disable PSR1.Files.SideEffects
Expand All @@ -34,6 +33,13 @@ class HtmlView extends BaseHtmlView
*/
protected $items;

/**
* Total number of items
*
* @var integer
*/
protected $total = 0;

/**
* The pagination object
*
Expand Down Expand Up @@ -116,7 +122,7 @@ public function display($tpl = null)
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_CHECKIN_GLOBAL_CHECK_IN'), 'check-square');
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

if (!$this->isEmptyState) {
$toolbar->checkin('checkin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Config\Administrator\Helper\ConfigHelper;

Expand Down Expand Up @@ -53,6 +52,34 @@ class HtmlView extends BaseHtmlView
*/
public $data;

/**
* Title of the fieldset
*
* @var string
*/
public $name;

/**
* Name of the fields to display
*
* @var string
*/
public $fieldsname;

/**
* CSS class of the form
*
* @var string
*/
public $formclass;

/**
* Description of the fieldset
*
* @var string
*/
public $description;

/**
* Execute and display a template script.
*
Expand Down Expand Up @@ -110,7 +137,7 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
$toolbar = Toolbar::getInstance();
$toolbar = $this->getDocument()->getToolbar();

ToolbarHelper::title(Text::_('COM_CONFIG_GLOBAL_CONFIGURATION'), 'cog config');
$toolbar->apply('application.apply');
Expand Down
Loading

0 comments on commit ea5b52c

Please sign in to comment.