[svn r10063] replace $courseTablePrefix with $_configuration['table_prefix']

skala
Patrick Cool 18 years ago
parent f8a6334c66
commit d7f00fde42
  1. 4
      main/calendar/agenda.inc.php
  2. 8
      main/calendar/myagenda.php
  3. 22
      main/inc/lib/add_course.lib.inc.php
  4. 11
      main/inc/lib/course.lib.php
  5. 2
      main/inc/lib/database.lib.php
  6. 2
      main/inc/local.inc.php
  7. 7
      main/install/configuration.dist.php
  8. 6
      main/install/update_db.inc.php

@ -1,4 +1,4 @@
<?php //$Id: agenda.inc.php 9984 2006-11-15 00:35:05Z pcool $
<?php //$Id: agenda.inc.php 10063 2006-11-20 19:52:42Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -62,7 +62,7 @@ $MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang
*/
function get_kalender_items($month, $year)
{
global $courseTablePrefix, $dbGlu;
global $dbGlu;
global $_user, $_course;
global $is_allowedToEdit;

@ -319,7 +319,7 @@ Display :: display_footer();
// This function retrieves all the agenda items of all the course of the user
function get_agendaitems($rootWeb, $courses_dbs, $month, $year)
{
global $courseTablePrefix, $dbGlu;
global $dbGlu;
global $_user;
$items = array ();
// get agenda-items for every course
@ -627,7 +627,7 @@ function display_daycalendar($agendaitems, $day, $month, $year, $weekdaynames, $
global $DaysShort, $DaysLong;
global $MonthsLong;
global $query;
global $courseTablePrefix, $dbGlu;
global $dbGlu;
// some debug information
// echo "dag: ".$day;
// echo "maand: ".$month;
@ -702,7 +702,7 @@ function display_daycalendar($agendaitems, $day, $month, $year, $weekdaynames, $
// show the monthcalender of the given month
function get_day_agendaitems($rootWeb, $courses_dbs, $month, $year, $day)
{
global $courseTablePrefix, $dbGlu;
global $dbGlu;
global $_user;
$items = array ();
@ -803,7 +803,7 @@ function get_day_agendaitems($rootWeb, $courses_dbs, $month, $year, $day)
============================================================================*/
function get_week_agendaitems($rootWeb, $courses_dbs, $month, $year, $week = '')
{
global $courseTablePrefix, $dbGlu;
global $dbGlu;
global $TABLEAGENDA, $TABLE_ITEMPROPERTY;
global $_user;
$items = array ();

@ -83,7 +83,7 @@ function create_course($wanted_code, $title, $tutor_name, $category_code, $cours
*/
function define_course_keys($wantedCode, $prefix4all = "", $prefix4baseName = "", $prefix4path = "", $addUniquePrefix = false, $useCodeInDepedentKeys = true)
{
global $rootSys, $coursesRepositoryAppend, $prefixAntiNumber, $singleDbEnabled, $mainDbName, $courseTablePrefix, $dbGlu;
global $rootSys, $coursesRepositoryAppend, $prefixAntiNumber, $_configuration, $mainDbName, $dbGlu;
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
@ -154,9 +154,9 @@ function define_course_keys($wantedCode, $prefix4all = "", $prefix4baseName = ""
$finalSuffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4);
}
if($singleDbEnabled)
if($_configuration['single_database'])
{
$query = "SHOW TABLES FROM `$mainDbName` LIKE '$courseTablePrefix$keysCourseDbName$dbGlu%'";
$query = "SHOW TABLES FROM `$mainDbName` LIKE '".$_configuration['table_prefix']."$keysCourseDbName$dbGlu%'";
$result = api_sql_query($query, __FILE__, __LINE__);
}
else
@ -250,12 +250,14 @@ function prepare_course_repository($courseRepository, $courseId)
function update_Db_course($courseDbName)
{
global $singleDbEnabled, $courseTablePrefix, $dbGlu;
global $_configuration, $dbGlu;
if(!$singleDbEnabled)
if(!$_configuration['single_database'])
{
api_sql_query("CREATE DATABASE IF NOT EXISTS `" . $courseDbName . "`", __FILE__, __LINE__);
}
$courseDbName = $courseTablePrefix.$courseDbName.$dbGlu;
$courseDbName = $_configuration['table_prefix'].$courseDbName.$dbGlu;
$tbl_course_homepage = $courseDbName . "tool";
$TABLEINTROS = $courseDbName . "tool_intro";
@ -1344,9 +1346,9 @@ function lang2db($string)
*/
function fill_Db_course($courseDbName, $courseRepository, $language)
{
global $singleDbEnabled, $courseTablePrefix, $dbGlu, $clarolineRepositoryWeb, $clarolineRepositorySys, $_user;
global $_configuration, $dbGlu, $clarolineRepositoryWeb, $clarolineRepositorySys, $_user;
$courseDbName = $courseTablePrefix.$courseDbName.$dbGlu;
$courseDbName = $_configuration['table_prefix'].$courseDbName.$dbGlu;
$tbl_course_homepage = $courseDbName . "tool";
$TABLEINTROS = $courseDbName . "tool_intro";
@ -1622,11 +1624,11 @@ function string2binary($variable)
*/
function register_course($courseSysCode, $courseScreenCode, $courseRepository, $courseDbName, $titular, $category, $title, $course_language, $uidCreator, $expiration_date = "")
{
GLOBAL $defaultVisibilityForANewCourse, $langCourseDescription, $langProfessor, $langAnnouncementEx, $error_msg, $courseTablePrefix, $dbGlu;
GLOBAL $defaultVisibilityForANewCourse, $langCourseDescription, $langProfessor, $langAnnouncementEx, $error_msg, $_configuration, $dbGlu;
$TABLECOURSE = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLECOURSUSER = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
#$TABLEANNOUNCEMENTS=$courseTablePrefix.$courseDbName.$dbGlu.$TABLEANNOUNCEMENTS;
#$TABLEANNOUNCEMENTS=$_configuration['table_prefix'].$courseDbName.$dbGlu.$TABLEANNOUNCEMENTS;
$TABLEANNOUNCEMENTS = Database :: get_course_table(ANNOUNCEMENT_TABLE,$courseDbName);
$okForRegisterCourse = true;

@ -1273,7 +1273,7 @@ class CourseManager
*/
function delete_course($code)
{
global $singleDbEnabled, $courseTablePrefix, $dbGlu;
global $_configuration, $dbGlu;
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_course_class = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
@ -1306,14 +1306,14 @@ class CourseManager
$sql = "SELECT * FROM $table_course WHERE code='".$code."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
$course = mysql_fetch_object($res);
if (!$singleDbEnabled)
if (!$_configuration['single_database'])
{
$sql = "DROP DATABASE IF EXISTS ".$course->db_name;
api_sql_query($sql, __FILE__, __LINE__);
}
else
{
$db_pattern = $courseTablePrefix.$course->db_name.$dbGlu;
$db_pattern = $_configuration['table_prefix'].$course->db_name.$dbGlu;
$sql = "SHOW TABLES LIKE '$db_pattern%'";
$result = api_sql_query($sql, __FILE__, __LINE__);
while (list ($courseTable) = mysql_fetch_row($result))
@ -1344,8 +1344,9 @@ class CourseManager
*/
function create_database_dump($course_code)
{
global $singleDbEnabled;
if ($singleDbEnabled)
global $_configuration;
if ($_configuration['single_database'])
{
return;
}

@ -457,7 +457,7 @@ class Database
$_course['sysCode' ] = $cData['code' ]; // use as key in db
$_course['path' ] = $cData['directory' ]; // use as key in path
$_course['dbName' ] = $cData['db_name' ]; // use as key in db list
$_course['dbNameGlu' ] = $courseTablePrefix . $cData['dbName'] . $dbGlu; // use in all queries
$_course['dbNameGlu' ] = $_configuration['table_prefix'] . $cData['dbName'] . $dbGlu; // use in all queries
$_course['titular' ] = $cData['tutor_name' ];
$_course['language' ] = $cData['course_language' ];
$_course['extLink' ]['url' ] = $cData['department_url' ];

@ -469,7 +469,7 @@ if (isset($cidReset) && $cidReset) // course session data refresh requested or e
$_course['sysCode' ] = $cData['code' ]; // use as key in db
$_course['path' ] = $cData['directory' ]; // use as key in path
$_course['dbName' ] = $cData['db_name' ]; // use as key in db list
$_course['dbNameGlu' ] = $courseTablePrefix . $cData['db_name'] . $dbGlu; // use in all queries
$_course['dbNameGlu' ] = $_configuration['table_prefix'] . $cData['db_name'] . $dbGlu; // use in all queries
$_course['titular' ] = $cData['tutor_name' ];
$_course['language' ] = $cData['course_language' ];
$_course['extLink' ]['url' ] = $cData['department_url' ];

@ -65,10 +65,9 @@ $_configuration['db_password'] = '{DATABASE_PASSWORD}';
// Is tracking enabled?
$_configuration['tracking_enabled'] = {TRACKING_ENABLED};
// Is single database enabled (DO NOT MODIFY THIS)
$singleDbEnabled = {SINGLE_DATABASE};
// Prefix for course tables (IF NOT EMPTY, can be replaced by another prefix,
// else leave empty)
$courseTablePrefix = '{COURSE_TABLE_PREFIX}';
$_configuration['single_database'] = {SINGLE_DATABASE};
// Prefix for course tables (IF NOT EMPTY, can be replaced by another prefix, else leave empty)
$_configuration['table_prefix'] = '{COURSE_TABLE_PREFIX}';
// Separator between database and table name (DO NOT MODIFY THIS)
$dbGlu = '{DATABASE_GLUE}';
// prefix all created bases (for courses) with this string

@ -59,7 +59,7 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
if ($singleDbForm)
{
$courseTablePrefix = get_config_param('courseTablePrefix');
$_configuration['table_prefix'] = get_config_param('courseTablePrefix');
}
$dbScormForm = eregi_replace('[^a-z0-9_-]', '', $dbScormForm);
@ -449,9 +449,9 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
{
if ($singleDbForm)
{
$prefix = $courseTablePrefix.$mysql_base_course.$dbGlu;
$prefix = $_configuration['table_prefix'].$mysql_base_course.$dbGlu;
$mysql_base_course = $dbNameForm.'`.`'.$courseTablePrefix.$mysql_base_course;
$mysql_base_course = $dbNameForm.'`.`'.$_configuration['table_prefix'].$mysql_base_course;
}
else
{

Loading…
Cancel
Save