From 2bee24931a95d0b5e0b2a95a15d2b30088ba562e Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 24 Oct 2017 04:07:29 +0400 Subject: Refactoring the settings page --- settings.php | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'settings.php') 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 = "wwwroot . "/local/webhooks/managerservice.php\">" . $linktext . ""; - $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 -- cgit v1.2.3