Source for file sl_config.php
Documentation is available at sl_config.php
* Sets up the basic Sloodle information, and includes the necessary Moodle data/functionality.
// Pull in the main moodle config
// NB the following is necessary for when we pull in this config.php from a module under sloodle/mod
require_once (realpath(dirname(__FILE__
) .
"/" .
"../../config.php"));
// Is this a linker script?
if (defined('SLOODLE_LINKER_SCRIPT')) {
// If the site is in maintenance mode, then stop the script
if (file_exists($CFG->dataroot.
'/'.
SITEID.
'/maintenance.html')) {
exit("-111|SYSTEM\nThe Moodle site is in maintenance mode. Please try again later.");
//---------------------------------------------------------------------
/** The path for browsing to the root of the Sloodle folder. */
define('SLOODLE_WWWROOT', $CFG->wwwroot.
'/mod/sloodle');
/** The data path for the root of the Sloodle folder. */
define('SLOODLE_DIRROOT', $CFG->dirroot.
'/mod/sloodle');
/** The data path for the root of the Sloodle library folder. */
define('SLOODLE_LIBROOT', $CFG->dirroot.
'/mod/sloodle/lib');
/** The Sloodle version number. */
define('SLOODLE_VERSION', 0.3); // This is the release version, not the module version (which is in version.php)
//---------------------------------------------------------------------
/** The name of the HTTP parameter which can be used to activate Sloodle debug mode. */
define('SLOODLE_DEBUG_MODE_PARAM_NAME', 'sloodledebug');
// Check if debug mode is active
$sloodle_debug =
'false';
if (strcasecmp($sloodle_debug, 'true') ==
0 ||
$sloodle_debug ==
'1') {
define('SLOODLE_DEBUG', true);
define('SLOODLE_DEBUG', false);
// Apply the effects of debug mode
// Report all errors and warnings
// Debug mode is NOT active. Are we in a linker script?
// Yes - suppress the display of messages
//@error_reporting(0); // Possibly don't do this - it may interfere with log files?
* Outputs messages if in debug mode.
* @param string $msg The debug message to output
//---------------------------------------------------------------------
// Types of Sloodle module
// These correspond to the "type" field in the "Sloodle" DB table
// Each name should be lower-case letters only (max 50)
// The full name should be specified in the appropriate language file, as "moduletype:type".
// Each course needs to have at least one Sloodle Access Controller before it can be accessed from in-world.
// This is what grants access to the course as a whole, and sets prim passwords.
define('SLOODLE_TYPE_CTRL', 'controller');
// These are the regular module types
define('SLOODLE_TYPE_DISTRIB', 'distributor');
// Store the types in an array (used in lists)
$SLOODLE_TYPES =
array();
//---------------------------------------------------------------------
// Access level constants
/** Indicates that anybody may access an object in-world. */
define('SLOODLE_OBJECT_ACCESS_LEVEL_PUBLIC', 0);
/** Indicates that only the owner may access an object in-world. */
define('SLOODLE_OBJECT_ACCESS_LEVEL_OWNER', 1);
/** Indicates that only in-world group-members may access an object in-world. */
define('SLOODLE_OBJECT_ACCESS_LEVEL_GROUP', 2);
/** Indicates that anybody may access a server resource (still requires an authenticated request). */
define('SLOODLE_SERVER_ACCESS_LEVEL_PUBLIC', 0);
/** Indicates that only those registered and enrolled in a specific course may access a server resource. */
define('SLOODLE_SERVER_ACCESS_LEVEL_COURSE', 1);
/** Indicates that only those registered on the site may access a server resource. */
define('SLOODLE_SERVER_ACCESS_LEVEL_SITE', 2);
/** Indicates that only those with Sloodle staff status on a course may access a server resource. */
define('SLOODLE_SERVER_ACCESS_LEVEL_STAFF', 3);
//---------------------------------------------------------------------
Documentation generated on Mon, 07 Jul 2008 12:33:16 +0100 by phpDocumentor 1.4.0