Skip to content

Commit

Permalink
Make codechecker happy
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Sep 19, 2024
1 parent 23cd36d commit d7d6845
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
4 changes: 1 addition & 3 deletions classes/admin_externalpage_in_tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace theme_boost_union;

/**
* Theme Boost Union - External admin settings page which can be placed within a tab
*
Expand All @@ -24,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();
namespace theme_boost_union;

/**
* Class admin_externalpage_in_tab.
Expand Down
14 changes: 6 additions & 8 deletions classes/admin_externalpage_tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace theme_boost_union;

use moodle_url;
use tabobject;
use tabtree;

/**
* Theme Boost Union - Tabs to be shown within an external admin settings page
*
Expand All @@ -28,7 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();
namespace theme_boost_union;

use moodle_url;
use tabobject;
use tabtree;

/**
* Class admin_externalpage_tabs.
Expand All @@ -50,7 +48,7 @@ class admin_externalpage_tabs {
*
* @return void
*/
public function _construct() {
public function __construct() {
// Initialize the tab tree.
$this->tabs = [];
}
Expand Down
11 changes: 5 additions & 6 deletions classes/admin_settingspage_tabs_with_external.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace theme_boost_union;

/**
* Theme Boost Union - Admin settings page with tabs as well as external pages within a tab
*
Expand All @@ -25,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();
namespace theme_boost_union;

/**
* Class admin_settingspage_tabs_with_external.
Expand All @@ -44,6 +42,7 @@ class admin_settingspage_tabs_with_external extends \theme_boost_admin_settingsp
* This function is amended with a switch for the external tabs.
*
* @param $tab object A tab.
* @return bool
*/
public function add($tab) {
// If the tab is an external page, add it as external tab.
Expand Down Expand Up @@ -77,7 +76,7 @@ public function output_html() {
global $OUTPUT;

$activetab = optional_param('activetab', '', PARAM_TEXT);
$context = array('tabs' => array());
$context = ['tabs' => []];
$havesetactive = false;

foreach ($this->get_tabs() as $tab) {
Expand All @@ -91,12 +90,12 @@ public function output_html() {
$active = true;
}

$newtab = array(
$newtab = [
'name' => $tab->name,
'displayname' => $tab->visiblename,
'html' => $tab->output_html(),
'active' => $active,
);
];
// If the tab is an external page.
if ($tab instanceof \admin_externalpage) {
// Add a flag for the mustache template.
Expand Down

0 comments on commit d7d6845

Please sign in to comment.