Skip to content

Commit

Permalink
blocklib: MDL-19010 always include blocklib in setup.php, stip includ…
Browse files Browse the repository at this point in the history
…es elsewhere
  • Loading branch information
tjhunt committed May 6, 2009
1 parent 66b1068 commit 93d4a37
Show file tree
Hide file tree
Showing 38 changed files with 5 additions and 55 deletions.
1 change: 0 additions & 1 deletion admin/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');

$blockid = required_param('block', PARAM_INT);

Expand Down
1 change: 0 additions & 1 deletion admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/tablelib.php');

admin_externalpage_setup('manageblocks');
Expand Down
2 changes: 0 additions & 2 deletions admin/cliupgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@

/// Check all blocks and load (or upgrade them if necessary)
/// first old *.php update and then the new upgrade.php script
require_once("$CFG->dirroot/lib/blocklib.php");
if ( $verbose > CLI_NO ) {
print_heading(get_string('upgradingblocksplugin','install'),'',1);
}
Expand Down Expand Up @@ -1053,7 +1052,6 @@
/// Set up the site
if (! $site = get_site()) {
// We are about to create the site "course"
require_once($CFG->libdir.'/blocklib.php');

if ( ( $interactive == CLI_FULL ) || ($interactive == CLI_SEMI && ( (!isset($INSTALL['sitefullname'])) || (!isset($INSTALL['siteshortname'])) || (!isset($INSTALL['sitesummary'])) || (!isset($INSTALL['sitenewsitems'])) )) ) {
console_write('siteinfo');
Expand Down
1 change: 0 additions & 1 deletion admin/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@
include_once("$CFG->dirroot/backup/backup_scheduled.php");
include_once("$CFG->dirroot/backup/backuplib.php");
include_once("$CFG->dirroot/backup/lib.php");
require_once ("$CFG->libdir/blocklib.php");
mtrace("Running backups if required...");

if (! schedule_backup_cron()) {
Expand Down
1 change: 0 additions & 1 deletion admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');

$section = required_param('section', PARAM_SAFEDIR);
$return = optional_param('return','', PARAM_ALPHA);
Expand Down
1 change: 0 additions & 1 deletion admin/stickyblocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_once('../config.php');
require_once($CFG->dirroot.'/my/pagelib.php');
require_once($CFG->dirroot.'/lib/pagelib.php');
require_once($CFG->dirroot.'/lib/blocklib.php');

$pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and -

Expand Down
1 change: 0 additions & 1 deletion auth/cas/cas_ldap_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.

require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/lib/blocklib.php');
require_once($CFG->dirroot.'/mod/resource/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
require_once($CFG->dirroot.'/lib/moodlelib.php');
Expand Down
1 change: 0 additions & 1 deletion auth/db/auth_db_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.

require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/mod/resource/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
Expand Down
1 change: 0 additions & 1 deletion auth/ldap/auth_ldap_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.

require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/mod/resource/lib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
Expand Down
1 change: 0 additions & 1 deletion backup/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require_once ("../config.php");
require_once ("lib.php");
require_once ("backuplib.php");
require_once ("$CFG->libdir/blocklib.php");
require_once ("$CFG->libdir/adminlib.php");

$id = optional_param( 'id' ); // course id
Expand Down
1 change: 0 additions & 1 deletion backup/restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
require_once("lib.php");
require_once("restorelib.php");
require_once("bb/restore_bb.php");
require_once("$CFG->libdir/blocklib.php");
require_once("$CFG->libdir/wiki_to_markdown.php" );
require_once("$CFG->libdir/adminlib.php");

Expand Down
1 change: 0 additions & 1 deletion backup/try.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_once ("backup_scheduled.php");
require_once ("lib.php");
require_once ("backuplib.php");
require_once ("$CFG->libdir/blocklib.php");

require_login();

Expand Down
2 changes: 0 additions & 2 deletions blog/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
/// Sets up blocks and navigation for index.php

require_once($CFG->dirroot .'/blog/lib.php');
require_once($CFG->libdir .'/pagelib.php');
require_once($CFG->dirroot .'/blog/blogpage.php');
require_once($CFG->libdir .'/blocklib.php');
require_once($CFG->dirroot .'/course/lib.php');

$blockaction = optional_param('blockaction','', PARAM_ALPHA);
Expand Down
1 change: 0 additions & 1 deletion blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

require_once('../config.php');
require_once($CFG->dirroot .'/blog/lib.php');
require_once($CFG->libdir .'/blocklib.php');

$id = optional_param('id', 0, PARAM_INT);
$start = optional_param('formstart', 0, PARAM_INT);
Expand Down
2 changes: 0 additions & 2 deletions blog/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/**
* Library of functions and constants for blog
*/
require_once($CFG->libdir .'/blocklib.php');
require_once($CFG->libdir .'/pagelib.php');
require_once($CFG->dirroot .'/blog/rsslib.php');
require_once($CFG->dirroot .'/blog/blogpage.php');
require_once($CFG->dirroot.'/tag/lib.php');
Expand Down
1 change: 0 additions & 1 deletion course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

require_once('../config.php');
require_once($CFG->dirroot.'/enrol/enrol.class.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('lib.php');
require_once('edit_form.php');

Expand Down
2 changes: 0 additions & 2 deletions course/pending.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
*//** */

require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/pagelib.php');
require_once($CFG->libdir . '/blocklib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->dirroot . '/course/request_form.php');
Expand Down
3 changes: 0 additions & 3 deletions course/rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

require_once('../config.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir .'/pagelib.php');
require_once($CFG->libdir .'/blocklib.php');


// Initialise ALL the incoming parameters here, up front.
$courseid = required_param('courseId', PARAM_INT);
Expand Down
2 changes: 0 additions & 2 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

require_once('../config.php');
require_once('lib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/ajax/ajaxlib.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');

$id = optional_param('id', 0, PARAM_INT);
Expand Down
3 changes: 1 addition & 2 deletions enrol/database/enrol_database_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.

require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->dirroot . '/lib/blocklib.php');
require_once($CFG->dirroot . "/enrol/database/enrol.php");
require_once($CFG->dirroot . '/enrol/database/enrol.php');

// ensure errors are well explained
$CFG->debug=E_ALL;
Expand Down
2 changes: 0 additions & 2 deletions enrol/imsenterprise/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package enrol_imsenterprise
*/
require_once("$CFG->libdir/blocklib.php");
require_once($CFG->dirroot.'/group/lib.php');
require_once($CFG->libdir.'/eventslib.php');

// The following flags are set in the configuration
// $CFG->enrol_imsfilelocation: where is the file we are looking for?
Expand Down
1 change: 0 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

require_once('config.php');
require_once($CFG->dirroot .'/course/lib.php');
require_once($CFG->libdir .'/blocklib.php');
require_once($CFG->libdir .'/filelib.php');

// Bounds for block widths
Expand Down
2 changes: 0 additions & 2 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@
* @package roles
*/

require_once $CFG->dirroot.'/lib/blocklib.php';

// permission definitions
define('CAP_INHERIT', 0);
define('CAP_ALLOW', 1);
Expand Down
2 changes: 0 additions & 2 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3893,9 +3893,7 @@ public function output_html($data, $query='') {
*/
function admin_externalpage_setup($section, $extrabutton = '',
$extraurlparams = array(), $actualurl = '') {

global $CFG, $PAGE, $USER;
require_once($CFG->libdir.'/blocklib.php');

if ($site = get_site()) {
require_login();
Expand Down
1 change: 0 additions & 1 deletion lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
define('BLOCKS_PINNED_BOTH',2);

require_once($CFG->libdir.'/pagelib.php');
require_once($CFG->dirroot.'/course/lib.php'); // needed to solve all those: Call to undefined function: print_recent_activity() when adding Recent Activity

//This function retrieves a method-defined property of a class WITHOUT instantiating an object
function block_method_result($blockname, $method, $param = NULL) {
Expand Down
1 change: 0 additions & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3611,7 +3611,6 @@ function remove_course_contents($courseid, $showfeedback=true) {
notify($strdeleted .' block_instance_old');
}

require_once($CFG->libdir.'/blocklib.php');
foreach ($blocks as $block) { /// Delete any associated contexts for this block

delete_context(CONTEXT_BLOCK, $block->id);
Expand Down
3 changes: 3 additions & 0 deletions lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@

/// Load up standard libraries
require_once($CFG->libdir .'/textlib.class.php'); // Functions to handle multibyte strings
require_once($CFG->libdir .'/filterlib.php'); // Functions for filtering test as it is output
require_once($CFG->libdir .'/ajax/ajaxlib.php'); // Functions for managing our use of JavaScript and YUI
require_once($CFG->libdir .'/weblib.php'); // Functions for producing HTML
require_once($CFG->libdir .'/dmllib.php'); // Database access
require_once($CFG->libdir .'/datalib.php'); // Legacy lib with a big-mix of functions.
require_once($CFG->libdir .'/accesslib.php'); // Access control functions
require_once($CFG->libdir .'/deprecatedlib.php'); // Deprecated functions included for backward compatibility
require_once($CFG->libdir .'/moodlelib.php'); // Other general-purpose functions
require_once($CFG->libdir .'/blocklib.php'); // Library for controlling blocks
require_once($CFG->libdir .'/eventslib.php'); // Events functions
require_once($CFG->libdir .'/grouplib.php'); // Groups functions
require_once($CFG->libdir .'/sessionlib.php'); // All session and cookie related stuff
Expand Down
3 changes: 1 addition & 2 deletions lib/simpletest/testpagelib_moodlepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
///////////////////////////////////////////////////////////////////////////

/**
* Tests for the parts of ../filterlib.php that handle creating filter objects,
* and using them to filter strings.
* Tests for the moodle_page class in ../pagelib.php.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package moodlecore
Expand Down
1 change: 0 additions & 1 deletion lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ function upgrade_plugins_modules($startcallback, $endcallback) {
function upgrade_plugins_blocks($startcallback, $endcallback) {
global $CFG, $DB;

require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->dirroot.'/blocks/moodleblock.class.php');

$blocktitles = array(); // we do not want duplicate titles
Expand Down
5 changes: 0 additions & 5 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
* @package moodlecore
*/

/// We are going to uses filterlib functions here
require_once("$CFG->libdir/filterlib.php");

require_once("$CFG->libdir/ajax/ajaxlib.php");

/// Constants

/// Define text formatting types ... eventually we can add Wiki, BBcode etc
Expand Down
1 change: 0 additions & 1 deletion mod/chat/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

require_once('../../config.php');
require_once('lib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('pagelib.php');

$id = optional_param('id', 0, PARAM_INT);
Expand Down
1 change: 0 additions & 1 deletion mod/data/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

require_once('../../config.php');
require_once('lib.php');
require_once($CFG->libdir.'/blocklib.php');

$id = optional_param('id', 0, PARAM_INT); // course module id
$d = optional_param('d', 0, PARAM_INT); // database id
Expand Down
1 change: 0 additions & 1 deletion mod/data/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

require_once('../../config.php');
require_once('lib.php');
require_once($CFG->libdir.'/blocklib.php');
require_once("$CFG->libdir/rsslib.php");

require_once('pagelib.php');
Expand Down
1 change: 0 additions & 1 deletion mod/lesson/action/continue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
confirm_sesskey();

require_once($CFG->dirroot.'/mod/lesson/pagelib.php');
require_once($CFG->libdir.'/blocklib.php');

// left menu code
// check to see if the user can see the left menu
Expand Down
1 change: 0 additions & 1 deletion mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
require_once($CFG->dirroot.'/mod/lesson/lib.php');
require_once($CFG->dirroot.'/mod/lesson/pagelib.php');
require_once($CFG->libdir.'/blocklib.php');

$id = required_param('id', PARAM_INT); // Course Module ID
$pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
Expand Down
1 change: 0 additions & 1 deletion mod/quiz/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/// This page prints a particular instance of quiz

require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/mod/quiz/locallib.php');
require_once($CFG->dirroot.'/mod/quiz/pagelib.php');
Expand Down
3 changes: 0 additions & 3 deletions mod/resource/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,8 @@ function display() {
* Display the resource with the course blocks.
*/
function display_course_blocks_start() {

global $CFG, $USER, $THEME;

require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/pagelib.php');
require_once($CFG->dirroot.'/course/lib.php'); //required by some blocks

$PAGE = page_create_object(PAGE_COURSE_VIEW, $this->course->id);
Expand Down
1 change: 0 additions & 1 deletion my/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// this is the 'my moodle' page

require_once('../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once('pagelib.php');

Expand Down

0 comments on commit 93d4a37

Please sign in to comment.