Skip to content

Commit

Permalink
Add status page to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Feb 21, 2024
1 parent 68860d7 commit 1e94798
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions override.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
require('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');

admin_externalpage_setup('tool_heartbeat_status');

// Check if an ID is provided.
$id = optional_param('id', null, PARAM_INT);
$ref = optional_param('ref', null, PARAM_TEXT);
Expand Down
14 changes: 12 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@

if ($hassiteconfig) {

$settings = new admin_settingpage('tool_heartbeat', get_string('pluginname', 'tool_heartbeat'));
$category = new admin_category('heartbeatfolder', get_string('pluginname', 'tool_heartbeat'));
$ADMIN->add('tools', $category);

$statuspage = new admin_externalpage(
'tool_heartbeat_status',
get_string('pluginname', 'report_status'),
new moodle_url('/admin/tool/heartbeat/status.php')
);
$ADMIN->add('heartbeatfolder', $statuspage);

$settings = new admin_settingpage('tool_heartbeat', get_string('settings'));
$ADMIN->add('heartbeatfolder', $settings);

$ADMIN->add('tools', $settings);
if (!during_initial_install()) {

$options = array(
Expand Down
2 changes: 1 addition & 1 deletion status.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');

admin_externalpage_setup('reportstatus', '', null, '', ['pagelayout' => 'report']);
admin_externalpage_setup('tool_heartbeat_status', '', null, '', ['pagelayout' => 'report']);

$ref = optional_param('ref', '', PARAM_TEXT); // Show detailed info about one check only.

Expand Down

0 comments on commit 1e94798

Please sign in to comment.