Permalink
Browse files

MDL-28990 add web service mobile overview

  • Loading branch information...
1 parent 4f36324 commit fa698a15a8ea0e5c4cb8f65759dd0798451e56c5 @mouneyrac mouneyrac committed Aug 19, 2011
Showing with 20 additions and 2 deletions.
  1. +3 −0 lang/en/webservice.php
  2. +17 −2 lib/adminlib.php
View
@@ -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.';
View
@@ -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'),

0 comments on commit fa698a1

Please sign in to comment.