webservice MDL-21351 remove Save Changes button from token/service/protocol page, relabel some Save Changes button into more explicit label, add help text to service page
This commit is contained in:
@@ -239,6 +239,8 @@ if ($hassiteconfig) {
|
||||
/// Web services
|
||||
$ADMIN->add('modules', new admin_category('webservicesettings', get_string('webservices', 'webservice')));
|
||||
$temp = new admin_settingpage('externalservices', get_string('externalservices', 'webservice'));
|
||||
$temp->hidesavebutton();
|
||||
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', get_string('information', 'webservice'), get_string('servicehelpexplanation', 'webservice')));
|
||||
$temp->add(new admin_setting_manageexternalservices());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('externalservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
@@ -246,6 +248,7 @@ if ($hassiteconfig) {
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
/// manage protocol page link
|
||||
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
|
||||
$temp->hidesavebutton();
|
||||
$temp->add(new admin_setting_managewebserviceprotocols());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
@@ -268,6 +271,7 @@ if ($hassiteconfig) {
|
||||
/// manage token page link
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', get_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webservicetokens', get_string('managetokens', 'webservice'));
|
||||
$temp->hidesavebutton();
|
||||
$temp->add(new admin_setting_managewebservicetokens());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
$temp->add(new admin_setting_heading('webservicesaredisabled', '', get_string('disabledwarning', 'webservice')));
|
||||
|
||||
@@ -37,6 +37,7 @@ class external_service_form extends moodleform {
|
||||
$mform->addElement('text', 'name', get_string('name'));
|
||||
$mform->addRule('name', get_string('required'), 'required', null, 'client');
|
||||
$mform->addElement('advcheckbox', 'enabled', get_string('enabled', 'webservice'));
|
||||
$mform->addElement('advcheckbox', 'restrictedusers', get_string('restrictedusers', 'webservice'));
|
||||
|
||||
|
||||
/// needed to select automatically the 'No required capability" option
|
||||
@@ -47,6 +48,8 @@ class external_service_form extends moodleform {
|
||||
$currentcapabilityexist = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Prepare the list of capabilites to choose from
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$allcapabilities = fetch_context_capabilities($systemcontext);
|
||||
@@ -67,12 +70,11 @@ class external_service_form extends moodleform {
|
||||
$mform->addElement('static', 'capabilityerror', '', $OUTPUT->notification(get_string('selectedcapabilitydoesntexit','webservice', $service->requiredcapability)));
|
||||
$service->requiredcapability = "norequiredcapability";
|
||||
}
|
||||
$mform->addElement('advcheckbox', 'restrictedusers', get_string('restrictedusers', 'webservice'));
|
||||
|
||||
|
||||
$mform->addElement('hidden', 'id');
|
||||
$mform->setType('id', PARAM_INT);
|
||||
|
||||
$this->add_action_buttons(true);
|
||||
$this->add_action_buttons(true, get_string('addaservice', 'webservice'));
|
||||
|
||||
$this->set_data($service);
|
||||
}
|
||||
@@ -101,7 +103,7 @@ class external_service_functions_form extends moodleform {
|
||||
$mform = $this->_form;
|
||||
$data = $this->_customdata;
|
||||
|
||||
$mform->addElement('header', 'addfunction', get_string('addfunction', 'webservice'));
|
||||
$mform->addElement('header', 'addfunction', get_string('addfunctions', 'webservice'));
|
||||
|
||||
$select = "name NOT IN (SELECT s.functionname
|
||||
FROM {external_services_functions} s
|
||||
@@ -124,7 +126,7 @@ class external_service_functions_form extends moodleform {
|
||||
$mform->addElement('hidden', 'action');
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
|
||||
$this->add_action_buttons(true);
|
||||
$this->add_action_buttons(true, get_string('addfunctions', 'webservice'));
|
||||
|
||||
$this->set_data($data);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ $PAGE->navbar->add(get_string('webservices', 'webservice'));
|
||||
$PAGE->navbar->add(get_string('externalservices', 'webservice'), new moodle_url('/admin/settings.php?section=externalservices'));
|
||||
$PAGE->navbar->add(get_string('functions', 'webservice'), new moodle_url('/admin/webservice/service_functions.php?id='.$id));
|
||||
if ($action == "add") {
|
||||
$PAGE->navbar->add(get_string('addfunction', 'webservice'));
|
||||
$PAGE->navbar->add(get_string('addfunctions', 'webservice'));
|
||||
} else if ($action == "delete") {
|
||||
$PAGE->navbar->add(get_string('removefunction', 'webservice'));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
$string['accessexception'] = 'Access control exception';
|
||||
$string['activatehttps'] = '******************';
|
||||
$string['addfunction'] = 'Add function';
|
||||
$string['addfunctions'] = 'Add functions';
|
||||
$string['addfunctionhelp'] = 'Select the function to add to the service.';
|
||||
$string['addrequiredcapability'] = 'Assign/Unassign the required capability';
|
||||
$string['addservice'] = 'Add a new service: $a->name (id: $a->id)';
|
||||
@@ -35,6 +36,7 @@ $string['function'] = 'Function';
|
||||
$string['functions'] = 'Functions';
|
||||
$string['generalstructure'] = 'General structure';
|
||||
$string['httpswarning'] = 'Token strings are only displayed if your connection is secured (https)';
|
||||
$string['information'] = 'Information';
|
||||
$string['invalidiptoken'] = 'Invalid token - your IP is not supported';
|
||||
$string['invalidtimedtoken'] = 'Invalid token - token expired';
|
||||
$string['invalidtoken'] = 'Invalid token - token not found';
|
||||
@@ -68,6 +70,7 @@ $string['securitykeys'] = 'Security keys';
|
||||
$string['selectedcapabilitydoesntexit'] = 'The currently set required capability ($a) doesn\'t exist anymore. Please change it and save the changes.';
|
||||
$string['selectedcapability'] = 'Selected';
|
||||
$string['service'] = 'Service';
|
||||
$string['servicehelpexplanation'] = 'A service is a set of functions. A service can be accessed by all users or some specified users. <strong>Custom services</strong> are service that you created. <strong>Default services</strong> are service that were added by default to Moodle. You can not change functions from a <strong>Default service</strong>.';
|
||||
$string['servicename'] = 'Service name';
|
||||
$string['servicesbuiltin'] = 'Built-in services';
|
||||
$string['servicescustom'] = 'Custom services';
|
||||
|
||||
Reference in New Issue
Block a user