$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)) {
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;
* @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();
-/* 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)
* @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);
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;
* @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);
$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);
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;
// 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();
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
$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
// 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);
// 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);
* @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();
$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();
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();
/// 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">
$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 = "";
}
//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;
$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');
$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);