From fc218ba9e2879ad15eee2f909d14cb5c038c2e51 Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Fri, 19 Aug 2011 11:45:18 +0800 Subject: [PATCH] MDL-28990 add web service mobile overview --- lang/en/webservice.php | 3 +++ lib/adminlib.php | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lang/en/webservice.php b/lang/en/webservice.php index 5d0690e082d95..dec65ad57f73d 100644 --- a/lang/en/webservice.php +++ b/lang/en/webservice.php @@ -67,6 +67,7 @@ $string['enabled'] = 'Enabled'; $string['enabledocumentation'] = 'Enable developer documentation'; $string['enabledocumentationdescription'] = 'Detailed web services documentation is available for enabled protocols.'; +$string['enablemobilewsoverview'] = 'Go to {$a->manageservicelink} administration page, check the "{$a->enablemobileservice}" setting and Save. Everything will be setup for you and all site\'s users will be able to use the offical Moodle app. Current status: {$a->wsmobilestatus}'; $string['enableprotocols'] = 'Enable protocols'; $string['enableprotocolsdescription'] = 'At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.'; $string['enablews'] = 'Enable web services'; @@ -120,6 +121,8 @@ $string['missingpassword'] = 'Missing password'; $string['missingusername'] = 'Missing username'; $string['missingversionfile'] = 'Coding error: version.php file is missing for the component {$a}'; +$string['mobilewsdisabled'] = 'Disabled'; +$string['mobilewsenabled'] = 'Enabled'; $string['nofunctions'] = 'This service has no functions.'; $string['norequiredcapability'] = 'No required capability'; $string['notoken'] = 'The token list is empty.'; diff --git a/lib/adminlib.php b/lib/adminlib.php index cf21bcf898ae2..20d527968fcff 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -7059,10 +7059,25 @@ public function output_html($data, $query='') { global $CFG, $OUTPUT; $return = ""; - - /// One system controlling Moodle with Token $brtag = html_writer::empty_tag('br'); + // Enable mobile web service + $enablemobile = new admin_setting_enablemobileservice('enablemobilewebservice', + get_string('enablemobilewebservice', 'admin'), + get_string('configenablemobilewebservice', + 'admin', ''), 0); //we don't want to display it but to know the ws mobile status + $manageserviceurl = new moodle_url("/admin/settings.php?section=externalservices"); + $wsmobileparam = new stdClass(); + $wsmobileparam->enablemobileservice = get_string('enablemobilewebservice', 'admin'); + $wsmobileparam->manageservicelink = html_writer::link($manageserviceurl, + get_string('externalservices', 'webservice')); + $mobilestatus = $enablemobile->get_setting()?get_string('mobilewsenabled', 'webservice'):get_string('mobilewsdisabled', 'webservice'); + $wsmobileparam->wsmobilestatus = html_writer::tag('strong', $mobilestatus); + $return .= $OUTPUT->heading(get_string('enablemobilewebservice', 'admin'), 3, 'main'); + $return .= $brtag . get_string('enablemobilewsoverview', 'webservice', $wsmobileparam) + . $brtag . $brtag; + + /// One system controlling Moodle with Token $return .= $OUTPUT->heading(get_string('onesystemcontrolling', 'webservice'), 3, 'main'); $table = new html_table(); $table->head = array(get_string('step', 'webservice'), get_string('status'),