]> git.mjollnir.org Git - moodle.git/commitdiff
webservice MDL-17135 fix navigation (kudo to Sam) + trivial few changes
authorjerome <jerome>
Tue, 20 Oct 2009 06:34:46 +0000 (06:34 +0000)
committerjerome <jerome>
Tue, 20 Oct 2009 06:34:46 +0000 (06:34 +0000)
admin/external_service_users.php
admin/settings/plugins.php
lib/adminlib.php

index 17ac8753951029ec21eb4547683ee305dd01932b..595a206be8245ec6af1486288b92e61e73df7e65 100644 (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\">";
index 0fd5a1c7f6ea57283daa57f47d0087021178716f..93736cc07ea5de263e29b748a8668b0efd06058a 100644 (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)) {
index 21b08debba2ee11d9601dd5bcd7b9b10b6771f17..0e58ff7adb29128956f9c844e8450b1d5746fadf 100644 (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>";