Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Adding missing properties to backend component view classes #43358

Merged
merged 8 commits into from
Aug 13, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,42 @@ 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
*
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class HtmlView extends BaseHtmlView
*/
protected $items;

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

/**
* The pagination object
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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
*/
protected $formclass;

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

/**
* Execute and display a template script.
*
Expand Down
44 changes: 34 additions & 10 deletions administrator/components/com_config/src/View/Component/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,33 @@ class HtmlView extends BaseHtmlView
*/
public $component;

/**
* List of fieldset objects
*
* @var object[]
*
* @since __DEPLOY_VERSION__
*/
public $fieldsets;

/**
* Form control
*
* @var string
*
* @since __DEPLOY_VERSION__
*/
public $formControl;

/**
* Base64 encoded return URL
*
* @var string
*
* @since __DEPLOY_VERSION__
*/
public $return;

/**
* Execute and display a template script.
*
Expand All @@ -65,31 +92,28 @@ class HtmlView extends BaseHtmlView
public function display($tpl = null)
{
try {
$component = $this->get('component');
$this->component = $this->get('component');

if (!$component->enabled) {
if (!$this->component->enabled) {
return;
}

$form = $this->get('form');
$user = $this->getCurrentUser();
$this->form = $this->get('Form');
$user = $this->getCurrentUser();
} catch (\Exception $e) {
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');

return;
}

$this->fieldsets = $form ? $form->getFieldsets() : null;
$this->formControl = $form ? $form->getFormControl() : null;
$this->fieldsets = $this->form ? $this->form->getFieldsets() : null;
$this->formControl = $this->form ? $this->form->getFormControl() : null;

// Don't show permissions fieldset if not authorised.
if (!$user->authorise('core.admin', $component->option) && isset($this->fieldsets['permissions'])) {
if (!$user->authorise('core.admin', $this->component->option) && isset($this->fieldsets['permissions'])) {
unset($this->fieldsets['permissions']);
}

$this->form = &$form;
$this->component = &$component;

$this->components = ConfigHelper::getComponentsWithConfig();

$this->userIsSuperAdmin = $user->authorise('core.admin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ class HtmlView extends BaseHtmlView
*/
protected $state;

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

/**
* Display the view.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ class HtmlView extends BaseHtmlView
*/
protected $eName;

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

/**
* Execute and display a template script.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ class HtmlView extends BaseHtmlView
*/
protected $total;

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

/**
* Method to display the view.
*
Expand Down
9 changes: 9 additions & 0 deletions administrator/components/com_menus/src/View/Item/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ class HtmlView extends BaseHtmlView
*/
protected $levels;

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

/**
* Display the view
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ class HtmlView extends BaseHtmlView
*/
protected $canDo;

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

/**
* Display the view
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ class HtmlView extends BaseHtmlView
*/
protected $state;

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

/**
* Execute and display a template script.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ class HtmlView extends BaseHtmlView
*/
protected $state;

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

/**
* Display the view.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ class HtmlView extends BaseHtmlView
*/
protected $canDo;

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

/**
* Overloads the parent constructor.
* Just needed to fetch the Application object.
Expand Down
9 changes: 9 additions & 0 deletions administrator/components/com_tags/src/View/Tag/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ class HtmlView extends BaseHtmlView
*/
protected $canDo;

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

/**
* Display the view
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ class HtmlView extends BaseHtmlView
*/
protected $canDo;

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

/**
* Execute and display a template script.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ class HtmlView extends BaseHtmlView
*/
protected $state;

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

/**
* Display the view
*
Expand Down
9 changes: 9 additions & 0 deletions administrator/components/com_users/src/View/User/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ class HtmlView extends BaseHtmlView implements UserFactoryAwareInterface
*/
protected $mfaConfigurationUI;

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

/**
* Display the view
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class HtmlView extends BaseHtmlView
*/
protected $stage;

/**
* The model state
*
* @var object
*/
protected $state;

/**
* The HTML for displaying sidebar
*
Expand Down
Loading