aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-24 03:07:29 +0300
committerValentin Popov <info@valentineus.link>2017-10-24 03:07:29 +0300
commit2bee24931a95d0b5e0b2a95a15d2b30088ba562e (patch)
treeaad173c258ef1af6ac967caa189f0736467e651e
parent876803b844b66fb766ee0e7350a49c2bf323ce19 (diff)
downloadlocal_webhooks-2bee24931a95d0b5e0b2a95a15d2b30088ba562e.tar.xz
local_webhooks-2bee24931a95d0b5e0b2a95a15d2b30088ba562e.zip
Refactoring the settings page
-rw-r--r--settings.php27
1 files changed, 9 insertions, 18 deletions
diff --git a/settings.php b/settings.php
index d893b98..c2235c2 100644
--- a/settings.php
+++ b/settings.php
@@ -26,29 +26,20 @@ defined("MOODLE_INTERNAL") || die();
$settings = null;
if ($hassiteconfig) {
- $settings = new admin_settingpage(
- "local_webhooks",
- new lang_string("pluginname", "local_webhooks")
- );
+ $settings = new admin_settingpage("local_webhooks",
+ new lang_string("pluginname", "local_webhooks"));
$ADMIN->add("localplugins", $settings);
$settings->add(new admin_setting_configcheckbox(
"local_webhooks/enabled",
- new lang_string("enableservice", "local_webhooks"),
- new lang_string("enableservice_help", "local_webhooks"),
- false
- ));
-
- /* Title Manager */
- $settings->add(new admin_setting_heading(
- "defaultsettings",
- new lang_string("linkmanagerservice", "local_webhooks"),
- new lang_string("managementmanagerdescription", "local_webhooks")
- ));
+ new lang_string("enable", "moodle"),
+ new lang_string("enablews", "webservice"),
+ false));
/* Link to the service manager */
- $linktext = new lang_string("linkmanagerservice", "local_webhooks");
- $link = "<a href=\"" . $CFG->wwwroot . "/local/webhooks/managerservice.php\">" . $linktext . "</a>";
- $settings->add(new admin_setting_heading("local_webhooks_addheading", "", $link));
+ $linktext = new lang_string("managerservice", "local_webhooks");
+ $linkurl = new moodle_url("/local/webhooks/managerservice.php");
+ $settings->add(new admin_setting_heading("local_webhooks_managerservice", null,
+ html_writer::link($linkurl, $linktext)));
} \ No newline at end of file