MDL-21249 improved php docs and adding direct access prevention in core libs

This commit is contained in:
Petr Skoda
2010-07-25 13:35:05 +00:00
parent 2ac619c1e0
commit 78bfb562a0
70 changed files with 388 additions and 215 deletions
+4 -3
View File
@@ -21,9 +21,10 @@
* It works with the {@link block_edit_form} class, or rather the particular
* subclass defined by this block, to do the editing.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage block
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (!defined('MOODLE_INTERNAL')) {
+3 -2
View File
@@ -18,8 +18,9 @@
/**
* This file contains the parent class for moodle blocks, block_base.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package blocks
* @package core
* @subpackage block
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
/// Constants
+6 -3
View File
@@ -118,11 +118,14 @@
* DB need to ensure that the default role caps
* are dealt with appropriately.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage role
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** permission definitions */
define('CAP_INHERIT', 0);
/** permission definitions */
+6 -3
View File
@@ -97,11 +97,14 @@
* Original author: Vincenzo K. Marcovecchio
* Maintainer: Petr Skoda
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage admin
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/// Add libraries
require_once($CFG->libdir.'/ddllib.php');
require_once($CFG->libdir.'/xmlize.php');
+6 -3
View File
@@ -20,11 +20,14 @@
*
* 2006-08-28 File created, AUTH return values defined.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage auth
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Returned when the login was successful.
*/
+7 -4
View File
@@ -20,11 +20,14 @@
*
* This file defines the {@link block_manager} class,
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage block
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**#@+
* @deprecated since Moodle 2.0. No longer used.
*/
@@ -1353,7 +1356,7 @@ class block_manager {
/**
* Turns the display of normal blocks either on or off.
*
*
* @param bool $setting
*/
public function show_only_fake_blocks($setting = true) {
+3 -1
View File
@@ -18,12 +18,14 @@
/**
* Command line utility functions and classes
*
* @package moodlecore
* @package core
* @subpackage cli
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Get input from user
* @param string $prompt text prompt, should include possible options
+13 -10
View File
@@ -15,23 +15,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once $CFG->libdir.'/completion/completion_aggregation.php';
require_once $CFG->libdir.'/completion/completion_criteria.php';
require_once $CFG->libdir.'/completion/completion_completion.php';
require_once $CFG->libdir.'/completion/completion_criteria_completion.php';
/**
* Contains a class used for tracking whether activities have been completed
* by students ('completion')
*
* Completion top-level options (admin setting enablecompletion)
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage completion
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once $CFG->libdir.'/completion/completion_aggregation.php';
require_once $CFG->libdir.'/completion/completion_criteria.php';
require_once $CFG->libdir.'/completion/completion_completion.php';
require_once $CFG->libdir.'/completion/completion_criteria_completion.php';
/** The completion system is enabled in this site/course */
define('COMPLETION_ENABLED', 1);
/** The completion system is not enabled in this site/course */
@@ -110,7 +113,7 @@ define('COMPLETION_AGGREGATION_ANY', 2);
* @package moodlecore
*/
class completion_info {
/**
/**
* Course object passed during construction
* @access private
* @var object
+3 -1
View File
@@ -120,11 +120,13 @@
*
* That's all!
*
* @package moodlecore
* @package core
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* @global object $CFG
* @name $CFG
+6 -3
View File
@@ -18,11 +18,14 @@
* Used for tracking conditions that apply before activities are displayed
* to students ('conditional availability').
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage completion
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** The activity is not displayed to students at all when conditions aren't met. */
define('CONDITION_STUDENTVIEW_HIDE',0);
/** The activity is displayed to students as a greyed-out name, with informational
+5 -5
View File
@@ -22,8 +22,8 @@
* before including main config.php. You can resume normal script operation
* if you define ABORT_AFTER_CONFIG_CANCEL and require the setup.php
*
* @package moodlecore
* @copyright 2009 petr Skoda (skodak)
* @package core
* @copyright 2009 Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -82,7 +82,7 @@ function min_clean_param($value, $type) {
* @return boolean, true if compression enabled
*/
function min_enable_zlib_compression() {
if (headers_sent()) {
return false;
}
@@ -102,7 +102,7 @@ function min_enable_zlib_compression() {
}
}
}
@ini_set('output_handler', '');
/*
@@ -112,6 +112,6 @@ function min_enable_zlib_compression() {
* so let's try some bigger sizes.
*/
@ini_set('zlib.output_compression', 65536);
return true;
}
+6 -3
View File
@@ -20,11 +20,14 @@
* You can have a rather longer description of the file as well,
* if you like, and it can span multiple lines.
*
* @copyright Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @package core
* @subpackage lib
* @copyright Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Utitily class for importing of CSV files.
* @copyright Petr Skoda
+6 -3
View File
@@ -27,11 +27,14 @@
* - true: if passed
* - false: if failed
*
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage admin
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This function will look for the risky PHP setting register_globals
* in order to inform about. MDL-12914
+6 -3
View File
@@ -22,11 +22,14 @@
* - weblib.php - functions that produce web output
* - moodlelib.php - general-purpose Moodle functions
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* The maximum courses in a category
* MAX_COURSES_IN_CATEGORY * MAX_COURSE_CATEGORIES must not be more than max integer!
+4 -2
View File
@@ -34,13 +34,15 @@
*
* For further documentation, visit {@link http://docs.moodle.org/en/DDL_functions}
*
* @package moodlecore
* @subpackage DDL
* @package core
* @subpackage ddl
* @copyright 2001-3001 Eloy Lafuente (stronk7) http://contiento.com
* 2008 Petr Skoda http://skodak.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Add required library
require_once($CFG->libdir.'/xmlize.php');
+5 -3
View File
@@ -21,13 +21,15 @@
* Old functions retained only for backward compatibility. New code should not
* use any of these functions.
*
* @package moodlecore
* @package core
* @subpackage deprecated
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated
*/
defined('MOODLE_INTERNAL') || die();
/**
* Given a physical path to a file, returns the URL through which it can be reached in Moodle.
*
+4 -2
View File
@@ -32,12 +32,14 @@
* http://docs.moodle.org/en/DML_functions
* (feel free to modify, improve and document such page, thanks!)
*
* @package moodlecore
* @subpackage DML
* @package core
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Require the essential
require_once($CFG->libdir.'/dml/moodle_database.php');
+4 -2
View File
@@ -22,12 +22,14 @@
* This library includes all the required functions used to handle
* transfer of data from one database to another.
*
* @package moodlecore
* @subpackage DTL
* @package core
* @subpackage dtl
* @copyright 2008 Andrei Bautu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Require {@link ddllib.php}
require_once($CFG->libdir.'/ddllib.php');
// Require {@link database_exporter.php}
+6 -3
View File
@@ -29,11 +29,14 @@
* memcached, a false value is indistinguisable from a
* "not found in cache" response.
*
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @package core
* @subpackage lib
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
*
* @copyright Martin Langhoff <[email protected]>
+2
View File
@@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Returns users preferred editor for given format
*
+5 -3
View File
@@ -19,11 +19,13 @@
* This library includes the basic parts of enrol api.
* It is available on each page.
*
* @package moodlecore
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage enrol
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** Course enrol instance enabled. (used in enrol->status) */
define('ENROL_INSTANCE_ENABLED', 0);
+8 -5
View File
@@ -23,18 +23,21 @@
* All the info is stored in the admin/environment.xml file,
* supporting to have an updated version in dataroot/environment
*
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage admin
*/
defined('MOODLE_INTERNAL') || die();
/// Add required files
/**
* Inlucde the nessecary
* Include the necessary
*/
require_once($CFG->libdir.'/xmlize.php');
/// Define a buch of XML processing errors
/// Define a bunch of XML processing errors
/** XML Processing Error */
define('NO_ERROR', 0);
/** XML Processing Error */
+6 -3
View File
@@ -20,11 +20,14 @@
*
* The public API is all at the end of this file.
*
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage event
*/
defined('MOODLE_INTERNAL') || die();
/**
* Loads the events definitions for the component (from file). If no
* events are defined for the component, we simply return an empty array.
+7 -4
View File
@@ -18,12 +18,15 @@
/**
* excellib.class.php
*
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
*/
/** setup.php icludes our hacked pear libs first */
defined('MOODLE_INTERNAL') || die();
/** setup.php includes our hacked pear libs first */
require_once 'Spreadsheet/Excel/Writer.php';
/**
+3 -2
View File
@@ -18,12 +18,13 @@
/**
* Support for external API
*
* @package moodlecore
* @package core
* @subpackage webservice
* @copyright 2009 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Returns detailed function information
@@ -354,7 +355,7 @@ class external_value extends external_description {
public function __construct($type, $desc='', $required=VALUE_REQUIRED,
$default=null, $allownull=NULL_ALLOWED) {
parent::__construct($desc, $required, $default);
$this->type = $type;
$this->type = $type;
$this->allownull = $allownull;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@
/**
* Functions for file handling.
*
* @package moodlecore
* @package core
* @subpackage file
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* Library functions for managing text filter plugins.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage filter
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** The states a filter can be in, stored in the filter_active table. */
define('TEXTFILTER_ON', 1);
/** The states a filter can be in, stored in the filter_active table. */
+8 -5
View File
@@ -25,18 +25,21 @@
* See examples of use of this library in course/edit.php and course/edit_form.php
*
* A few notes :
* form defintion is used for both printing of form and processing and should be the same
* form definition is used for both printing of form and processing and should be the same
* for both or you may lose some submitted data which won't be let through.
* you should be using setType for every form element except select, radio or checkbox
* elements, these elements clean themselves.
*
*
* @copyright Jamie Pratt <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @copyright Jamie Pratt <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage form
*/
/** setup.php icludes our hacked pear libs first */
defined('MOODLE_INTERNAL') || die();
/** setup.php includes our hacked pear libs first */
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/DHTMLRulesTableless.php';
require_once 'HTML/QuickForm/Renderer/Tableless.php';
+3 -1
View File
@@ -19,11 +19,13 @@
* gdlib.php - Collection of routines in Moodle related to
* processing images using GD
*
* @package moodlecore
* @package core
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
*
* long description
+3 -1
View File
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package moodlecore
* @package core
* @subpackage lib
* @copyright Dan Poltawski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -25,6 +25,8 @@
* Simple implementation of some Google API functions for Moodle.
*/
defined('MOODLE_INTERNAL') || die();
/** Include essential file */
require_once($CFG->libdir.'/filelib.php');
+7 -4
View File
@@ -18,12 +18,15 @@
/**
* Library of functions for gradebook - both public and internal
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage grade
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/** Include essential files */
defined('MOODLE_INTERNAL') || die();
/** Include essential files */
require_once($CFG->libdir . '/grade/constants.php');
require_once($CFG->libdir . '/grade/grade_category.php');
+6 -3
View File
@@ -21,10 +21,13 @@
*
* Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
* Contact author at: [email protected]
*
* @package moodlecore
*
* @package core
* @subpackage lib
*/
defined('MOODLE_INTERNAL') || die();
/* This file contains modifications by Martin Dougiamas
* as part of Moodle (http://moodle.com). Modified lines
* are marked with "Moodle".
@@ -983,7 +986,7 @@ class graph {
$axis_colour = $this->parameter['axis_colour'];
$axis_angle = $this->parameter['y_axis_angle'];
$y_tick_labels = $this->y_tick_labels;
$this->calculated['y_axis_left']['has_data'] = FALSE;
$this->calculated['y_axis_right']['has_data'] = FALSE;
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage group
*/
defined('MOODLE_INTERNAL') || die();
/**
* Groups not used in course or activity
*/
+4 -3
View File
@@ -18,9 +18,10 @@
/**
* This file is serving optimised JS
*
* @package moodlecore
* @copyright 2010 Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2010 Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// we need just the values from config.php and minlib.php
+8 -5
View File
@@ -7,13 +7,16 @@
* data structures, useful for both ldap authentication (or ldap based
* authentication like CAS) and enrolment plugins.
*
* @author aki Arenaza
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @copyright 2010 onwards Iñaki Arenaza
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Iaki Arenaza
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @copyright 2010 onwards Iaki Arenaza
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// rootDSE is defined as the root of the directory data tree on a directory server.
if (!defined('ROOTDSE')) {
define ('ROOTDSE', '');
+7 -5
View File
@@ -19,13 +19,15 @@
/**
* A namespace contains license specific functions
*
* @since 2.0
* @package moodlecore
* @subpackage moodlecore
* @copyright 2010 Dongsheng Cai <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 2.0
* @package core
* @subpackage lib
* @copyright 2010 Dongsheng Cai <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class license_manager {
/**
* Adding a new license type
+6 -3
View File
@@ -25,11 +25,14 @@
* Reordering of items works across pages.
* Processing of editing actions on list.
*
* @package moodlecore
* @copyright Jamie Pratt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright Jamie Pratt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Clues to reading this code:
*
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** @see evalmath/evalmath.class.php */
require_once $CFG->dirroot.'/lib/evalmath/evalmath.class.php';
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This class abstracts PHP's PECL memcached
* API to provide
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* messagelib.php - Contains generic messaging functions for the message system
*
* @package moodlecore
* @copyright Luis Rodrigues and Martin Dougiamas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage message
* @copyright Luis Rodrigues and Martin Dougiamas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Called when a message provider wants to send a message.
* This functions checks the user's processor configuration to send the given type of message,
+6 -3
View File
@@ -23,11 +23,14 @@
* - weblib.php - functions that produce web output
* - datalib.php - functions that access the database
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/// CONSTANTS (Encased in phpdoc proper comments)/////////////////////////
/// Date and time constants ///
+6 -4
View File
@@ -19,13 +19,15 @@
* This file contains classes used to manage the navigation structures in Moodle
* and was introduced as part of the changes occuring in Moodle 2.0
*
* @since 2.0
* @package moodlecore
* @since 2.0
* @package core
* @subpackage navigation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* The name that will be used to separate the navigation cache within SESSION
*/
+6 -3
View File
@@ -20,11 +20,14 @@
* - Eloy Lafuente (stronk7) {@link http://contiento.com}
* - Petr Skoda (skodak)
*
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* The xml used here is derived from output of KSpread 1.6.1
*
+7 -4
View File
@@ -21,11 +21,14 @@
* Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML
* for an overview.
*
* @package moodlecore
* @copyright 2009 Nicolas Connault
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Nicolas Connault
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Helper class used by other components that involve an action on the page (URL or JS).
*
@@ -146,7 +149,7 @@ class popup_action extends component_action {
$this->params[$var] = $params[$var];
}
}
$attributes = array('url' => $url->out(false), 'name' => $name, 'options' => $this->get_js_options($params));
parent::__construct($event, $this->jsfunction, $attributes);
}
+5 -3
View File
@@ -21,11 +21,13 @@
* Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML
* for an overview.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Interface marking other classes as suitable for renderer_base::render()
+6 -3
View File
@@ -22,11 +22,14 @@
* Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML
* for an overview.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** General rendering target, usually normal browser page */
define('RENDERER_TARGET_GENERAL', 'general');
+6 -3
View File
@@ -21,11 +21,14 @@
* Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML
* for an overview.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/outputcomponents.php');
require_once($CFG->libdir.'/outputactions.php');
require_once($CFG->libdir.'/outputfactories.php');
+7 -4
View File
@@ -21,11 +21,14 @@
* Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML
* for an overview.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Simple base class for Moodle renderers.
*
@@ -2457,7 +2460,7 @@ EOD;
* @return string
*/
protected function render_image_gallery(image_gallery $imagegallery) {
$this->page->requires->yui_module(array('gallery-lightbox','gallery-lightbox-skin'),
$this->page->requires->yui_module(array('gallery-lightbox','gallery-lightbox-skin'),
'Y.Lightbox.init', null, '2010.04.08-12-35');
if (count($imagegallery->images) == 0) {
return '';
+6 -3
View File
@@ -19,11 +19,14 @@
/**
* Library functions to facilitate the use of JavaScript in Moodle.
*
* @package moodlecore
* @copyright 2009 Tim Hunt, 2010 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Tim Hunt, 2010 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// note: you can find history of this file in lib/ajax/ajaxlib.php
/**
+9 -7
View File
@@ -17,14 +17,16 @@
/**
* This file contains the moodle_page class. There is normally a single instance
* of this class in the $PAGE global variable. This class is a central reporitory
* of this class in the $PAGE global variable. This class is a central repository
* of information about the page we are building up to send back to the user.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* $PAGE is a central store of information about the current page we are
@@ -218,7 +220,7 @@ class moodle_page {
* @var bool
*/
protected $_legacythemeinuse = false;
/// Magic getter methods =============================================================
/// Due to the __get magic below, you normally do not call these as $PAGE->magic_get_x
/// methods, but instead use the $PAGE->x syntax.
@@ -1205,7 +1207,7 @@ class moodle_page {
* default to the admin-selected legacy theme
*
* @return true if legacy theme should be used, otherwise false
*
*
*/
protected function browser_is_outdated() {
foreach($this->_legacybrowsers as $browser => $version) {
@@ -1217,7 +1219,7 @@ class moodle_page {
}
return false;
}
/**
* Sets ->pagetype from the script name. For example, if the script that was
* run is mod/quiz/view.php, ->pagetype will be set to 'mod-quiz-view'.
+3 -1
View File
@@ -23,12 +23,14 @@
* Major Contributors
* - Penny Leach <penny@catalyst.net.nz>
*
* @package moodlecore
* @package core
* @subpackage portfolio
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// require some of the sublibraries first.
// this is not an exhaustive list, the others are pulled in as they're needed
// so we don't have to always include everything unnecessarily for performance
+7 -5
View File
@@ -29,12 +29,14 @@
* Major Contributors
* - Alex Smith, Julian Sedding and Gustav Delius {@link http://maths.york.ac.uk/serving_maths}
*
* @package moodlecore
* @package core
* @subpackage question
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/// CONSTANTS ///////////////////////////////////
/**#@+
@@ -2500,8 +2502,8 @@ function question_category_options($contexts, $top = false, $currentcat = 0, $po
foreach ($categoriesarray as $contextstring => $optgroup){
$group = array();
foreach ($optgroup as $key=>$value) {
$key = str_replace($CFG->wwwroot, '', $key);
$group[$key] = $value;
$key = str_replace($CFG->wwwroot, '', $key);
$group[$key] = $value;
}
$popupcats[] = array($contextstring=>$group);
}
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* Recourse module like helper functions
*
* @package moodlecore
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** Try the best way */
define('RESOURCELIB_DISPLAY_AUTO', 0);
/** Display using object tag */
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* This file contains all the common stuff to be used in RSS System
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage rss
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
function rss_add_http_header($context, $componentname, $componentinstance, $title) {
global $PAGE, $USER;
$rsspath = rss_get_url($context->id, $USER->id, $componentname, $componentinstance->id);
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage search
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** @see lexer.php */
require_once($CFG->libdir.'/lexer.php');
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage session
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Factory method returning moodle_session object.
* @return moodle_session
+4 -3
View File
@@ -21,9 +21,10 @@
* Normally this is only called by the main config.php file
* Normally this file does not need to be edited.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
+6 -3
View File
@@ -21,11 +21,14 @@
* setup process, before any of the main libraries are
* loaded.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/// Debug levels ///
/** no warnings at all */
define ('DEBUG_NONE', 0);
+5 -3
View File
@@ -22,12 +22,14 @@
* ones, provide code coverage analysis to already existing tests. Also there are some
* utility functions designed to make the coverage control easier.
*
* @package moodlecore
* @package core
* @subpackage simpletestcoverage
* @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Includes
*/
+5 -3
View File
@@ -25,12 +25,14 @@
* Major Contirbutors
* - T.J.Hunt@open.ac.uk
*
* @package moodlecore
* @package core
* @subpackage simpletestex
* @copyright &copy; 2006 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright &copy; 2006 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Includes
*/
+8 -5
View File
@@ -21,13 +21,16 @@
* Since Moodle 2.0 we rely only on native PHP Soap extension,
* the original name of this file was lib/soap/phpsoap.php
*
* @package moodlecore
* @author Alex Smith and others members of the Serving Mathematics project
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* {@link http://maths.york.ac.uk/serving_maths}
* and others
* @package core
* @subpackage lib
* @author Alex Smith and others members of the Serving Mathematics project
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* {@link http://maths.york.ac.uk/serving_maths}
* and others
*/
defined('MOODLE_INTERNAL') || die();
/**
* Create a new SoapClient object
*
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage stats
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** THESE CONSTANTS ARE USED FOR THE REPORTING PAGE. */
define('STATS_REPORT_LOGINS',1); // double impose logins and unique logins on a line graph. site course only.
+8 -5
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** TABLE_VAR_SORT = 1 */
define('TABLE_VAR_SORT', 1);
/** TABLE_VAR_HIDE = 2 */
@@ -1097,7 +1100,7 @@ class flexible_table {
$fsortorder = get_string('asc');
$lsortorder = get_string('asc');
}
$override = new object();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
@@ -1111,7 +1114,7 @@ class flexible_table {
} else {
$this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last.' / '.
'<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first;
}
}
}
break;
+6 -3
View File
@@ -16,11 +16,14 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* As we implement the singleton pattern to use this class (only one instance
* is shared globally), we need this helper function
+3 -1
View File
@@ -18,12 +18,14 @@
/**
* Various upgrade/install related functions and classes.
*
* @package moodlecore
* @package core
* @subpackage upgrade
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** UPGRADE_LOG_NORMAL = 0 */
define('UPGRADE_LOG_NORMAL', 0);
/** UPGRADE_LOG_NOTICE = 1 */
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* uploadlib.php - This class handles all aspects of fileuploading
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage file
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This class handles all aspects of fileuploading
*
+6 -3
View File
@@ -25,11 +25,14 @@
* - datalib.php - functions that access the database.
* - moodlelib.php - general-purpose Moodle functions.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/// Constants
/// Define text formatting types ... eventually we can add Wiki, BBcode etc
+6 -3
View File
@@ -18,11 +18,14 @@
/**
* Utility function to convert wiki-like to Markdown format
*
* @package moodlecore
* @copyright Howard Miller, 2005
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright Howard Miller, 2005
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**#@+
* state defines
*/
+2
View File
@@ -60,6 +60,8 @@ foreach ($parts as $part) {
//debug($bits);
$version = array_shift($bits);
if ($version == 'moodle') {
//TODO: this is a ugly hack because we should not load any libs here!
define('MOODLE_INTERNAL', true);
require_once($CFG->libdir.'/moodlelib.php');
$frankenstyle = array_shift($bits);
$filename = array_pop($bits);
+2
View File
@@ -34,6 +34,8 @@ $parts = explode('/', $path);
$version = array_shift($parts);
if ($version == 'moodle' && count($parts) >= 3) {
//TODO: this is a ugly hack because we should not load any libs here!
define('MOODLE_INTERNAL', true);
require_once($CFG->libdir.'/moodlelib.php');
$frankenstyle = array_shift($parts);
$module = array_shift($parts);