Skip to content

Commit

Permalink
MDL-25855 some more missing filelib includes
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 23, 2011
1 parent 17e0390 commit 99d19c1
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 5 deletions.
2 changes: 2 additions & 0 deletions blocks/course_summary/block_course_summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ function specialization() {
function get_content() {
global $CFG, $OUTPUT;

require_once($CFG->libdir . '/filelib.php');

if($this->content !== NULL) {
return $this->content;
}
Expand Down
4 changes: 4 additions & 0 deletions blocks/html/block_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ function instance_allow_multiple() {
}

function get_content() {
global $CFG;

require_once($CFG->libdir . '/filelib.php');

if ($this->content !== NULL) {
return $this->content;
}
Expand Down
2 changes: 2 additions & 0 deletions blog/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/filelib.php');

/**
* Blog_entry class. Represents an entry in a user's blog. Contains all methods for managing this entry.
* This class does not contain any HTML-generating code. See blog_listing sub-classes for such code.
Expand Down
5 changes: 4 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,10 @@ protected function get_editoroptions() {
* @return string
*/
protected function get_description() {
global $USER;
global $USER, $CFG;

require_once($CFG->libdir . '/filelib.php');

if ($this->_description === null) {
// Check if we have already resolved the context for this event
if ($this->editorcontext === null) {
Expand Down
1 change: 1 addition & 0 deletions group/members.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require_once(dirname(__FILE__) . '/lib.php');
require_once($CFG->dirroot . '/user/selector/lib.php');
require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->libdir . '/filelib.php');

$groupid = required_param('group', PARAM_INT);
$cancel = optional_param('cancel', false, PARAM_BOOL);
Expand Down
1 change: 1 addition & 0 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

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

$courseid = required_param('id', PARAM_INT);
$groupid = optional_param('group', 0, PARAM_INT);
Expand Down
3 changes: 3 additions & 0 deletions lib/grade/grade_outcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ public function get_shortname() {
* @return string
*/
public function get_description() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');

$options = new stdClass;
$options->noclean = true;
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
Expand Down
3 changes: 3 additions & 0 deletions lib/grade/grade_scale.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ public function is_used() {
* @return string
*/
public function get_description() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');

$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$options = new stdClass;
$options->noclean = true;
Expand Down
2 changes: 2 additions & 0 deletions mod/assignment/type/online/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
require_once($CFG->libdir.'/formslib.php');
require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->dirroot . '/mod/assignment/lib.php');
require_once($CFG->libdir . '/filelib.php');

/**
* Extend the base assignment class for assignments where you upload a single file
*
Expand Down
4 changes: 3 additions & 1 deletion mod/feedback/item/label/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ function save_item() {
}

function print_item($item){
global $DB;
global $DB, $CFG;

require_once($CFG->libdir . '/filelib.php');

//is the item a template?
if(!$item->feedback AND $item->template) {
Expand Down
2 changes: 2 additions & 0 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3110,6 +3110,8 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
$footer="", $highlight="", $postisread=null, $dummyifcantsee=true, $istracked=null, $return=false) {
global $USER, $CFG, $OUTPUT;

require_once($CFG->libdir . '/filelib.php');

// String cache
static $str;

Expand Down
4 changes: 4 additions & 0 deletions mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,10 @@ function glossary_print_entry($course, $cm, $glossary, $entry, $mode='',$hook=''
* @return void Output is echo'd
*/
function glossary_print_entry_default ($entry, $glossary, $cm) {
global $CFG;

require_once($CFG->libdir . '/filelib.php');

echo '<h3>'. strip_tags($entry->concept) . ': </h3>';

$definition = $entry->definition;
Expand Down
3 changes: 2 additions & 1 deletion mod/glossary/showentry_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

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

$concept = optional_param('concept', '', PARAM_CLEAN);
$courseid = optional_param('courseid', 0, PARAM_INT);
Expand Down Expand Up @@ -66,7 +67,7 @@
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$options->context = $context;
$options->context = $context;
$entries[$key]->definition = format_text($definition, $entry->definitionformat, $options);

$entries[$key]->footer = "<p style=\"text-align:right\">&raquo;&nbsp;<a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/** Include the files that are required by this module */
require_once($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot . '/mod/lesson/lib.php');
require_once($CFG->libdir . '/filelib.php');

/** This page */
define('LESSON_THISPAGE', 0);
Expand Down
3 changes: 2 additions & 1 deletion mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
require_once($CFG->dirroot . '/mod/quiz/attemptlib.php');
require_once($CFG->dirroot . '/question/editlib.php');
require_once($CFG->libdir . '/eventslib.php');
require_once($CFG->libdir . '/filelib.php');

/// Constants ///////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -1031,7 +1032,7 @@ function quiz_send_confirmation($a) {
$eventdata->smallmessage = get_string('emailconfirmsmall', 'quiz', $a);
$eventdata->contexturl = $a->quizurl;
$eventdata->contexturlname = $a->quizname;

return message_send($eventdata);
}

Expand Down
5 changes: 4 additions & 1 deletion mod/quiz/report/reportlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter)
* @return string the comment that corresponds to this grade (empty string if there is not one.
*/
function quiz_report_feedback_for_grade($grade, $quizid, $context) {
global $DB;
global $DB, $CFG;

require_once($CFG->libdir . '/filelib.php');

static $feedbackcache = array();
if (!isset($feedbackcache[$quizid])){
$feedbackcache[$quizid] = $DB->get_records('quiz_feedback', array('quizid' => $quizid));
Expand Down
1 change: 1 addition & 0 deletions mod/wiki/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

require_once($CFG->dirroot . '/mod/wiki/lib.php');
require_once($CFG->dirroot . '/mod/wiki/parser/parser.php');
require_once($CFG->libdir . '/filelib.php');

define('WIKI_REFRESH_CACHE_TIME', 30); // @TODO: To be deleted.
define('FORMAT_CREOLE', '37');
Expand Down
1 change: 1 addition & 0 deletions mod/workshop/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

require_once(dirname(__FILE__).'/lib.php'); // we extend this library here
require_once($CFG->libdir . '/gradelib.php'); // we use some rounding and comparing routines here
require_once($CFG->libdir . '/filelib.php');

/**
* Full-featured workshop API
Expand Down
1 change: 1 addition & 0 deletions user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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

define('USER_SMALL_CLASS', 20); // Below this is considered small
define('USER_LARGE_CLASS', 200); // Above this is considered large
Expand Down
1 change: 1 addition & 0 deletions user/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require_once("../config.php");
require_once($CFG->dirroot.'/user/profile/lib.php');
require_once($CFG->dirroot.'/tag/lib.php');
require_once($CFG->libdir . '/filelib.php');

$id = optional_param('id', 0, PARAM_INT); // user id
$courseid = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
Expand Down

0 comments on commit 99d19c1

Please sign in to comment.