Fix code styling issue

This commit is contained in:
Yonas Habteab 2022-04-13 19:47:06 +02:00
parent d859522c31
commit cba8fbdd1c
2 changed files with 14 additions and 10 deletions

View File

@ -20,7 +20,7 @@ abstract class BaseSetupDashboard extends BaseDashboardForm
*
* @var array
*/
static protected $moduleDashlets = [];
protected static $moduleDashlets = [];
protected $duplicateCustomDashlet = false;
@ -64,7 +64,10 @@ abstract class BaseSetupDashboard extends BaseDashboardForm
}
if (isset($choosenDashlets[$module]) && ! $this->duplicateCustomDashlet) {
$this->duplicateCustomDashlet = array_key_exists($this->getPopulatedValue('dashlet'), $choosenDashlets[$module]);
$this->duplicateCustomDashlet = array_key_exists(
$this->getPopulatedValue('dashlet'),
$choosenDashlets[$module]
);
}
}
@ -125,7 +128,8 @@ abstract class BaseSetupDashboard extends BaseDashboardForm
foreach ($dashlets as $dashlet) {
$multi = new DashletListMultiSelect($dashlet);
$multi->setCheckBox($this->createElement(
'checkbox', $module . '|' . $dashlet->getName(),
'checkbox',
$module . '|' . $dashlet->getName(),
['class' => 'sr-only']
));
@ -146,7 +150,7 @@ abstract class BaseSetupDashboard extends BaseDashboardForm
$this->addElement('text', 'pane', [
'required' => true,
'label' => t('Dashboard Title'),
'description' => t('Enter a title for the new dashboard you want to add the dashlets to'),
'description' => t('Enter a title for the new dashboard you want to add the dashlets to')
]);
}
@ -162,7 +166,7 @@ abstract class BaseSetupDashboard extends BaseDashboardForm
$this->assembleDashletElements();
}
if (! empty(self::$moduleDashlets)) {
if (! empty(self::$moduleDashlets)) {
foreach (self::$moduleDashlets as $module => $dashlets) {
/** @var Dashlet $dashlet */
foreach ($dashlets as $dashlet) {

View File

@ -59,11 +59,11 @@ class DashletForm extends BaseSetupDashboard
$this->addElement('hidden', 'org_home', ['required' => false]);
$this->addElement('hidden', 'org_dashlet', ['required' => false]);
if ($this->isUpdatingADashlet()) {
$this->assembleDashletElements();
if ($this->isUpdatingADashlet()) {
$this->assembleDashletElements();
$this->addHtml(new HtmlElement('hr'));
}
$this->addHtml(new HtmlElement('hr'));
}
$this->addElement('select', 'home', [
'class' => 'autosubmit',
@ -72,7 +72,7 @@ class DashletForm extends BaseSetupDashboard
'value' => $populatedHome,
'multiOptions' => array_merge([self::CREATE_NEW_HOME => self::CREATE_NEW_HOME], $homes),
'label' => t('Select Home'),
'description' => t('Select a dashboard home you want to add the dashboard pane to.')
'description' => t('Select a dashboard home you want to add the dashboard pane to.')
]);
if (empty($homes) || $populatedHome === self::CREATE_NEW_HOME) {