Skip to content

Commit

Permalink
Separate out admin-only links in the settings page.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Jan 6, 2025
1 parent 8cae594 commit 48104f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require_once(__DIR__ . '/stack/options.class.php');
require_once(__DIR__ . '/stack/prt.class.php');

// Useful links.
// Useful links in the adminui.
$links = [
get_string('stackDoc_docs_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/doc/doc.php/')]),
Expand All @@ -46,14 +46,19 @@
['link' => (string) new moodle_url('/question/type/stack/adminui/answertests.php')]),
get_string('stackInstall_input_title_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/studentinputs.php')]),
// The healthcheck is not part of the adminui collection as it's only for plugin admins.
];

// These links are only for plugin admins, e.g. the healthcheck. They are not part of the adminui collection.
$link = '* ' . implode("\n* ", $links);
$link .= "\n***\n";
$links = [
get_string('healthcheck_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/healthcheck.php')]),
['link' => (string) new moodle_url('/question/type/stack/adminui/healthcheck.php')])
];
$link .= '* ' . implode("\n* ", $links);

$settings->add(new admin_setting_heading('docs',
get_string('settingusefullinks', 'qtype_stack'),
'* ' . implode("\n* ", $links)));
get_string('settingusefullinks', 'qtype_stack'), $link));

// Options for connection to Maxima.
// Note that any settings here where we try to set the default
Expand Down

0 comments on commit 48104f5

Please sign in to comment.