MDL-28990 add web service mobile overview

This commit is contained in:
Jerome Mouneyrac 2011-08-19 11:45:18 +08:00
parent 4f3632441a
commit fa698a15a8
2 changed files with 20 additions and 2 deletions

View File

@ -67,6 +67,7 @@ $string['editservice'] = 'Edit the service: {$a->name} (id: {$a->id})';
$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['missingcaps_help'] = 'List of required capabilities for the service whi
$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 File

@ -7059,10 +7059,25 @@ class admin_setting_webservicesoverview extends admin_setting {
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'),