$this->does_generate = ACTION_GENERATE_HTML;
/// These are always here
- global $CFG, $XMLDB, $db, $DB;
+ global $CFG, $XMLDB, $DB;
$dbman = $DB->get_manager();
$dbfamily = $DB->get_dbfamily();
//in backup_ids when restoring in a existing course
function restore_create_sections(&$restore, $xml_file) {
- global $CFG,$db;
+ global $CFG;
$status = true;
//Check it exists
//Called to set up any course-format specific data that may be in the file
function restore_set_format_data($restore,$xml_file) {
- global $CFG,$db;
+ global $CFG;
$status = true;
//Check it exists
//about each incidence
function restore_create_metacourse($restore,$xml_file) {
- global $CFG,$db;
+ global $CFG;
$status = true;
//Check it exists
//user_course_creators and user_admins from xml
function restore_create_users($restore,$xml_file) {
- global $CFG, $db;
+ global $CFG;
require_once ($CFG->dirroot.'/tag/lib.php');
$status = true;
//from xml
function restore_create_questions($restore,$xml_file) {
- global $CFG, $db;
+ global $CFG;
$status = true;
//Check it exists
//This function creates all the scales
function restore_create_scales($restore,$xml_file) {
- global $CFG, $db;
+ global $CFG;
$status = true;
//Check it exists
//This function creates all the course events
function restore_create_events($restore,$xml_file) {
- global $CFG, $db;
+ global $CFG;
$status = true;
//Check it exists
//Depending what has been selected.
function restore_create_logs($restore,$xml_file) {
- global $CFG,$db;
+ global $CFG;
//Number of records to get in every chunk
$recordset_size = 4;
/// Get the authoritative list of enrolments from the external database table
/// We're using the ADOdb functions natively here and not our datalib functions
- /// because we didn't want to mess with the $db global
+ /// because we didn't want to mess with the $ db global
$useridfield = $enroldb->quote($user->{$CFG->enrol_localuserfield});
*
* @uses $CFG
* @uses $USER
- * @uses $db
* @uses $REMOTE_ADDR
* @uses SITEID
* @param int $courseid The course id
* @return object results encapsulated in one environment_result object
*/
function environment_check_unicode($version) {
- global $db, $DB;
+ global $DB;
$result = new environment_results('unicode');
* On success it prints a continue link. On failure it prints an error.
*
* @uses $CFG
- * @uses $db to do something really evil with the debug setting that should probably be eliminated. TODO!
* @param string $continueto a URL passed to print_continue() if the local upgrades succeed.
*/
function upgrade_local_db($continueto) {
- global $CFG, $db;
+ global $CFG, $DB;
// if we don't have code version or a db upgrade file, just return true, we're unneeded
if (!file_exists($CFG->dirroot.'/local/version.php') || !file_exists($CFG->dirroot.'/local/db/upgrade.php')) {
* | |
* |________________________________________________|
*
- * @uses $db
* @param string $HTTP_RAW_POST_DATA The XML that the client sent
* @return string The XMLRPC payload.
*/
* Display all the submissions ready for grading
*/
function display_submissions($message='') {
- global $CFG, $db, $USER;
+ global $CFG, $DB, $USER;
require_once($CFG->libdir.'/gradelib.php');
/* first we check to see if the form has just been submitted
// Read the records from the given file.
// Perform a simple field count check for each record.
function data_get_records_csv($filename, $fielddelimiter=',', $fieldenclosure="\n") {
- global $db;
+ global $DB;
if (empty($fielddelimiter)) {
$fielddelimiter = ',';
function data_restore_files ($old_data_id, $new_data_id, $old_field_id, $new_field_id, $old_record_id, $new_record_id, $recinfo, $restore) {
-
- global $CFG, $db;
+ global $CFG, $DB;
$status = true;
$todo = false;
* Sets the last post for a given discussion
**/
function forum_discussion_update_last_post($discussionid) {
- global $CFG, $db;
+ global $CFG, $DB;
// Check the given discussion exists
if (!record_exists('forum_discussions', 'id', $discussionid)) {
function forum_restore_mods($mod,$restore) {
- global $CFG,$db;
+ global $CFG,$DB;
$status = true;
function hotpot_add_attempt($hotpotid) {
- global $db, $CFG, $USER;
+ global $DB, $CFG, $USER;
// get start time of this attempt
$time = time();
* Display the report.
*/
function display($quiz, $cm, $course) {
- global $CFG, $db;
+ global $CFG, $DB;
// Define some strings
$strreallydel = addslashes(get_string('deleteattemptcheck','quiz'));
$strtimeformat = get_string('strftimedatetime');
function survey_get_template_name($templateid) {
- global $db;
+ global $DB;
if ($templateid) {
if ($ss = get_record("surveys", "id", $templateid)) {
function survey_print_multi($question) {
- global $USER, $db, $qnum, $checklist;
+ global $USER, $DB, $qnum, $checklist;
$stripreferthat = get_string("ipreferthat", "survey");
$strifoundthat = get_string("ifoundthat", "survey");
function survey_print_single($question) {
- global $db, $qnum;
+ global $DB, $qnum;
$rowclass = survey_question_rowclass(0);
function survey_restore_mods($mod,$restore) {
- global $CFG,$db;
+ global $CFG,$DB;
$status = true;
#-- analyze and print settings and misconfigurations
$pf_db = $ewiki_plugins["database"][0];
- $db = substr($pf_db, strrpos($pf_db, "_") + 1);
+ $xdb = substr($pf_db, strrpos($pf_db, "_") + 1);
$o .= '<table border="0" width="90%" class="diagnosis">';
$o .= '<tr><td>DatabaseBackend</td><td>';
- $o .= "<b>" . $db . "</b><br />";
- if ($db == "files") {
+ $o .= "<b>" . $xdb . "</b><br />";
+ if ($xdb == "files") {
$o .= "<small>_DBFILES_DIR='</small><tt>" . EWIKI_DBFILES_DIRECTORY . "'</tt>";
if (strpos(EWIKI_DBFILES_DIRECTORY, "tmp")) {
$o .= "<br /><b>Warning</b>: Storing your pages into a temporary directory is not what you want (there they would get deleted randomly), except for testing purposes of course. See the README.";
* @deprecated Database is installed at install and should not be dropped out
*/
public function checkDB() {
- global $CFG, $db;
+ global $CFG, $DB;
$sqlfile = "{$CFG->dirroot}/search/db/$CFG->dbtype.sql";
$ret = false;
* @uses db, CFG
*/
public function addDocument($document=null) {
- global $db, $CFG;
+ global $DB, $CFG;
if ($document == null) {
return false;
* @uses db
*/
public function delDocument($document) {
- global $db;
+ global $DB;
delete_records(SEARCH_DATABASE_TABLE, 'id', $document->dbid);
}