Skip to content

Commit

Permalink
community block/registration/publication MDL-24230 change /admin/ for…
Browse files Browse the repository at this point in the history
… $CFG->admin and /lib/ for $CFG->libdir
  • Loading branch information
mouneyrac committed Sep 24, 2010
1 parent 3ced70f commit a8e174c
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion admin/registration/confirmregistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

if (!extension_loaded('xmlrpc')) {
//display notice about xmlrpc
$xmlrpcnotification = $OUTPUT->doc_link('admin/environment/php_extension/xmlrpc', '');
$xmlrpcnotification = $OUTPUT->doc_link($CFG->admin . '/environment/php_extension/xmlrpc', '');
$xmlrpcnotification .= get_string('xmlrpcdisabledregistration', 'hub');
echo $OUTPUT->notification($xmlrpcnotification);
}
Expand Down
4 changes: 2 additions & 2 deletions admin/registration/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
*/


require_once($CFG->dirroot . '/lib/formslib.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');

/**
* This form display a unregistration form.
Expand Down
4 changes: 2 additions & 2 deletions admin/registration/hubselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require('../../config.php');

require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/admin/registration/forms.php');
require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/forms.php');

admin_externalpage_setup('registrationselector');

Expand All @@ -55,7 +55,7 @@
$hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
$params = array('sesskey' => sesskey(), 'huburl' => $huburl,
'password' => $password, 'hubname' => $hubname);
redirect(new moodle_url($CFG->wwwroot."/admin/registration/register.php",
redirect(new moodle_url($CFG->wwwroot."/" . $CFG->admin . "/registration/register.php",
$params));
}

Expand Down
6 changes: 3 additions & 3 deletions admin/registration/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
require('../../config.php');

require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/admin/registration/forms.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/course/publish/lib.php');
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");

Expand Down Expand Up @@ -155,7 +155,7 @@
echo $renderer->registeredonhublisting($hubs);
}
} else { //display notice about xmlrpc
$xmlrpcnotification = $OUTPUT->doc_link('admin/environment/php_extension/xmlrpc', '');
$xmlrpcnotification = $OUTPUT->doc_link($CFG->admin . '/environment/php_extension/xmlrpc', '');
$xmlrpcnotification .= get_string('xmlrpcdisabledregistration', 'hub');
echo $OUTPUT->notification($xmlrpcnotification);
}
Expand Down
4 changes: 2 additions & 2 deletions admin/registration/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

require_once('../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/admin/registration/forms.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');

admin_externalpage_setup('registrationindex');

Expand Down
8 changes: 5 additions & 3 deletions admin/registration/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function registration_confirmation($confirmationmessage) {
* Display the page to register on Moodle.org or on a specific hub
*/
public function registrationselector() {
global $CFG;
$table = new html_table();
$table->head = array(get_string('moodleorg', 'hub'), get_string('specifichub', 'hub'));
$table->size = array('50%', '50%');
Expand All @@ -66,7 +67,7 @@ public function registrationselector() {
$table->data[] = $row;

//Moodle.org button cell
$registeronmoodleorgurl = new moodle_url("/admin/registration/register.php",
$registeronmoodleorgurl = new moodle_url("/" . $CFG->admin . "/registration/register.php",
array('sesskey' => sesskey(), 'huburl' => HUB_MOODLEORGHUBURL
, 'hubname' => 'Moodle.org'));
$registeronmoodleorgbutton = new single_button($registeronmoodleorgurl,
Expand All @@ -76,7 +77,7 @@ public function registrationselector() {
$moodleorgcell = $registeronmoodleorgbuttonhtml;

//Specific hub button cell
$registeronspecifichuburl = new moodle_url("/admin/registration/hubselector.php",
$registeronspecifichuburl = new moodle_url("/" . $CFG->admin . "/registration/hubselector.php",
array('sesskey' => sesskey()));
$registeronspecifichubbutton = new single_button($registeronspecifichuburl,
get_string('registeronspecifichub', 'hub'));
Expand All @@ -96,6 +97,7 @@ public function registrationselector() {
* Display the listing of registered on hub
*/
public function registeredonhublisting($hubs) {
global $CFG;
$table = new html_table();
$table->head = array(get_string('hub', 'hub'), get_string('operation', 'hub'));
$table->size = array('80%', '20%');
Expand All @@ -104,7 +106,7 @@ public function registeredonhublisting($hubs) {
$hublink = html_writer::tag('a', $hub->hubname, array('href' => $hub->huburl));
$hublinkcell = html_writer::tag('div', $hublink, array('class' => 'registeredhubrow'));

$unregisterhuburl = new moodle_url("/admin/registration/index.php",
$unregisterhuburl = new moodle_url("/" . $CFG->admin . "/registration/index.php",
array('sesskey' => sesskey(), 'huburl' => $hub->huburl,
'unregistration' => 1));
$unregisterbutton = new single_button($unregisterhuburl,
Expand Down
4 changes: 2 additions & 2 deletions blocks/community/communitycourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require('../../config.php');
require_once($CFG->dirroot . '/blocks/community/locallib.php');
require_once($CFG->dirroot . '/blocks/community/forms.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');

require_login();

Expand All @@ -53,7 +53,7 @@
if (empty($usercansearch)) {
$notificationerror = get_string('cannotsearchcommunity', 'hub');
} else if (!extension_loaded('xmlrpc')) {
$notificationerror = $OUTPUT->doc_link('admin/environment/php_extension/xmlrpc', '');
$notificationerror = $OUTPUT->doc_link($CFG->admin . '/environment/php_extension/xmlrpc', '');
$notificationerror .= get_string('xmlrpcdisabledcommunity', 'hub');
}
if (!empty($notificationerror)) {
Expand Down
6 changes: 3 additions & 3 deletions blocks/community/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* Form for community search
*/

require_once($CFG->dirroot . '/lib/formslib.php');
require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . '/course/publish/lib.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');

class community_hub_search_form extends moodleform {

Expand Down Expand Up @@ -242,7 +242,7 @@ public function definition() {
$this->init_javascript_enhancement('subject', 'smartselect',
array('selectablecategories' => true, 'mode' => 'compact'));

require_once($CFG->dirroot . "/lib/licenselib.php");
require_once($CFG->libdir . "/licenselib.php");
$licensemanager = new license_manager();
$licences = $licensemanager->get_licenses();
$options = array();
Expand Down
2 changes: 1 addition & 1 deletion blocks/community/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function block_community_get_course($courseurl, $userid) {
*/
public function block_community_download_course_backup($course) {
global $CFG, $USER;
require_once($CFG->dirroot. "/lib/filelib.php");
require_once($CFG->libdir . "/filelib.php");
require_once($CFG->dirroot. "/course/publish/lib.php");

$params['courseid'] = $course->id;
Expand Down
2 changes: 1 addition & 1 deletion blocks/community/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function course_list($courses, $huburl, $contextcourseid) {
$course->lang = '';
}
//licence
require_once($CFG->dirroot . "/lib/licenselib.php");
require_once($CFG->libdir . "/licenselib.php");
$licensemanager = new license_manager();
$licenses = $licensemanager->get_licenses();
foreach ($licenses as $license) {
Expand Down
6 changes: 3 additions & 3 deletions course/publish/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
require_once('../../config.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/moodle2/backup_plan_builder.class.php');
require_once($CFG->dirroot.'/admin/registration/lib.php');
require_once($CFG->dirroot.'/course/publish/lib.php');
require_once($CFG->dirroot.'/lib/filelib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_once($CFG->dirroot . '/course/publish/lib.php');
require_once($CFG->libdir . '/filelib.php');


//retrieve initial page parameters
Expand Down
6 changes: 3 additions & 3 deletions course/publish/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
*/


require_once($CFG->dirroot . '/lib/formslib.php');
require_once($CFG->dirroot . "/admin/registration/lib.php");
require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . "/" . $CFG->admin . "/registration/lib.php");
require_once($CFG->dirroot . "/course/publish/lib.php");

/*
Expand Down Expand Up @@ -261,7 +261,7 @@ public function definition() {



require_once($CFG->dirroot . "/lib/licenselib.php");
require_once($CFG->libdir . "/licenselib.php");
$licensemanager = new license_manager();
$licences = $licensemanager->get_licenses();
$options = array();
Expand Down
2 changes: 1 addition & 1 deletion course/publish/hubselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

require('../../config.php');

require_once($CFG->dirroot.'/admin/registration/lib.php');
require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/lib.php');
require_once($CFG->dirroot.'/course/publish/forms.php');

$id = optional_param('id', 0, PARAM_INT);
Expand Down
6 changes: 3 additions & 3 deletions course/publish/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/

require('../../config.php');
require_once($CFG->dirroot.'/admin/registration/lib.php');
require_once($CFG->dirroot.'/course/publish/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_once($CFG->dirroot . '/course/publish/lib.php');

$id = optional_param('id', 0, PARAM_INT);
$hubname = optional_param('hubname', 0, PARAM_TEXT);
Expand All @@ -45,7 +45,7 @@

//check that the PHP xmlrpc extension is enabled
if (!extension_loaded('xmlrpc')) {
$notificationerror = $OUTPUT->doc_link('admin/environment/php_extension/xmlrpc', '');
$notificationerror = $OUTPUT->doc_link($CFG->admin . '/environment/php_extension/xmlrpc', '');
$notificationerror .= get_string('xmlrpcdisabledpublish', 'hub');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('publishcourse', 'hub', $course->shortname), 3, 'main');
Expand Down
7 changes: 3 additions & 4 deletions course/publish/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

require_once('../../config.php');
require_once($CFG->dirroot . '/course/publish/forms.php');
require_once($CFG->dirroot . '/admin/registration/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_once($CFG->dirroot . '/course/publish/lib.php');
require_once($CFG->dirroot . '/lib/filelib.php');
require_once($CFG->libdir . '/filelib.php');


//check user access capability to this page
Expand All @@ -55,7 +55,7 @@

//check that the PHP xmlrpc extension is enabled
if (!extension_loaded('xmlrpc')) {
$errornotification = $OUTPUT->doc_link('admin/environment/php_extension/xmlrpc', '');
$errornotification = $OUTPUT->doc_link($CFG->admin . '/environment/php_extension/xmlrpc', '');
$errornotification .= get_string('xmlrpcdisabledpublish', 'hub');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('publishcourse', 'hub', $course->shortname), 3, 'main');
Expand Down Expand Up @@ -213,7 +213,6 @@

// send screenshots
if (!empty($fromform->screenshots)) {
require_once($CFG->dirroot . "/lib/filelib.php");

if (!empty($fromform->deletescreenshots)) {
$screenshotnumber = 0;
Expand Down

0 comments on commit a8e174c

Please sign in to comment.