webservice MDL-17135 fix navigation (kudo to Sam) + trivial few changes

This commit is contained in:
jerome 2009-10-20 06:34:46 +00:00
parent 8140c44094
commit 4955481bf3
3 changed files with 21 additions and 9 deletions

View File

@ -71,7 +71,8 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
$alloweduserselector->invalidate_selected_users();
}
}
/// Print the form.
check_theme_arrows();
/// display the UI
?>
@ -112,11 +113,16 @@ if (optional_param('updateuser', false, PARAM_BOOL) && confirm_sesskey()) {
$frommonth = optional_param('frommonth', '', PARAM_INT);
$fromyear = optional_param('fromyear', '', PARAM_INT);
$addcap = optional_param('addcap', false, PARAM_INT);
$enablevaliduntil = optional_param('enablevaliduntil', false, PARAM_INT);
$validuntil = mktime(23, 59, 59, $frommonth, $fromday, $fromyear);
$serviceuser = new object();
$serviceuser->id = $serviceuserid;
$serviceuser->validuntil = $validuntil;
if ($enablevaliduntil) {
$serviceuser->validuntil = $validuntil;
} else {
$serviceuser->validuntil = null; //the valid until field is disabled, we reset the value
}
$serviceuser->iprestriction = $iprestriction;
$DB->update_record('external_services_users', $serviceuser);
@ -137,7 +143,7 @@ if (!empty($allowedusers)) {
echo $OUTPUT->box_start('generalbox', 'alloweduserlist');
echo "<label><strong>".get_string('serviceuserssettings', 'webservice').":</strong></label>";
echo "<br/><br/><span style=\"font-size:90%\">"; //reduce font of the user settings
echo "<br/><br/><span style=\"font-size:85%\">"; //reduce font of the user settings
foreach($allowedusers as $user) {
echo "<strong>";
@ -167,7 +173,13 @@ if (!empty($allowedusers)) {
$selectors = html_select::make_time_selectors(array('days' => 'fromday','months' => 'frommonth', 'years' => 'fromyear'),$user->validuntil);
foreach ($selectors as $select) {
$contents .= $OUTPUT->select($select);
}
} $checkbox = new html_select_option();
$checkbox->value = 1;
$checkbox->selected = empty($user->validuntil)?false:true;
$checkbox->text = get_string('enabled', 'webservice');
$checkbox->label->text = get_string('enabled', 'webservice');
$checkbox->alt = get_string('enabled', 'webservice');
$contents .= $OUTPUT->checkbox($checkbox, 'enablevaliduntil');
$contents .= "</div></div>";
//TO IMPLEMENT : assign the required capability (if needed)
$contents .= "<div class=\"fitem\"><div class=\"fitemtitle\"><label>".get_string('addrequiredcapability','webservice')." </label></div><div class=\"felement fcheckbox\">";

View File

@ -242,9 +242,9 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
$temp = new admin_settingpage('externalservices', get_string('externalservices', '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/external_service.php"), 'moodle/site:config', true);
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_functions.php"), 'moodle/site:config', true);
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_users.php"), 'moodle/site:config', true);
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('externalservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_functions.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_users.php", 'moodle/site:config', true));
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
$temp->add(new admin_setting_managewebserviceprotocols());
if (empty($CFG->enablewebservices)) {

View File

@ -6196,7 +6196,7 @@ class admin_setting_manageexternalservices extends admin_setting {
if ($service->restrictedusers) {
$users = "<a href=\"$euurl?id=$service->id\">$strusers</a>";
} else {
$users = '-';
$users = get_string('nouserrestriction','webservice');
}
$edit = "<a href=\"$esurl?id=$service->id\">$stredit</a>";
@ -6236,7 +6236,7 @@ class admin_setting_manageexternalservices extends admin_setting {
if ($service->restrictedusers) {
$users = "<a href=\"$euurl?id=$service->id\">$strusers</a>";
} else {
$users = '-';
$users = get_string('nouserrestriction','webservice');
}
$edit = "<a href=\"$esurl?id=$service->id\">$stredit</a>";