Skip to content

Commit

Permalink
webservice MDL-21351 remove Save Changes button from token/service/pr…
Browse files Browse the repository at this point in the history
…otocol page, relabel some Save Changes button into more explicit label, add help text to service page
  • Loading branch information
mouneyrac committed Jan 20, 2010
1 parent 721312b commit 8399c71
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions admin/settings/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,16 @@
/// 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));
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
$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')));
Expand All @@ -268,6 +271,7 @@
/// 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')));
Expand Down
12 changes: 7 additions & 5 deletions admin/webservice/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function definition() {
$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
Expand All @@ -47,6 +48,8 @@ function definition() {
$currentcapabilityexist = true;
}



// Prepare the list of capabilites to choose from
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$allcapabilities = fetch_context_capabilities($systemcontext);
Expand All @@ -67,12 +70,11 @@ function definition() {
$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);
}
Expand Down Expand Up @@ -101,7 +103,7 @@ function definition() {
$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
Expand All @@ -124,7 +126,7 @@ function definition() {
$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);
}
Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/service_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$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'));
}
Expand Down
3 changes: 3 additions & 0 deletions lang/en_utf8/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
Expand Down Expand Up @@ -35,6 +36,7 @@
$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';
Expand Down Expand Up @@ -68,6 +70,7 @@
$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';
Expand Down

0 comments on commit 8399c71

Please sign in to comment.