From 1429d4aa65bed9321eb9a5f20b86c40730a7ad9a Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 13 Apr 2022 19:47:06 +0200 Subject: [PATCH] Fix code styling issue --- application/forms/Dashboard/BaseSetupDashboard.php | 14 +++++++++----- application/forms/Dashboard/DashletForm.php | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/application/forms/Dashboard/BaseSetupDashboard.php b/application/forms/Dashboard/BaseSetupDashboard.php index 4ff3b0ee6..7ef78584a 100644 --- a/application/forms/Dashboard/BaseSetupDashboard.php +++ b/application/forms/Dashboard/BaseSetupDashboard.php @@ -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) { diff --git a/application/forms/Dashboard/DashletForm.php b/application/forms/Dashboard/DashletForm.php index 5032ca250..caf1ed36b 100644 --- a/application/forms/Dashboard/DashletForm.php +++ b/application/forms/Dashboard/DashletForm.php @@ -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) {