]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17135 moving all webservice and external API related admin UI to new directory...
authorskodak <skodak>
Wed, 21 Oct 2009 19:58:50 +0000 (19:58 +0000)
committerskodak <skodak>
Wed, 21 Oct 2009 19:58:50 +0000 (19:58 +0000)
admin/settings/plugins.php
admin/webservice/forms.php [moved from admin/external_forms.php with 100% similarity]
admin/webservice/lib.php
admin/webservice/protocols.php [moved from admin/webservice_protocols.php with 96% similarity]
admin/webservice/script.js
admin/webservice/service.php [moved from admin/external_service.php with 90% similarity]
admin/webservice/service_functions.php [moved from admin/external_service_functions.php with 88% similarity]
admin/webservice/service_users.php [moved from admin/external_service_users.php with 92% similarity]
lib/adminlib.php

index 93736cc07ea5de263e29b748a8668b0efd06058a..98e9359411d1d1963030e171ba4044a6b6474688 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/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));
     $temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
     $temp->add(new admin_setting_managewebserviceprotocols());
     if (empty($CFG->enablewebservices)) {
index 84da28d2f975a61ca87ef683b39e86ecf405a7e1..2f9365f62cc1c6d33624c4d7f1ab45cba12ce9f5 100644 (file)
@@ -118,7 +118,7 @@ class service_user_selector extends user_selector_base {
     protected function get_options() {
         global $CFG;
         $options = parent::get_options();
-        $options['file'] = '/admin/webservice/lib.php'; //need to be set, otherwise
+        $options['file'] = $CFG->admin.'/webservice/lib.php'; //need to be set, otherwise
                                                         // the /user/selector/search.php
                                                         //will fail to find this user_selector class
         $options['serviceid'] = $this->serviceid;
similarity index 96%
rename from admin/webservice_protocols.php
rename to admin/webservice/protocols.php
index e1b7abab81cb5a0d4e728c4b118261085b25bced..5f296b69e8e8131f38ec33dd4ded49badc4ce063 100644 (file)
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once('../config.php');
+require_once('../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->libdir.'/tablelib.php');
 
-$PAGE->set_url('admin/webservice_protocols.php', array());
+$PAGE->set_url('/admin/webservice/protocols.php', array());
 //TODO: disable the blocks here or better make the page layout default to no blocks!
 
 require_login();
index 35a28abc97ed63f00c6d0567bc45cd4c5dbca1d9..8db3c012e622385b92baf6b6dc7af87bd7ccdb56 100644 (file)
@@ -1,5 +1,5 @@
 
-/* This function disable the valid until field of a user into external_service_users.php*/
+/* This function disable the valid until field of a user into service_users.php*/
 function disablevaliduntil(event, userid) {
    var disabled;
    if (document.getElementById('enablevaliduntil'+userid).checked)
similarity index 90%
rename from admin/external_service.php
rename to admin/webservice/service.php
index 089ef3fada9051a870751843fbb7b2b242713303..94948f266850cc35b4fb064ca9518d3d487b2860 100644 (file)
@@ -23,9 +23,9 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once('../config.php');
+require_once('../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
-require_once('external_forms.php');
+require_once('forms.php');
 
 $id      = required_param('id', PARAM_INT);
 $action  = optional_param('action', '', PARAM_ACTION);
@@ -48,8 +48,8 @@ if ($action == 'delete' and confirm_sesskey() and $service and empty($service->c
         admin_externalpage_print_header();
         $optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey());
         $optionsno  = array('section'=>'externalservices');
-        $formcontinue = html_form::make_button('external_service.php', $optionsyes, get_string('delete'), 'post');
-        $formcancel = html_form::make_button('settings.php', $optionsno, get_string('cancel'), 'get');
+        $formcontinue = html_form::make_button('service.php', $optionsyes, get_string('delete'), 'post');
+        $formcancel = html_form::make_button("$CFG->wwwroot/$CFG->admin/settings.php", $optionsno, get_string('cancel'), 'get');
         echo $OUTPUT->confirm(get_string('deleteserviceconfirm', 'webservice', $service->name), $formcontinue, $formcancel);
         echo $OUTPUT->footer();
         die;
similarity index 88%
rename from admin/external_service_functions.php
rename to admin/webservice/service_functions.php
index 7a20b72d53a8552733730d7380c76c9dff3c9a5c..e37c644e052b084c395e6da9eaf326d954139df9 100644 (file)
@@ -23,7 +23,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once('../config.php');
+require_once('../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 $id      = required_param('id', PARAM_INT);
@@ -31,12 +31,12 @@ $fid     = optional_param('fid', 0, PARAM_INT);
 $action  = optional_param('action', '', PARAM_ACTION);
 $confirm = optional_param('confirm', 0, PARAM_BOOL);
 
-$PAGE->set_url('admin/external_service_functions.php', array('id'=>$id));
+$PAGE->set_url('admin/websevice/service_functions.php', array('id'=>$id));
 
 admin_externalpage_setup('externalservicefunctions');
 
 $returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=externalservices";
-$thisurl   = "external_service_functions.php?id=$id";
+$thisurl   = "service_functions.php?id=$id";
 
 $service = $DB->get_record('external_services', array('id'=>$id), '*', MUST_EXIST);
 
@@ -46,8 +46,8 @@ if ($action === 'delete' and confirm_sesskey() and $service and empty($service->
         admin_externalpage_print_header();
         $optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey(), 'fid'=>$function->id);
         $optionsno  = array('id'=>$id);
-        $formcontinue = html_form::make_button('external_service_functions.php', $optionsyes, get_string('delete'), 'post');
-        $formcancel = html_form::make_button('external_service_functions.php', $optionsno, get_string('cancel'), 'get');
+        $formcontinue = html_form::make_button('service_functions.php', $optionsyes, get_string('delete'), 'post');
+        $formcancel = html_form::make_button('service_functions.php', $optionsno, get_string('cancel'), 'get');
         echo $OUTPUT->confirm(get_string('removefunctionconfirm', 'webservice', (object)array('service'=>$service->name, 'function'=>$function->name)), $formcontinue, $formcancel);
         echo $OUTPUT->footer();
         die;
@@ -94,7 +94,7 @@ else if ($action === 'add') {
 
     // Javascript for the function search/selection fields
     $PAGE->requires->yui_lib('event');
-    $PAGE->requires->js('admin/webservice/script.js');
+    $PAGE->requires->js($CFG->admin.'/webservice/script.js');
     $PAGE->requires->js_function_call('capability_service.cap_filter_init', array(get_string('search'))); //TODO generalize javascript
 
     admin_externalpage_print_header();
@@ -105,7 +105,7 @@ else if ($action === 'add') {
      echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter centerpara');
     //the service form
     $form = new html_form();
-    $form->url = new moodle_url('/admin/external_service_functions.php', array('id' => $id, 'action' => 'add', 'save' => 1)); // Required
+    $form->url = new moodle_url('service_functions.php', array('id' => $id, 'action' => 'add', 'save' => 1)); // Required
     $form->button = new html_button();
     $form->button->id = 'settingssubmit';
     $form->button->text = get_string('addfunction', 'webservice'); // Required
@@ -161,7 +161,7 @@ if (empty($service->component)) {
     $table->align[] = 'center';
 }
 
-$durl = "$CFG->wwwroot/$CFG->admin/external_service_functions.php?sesskey=".sesskey();
+$durl = "service_functions.php?sesskey=".sesskey();
 
 foreach ($functions as $function) {
     //TODO: manage when the description is into a module/plugin lang file
@@ -180,7 +180,7 @@ echo $OUTPUT->table($table);
 // we can edit only custom functions, the build-in would be overridden after each upgrade
 if (empty($service->component)) {
     $form = new html_form();
-    $form->url = new moodle_url('external_service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
+    $form->url = new moodle_url('service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
     $form->button->text = get_string('add');
     $form->method = 'get';
     echo $OUTPUT->button($form);
@@ -188,7 +188,7 @@ if (empty($service->component)) {
 
 // simple back button
 $form = new html_form();
-$form->url = new moodle_url('settings.php', array('section'=>'externalservices'));
+$form->url = new moodle_url('../settings.php', array('section'=>'externalservices'));
 $form->button->text = get_string('back');
 $form->method = 'get';
 echo $OUTPUT->button($form);
similarity index 92%
rename from admin/external_service_users.php
rename to admin/webservice/service_users.php
index 88ec21252a2746ff21c33117a81b8c10cc378866..02877932712aa7ca655e20d0c4faab2b4a09ab02 100644 (file)
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require_once('../config.php');
+require_once('../../config.php');
 require_once($CFG->libdir.'/adminlib.php');
 require_once($CFG->dirroot.'/admin/webservice/lib.php');
 
 $id = required_param('id', PARAM_INT);
 
-$PAGE->set_url('admin/external_service_users.php', array('id'=>$id));
-$PAGE->requires->js('admin/webservice/script.js');
+$PAGE->set_url('admin/webservice/service_users.php', array('id'=>$id));
+$PAGE->requires->js($CFG->admin.'/webservice/script.js');
 
 admin_externalpage_setup('externalserviceusers');
 admin_externalpage_print_header();
@@ -50,7 +50,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
                     $serviceuser->userid = $adduser->id;
                     $serviceuser->timecreated = mktime();
                     $DB->insert_record('external_services_users', $serviceuser);
-                    add_to_log(1, 'core', 'assign', 'admin/external_service_users.php?id='.$id, 'add', '', $adduser->id);
+                    add_to_log(1, 'core', 'assign', $CFG->admin.'/webservice/service_users.php?id='.$id, 'add', '', $adduser->id);
                 }
 
                 $potentialuserselector->invalidate_selected_users();
@@ -65,7 +65,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
 
                 foreach ($userstoremove as $removeuser) {             
                     $DB->delete_records('external_services_users', array('externalserviceid' => $id, 'userid' => $removeuser->id));
-                    add_to_log(1, 'core', 'assign', 'admin/external_service_users.php?id='.$id, 'remove', '', $removeuser->id);
+                    add_to_log(1, 'core', 'assign', $CFG->admin.'/webservice/service_users.php?id='.$id, 'remove', '', $removeuser->id);
                 }
 
                 $potentialuserselector->invalidate_selected_users();
@@ -77,7 +77,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
 
 /// display the UI
 ?>
-<form id="assignform" method="post" action="external_service_users.php?id=<?php echo $id ?>"><div>
+<form id="assignform" method="post" action="service_users.php?id=<?php echo $id ?>"><div>
   <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
 
   <table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
@@ -117,8 +117,7 @@ if (optional_param('updateuser', false, PARAM_BOOL) && confirm_sesskey()) {
     $enablevaliduntil = optional_param('enablevaliduntil', false, PARAM_INT);
     if (!empty($fromday) && !empty($frommonth) && !empty($fromyear)) {
         $validuntil = mktime(23, 59, 59, $frommonth, $fromday, $fromyear);
-    }
-    else {
+    } else {
         $validuntil = "";
     }
 
@@ -159,7 +158,7 @@ if (!empty($allowedusers)) {
         //user settings form
         $contents = "<div class=\"fcontainer clearfix\">";
         $form = new html_form();
-        $form->url = new moodle_url('/admin/external_service_users.php', array('id' => $id, 'userid' => $user->id, 'updateuser' => 1, 'serviceuserid' => $user->serviceuserid)); // Required
+        $form->url = new moodle_url('service_users.php', array('id' => $id, 'userid' => $user->id, 'updateuser' => 1, 'serviceuserid' => $user->serviceuserid)); // Required
         $form->button = new html_button();
         $form->button->text = get_string('update'); // Required
         $form->button->disabled = false;
index 974dbd44c8ec1e8bec348c985ebb0f432b2949a0..654be2d43e8d11116152dc3821af6836c5b61e0f 100644 (file)
@@ -6163,9 +6163,9 @@ class admin_setting_manageexternalservices extends admin_setting {
         $strusers = get_string('restrictedusers', 'webservice');
         $strserviceusers = get_string('serviceusers', 'webservice');
 
-        $esurl = "$CFG->wwwroot/$CFG->admin/external_service.php";
-        $efurl = "$CFG->wwwroot/$CFG->admin/external_service_functions.php";
-        $euurl = "$CFG->wwwroot/$CFG->admin/external_service_users.php";
+        $esurl = "$CFG->wwwroot/$CFG->admin/webservice/service.php";
+        $efurl = "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php";
+        $euurl = "$CFG->wwwroot/$CFG->admin/webservice/service_users.php";
 
         // built in services
         $return = $OUTPUT->heading(get_string('servicesbuiltin', 'webservice'), 3, 'main');
@@ -6362,7 +6362,7 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
         $table->data  = array();
 
         // iterate through auth plugins and add to the display table
-        $url = "$CFG->wwwroot/$CFG->admin/webservice_protocols.php?sesskey=" . sesskey();
+        $url = "$CFG->wwwroot/$CFG->admin/webservice/protocols.php?sesskey=" . sesskey();
         foreach ($protocols_available as $protocol => $location) {
             $name = get_string('pluginname', 'webservice_'.$protocol);