[svn r12502] correct nomenclatura

skala
Patrick Cool 19 years ago
parent 7de9fd82cb
commit b35deb5649
  1. 76
      main/admin/add_courses_to_session.php
  2. 98
      main/admin/add_users_to_session.php
  3. 36
      main/admin/resume_session.php
  4. 60
      main/admin/session_export.php
  5. 208
      main/admin/session_import.php
  6. 2
      main/blog/blog.php
  7. 2
      main/blog/blog_admin.php
  8. 14
      main/dropbox/dropbox_config.inc.php
  9. 2
      main/dropbox/dropbox_download.php
  10. 2
      main/dropbox/dropbox_functions.inc.php
  11. 444
      main/inc/lib/surveymanager.lib.php
  12. 22
      main/lang/english_org/admin.inc.php
  13. 4
      main/lang/english_org/announcements.inc.php
  14. 32
      main/lang/english_org/bbimport.inc.php
  15. 2
      main/lang/french_org/announcements.inc.php
  16. 4
      main/lang/french_org/registration.inc.php
  17. 46
      main/newscorm/document.php
  18. 24
      main/newscorm/lp_list.php
  19. 38
      main/newscorm/scorm.lib.php
  20. 42
      main/newscorm/scorm_admin.php

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
@ -27,7 +27,7 @@
==============================================================================
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file='admin';
// resetting the course id
@ -78,23 +78,23 @@ if($_POST['formSent'])
{
$CourseList=array();
}
$nbr_courses=0;
$nbr_courses=0;
$id_coach = api_sql_query("SELECT id_coach FROM $tbl_session WHERE id=$id_session");
$id_coach = mysql_fetch_array($id_coach);
$id_coach = $id_coach[0];
$rs = api_sql_query("SELECT course_code FROM $tbl_session_rel_course WHERE id_session=$id_session");
$existingCourses = api_store_result($rs);
$existingCourses = api_store_result($rs);
$sql="SELECT id_user
FROM $tbl_session_rel_user
WHERE id_session = $id_session";
$result=api_sql_query($sql,__FILE__,__LINE__);
$UserList=api_store_result($result);
foreach($CourseList as $enreg_course)
{
$exists = false;
@ -104,18 +104,18 @@ if($_POST['formSent'])
{
$exists=true;
}
}
}
if(!$exists)
{
{
api_sql_query("INSERT INTO $tbl_session_rel_course(id_session,course_code, id_coach) VALUES('$id_session','$enreg_course','$id_coach')",__FILE__,__LINE__);
$nbr_users=0;
foreach($UserList as $enreg_user)
{
$enreg_user = $enreg_user['id_user'];
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_course_rel_user(id_session,course_code,id_user) VALUES('$id_session','$enreg_course','$enreg_user')",__FILE__,__LINE__);
if(mysql_affected_rows())
{
$nbr_users++;
@ -123,14 +123,14 @@ if($_POST['formSent'])
}
api_sql_query("UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'",__FILE__,__LINE__);
}
}
foreach($existingCourses as $existingCourse) {
if(!in_array($existingCourse['course_code'], $CourseList)){
api_sql_query("DELETE FROM $tbl_session_rel_course WHERE course_code='".$existingCourse['course_code']."' AND id_session=$id_session");
api_sql_query("DELETE FROM $tbl_session_rel_course_rel_user WHERE course_code='".$existingCourse['course_code']."' AND id_session=$id_session");
}
}
$nbr_courses=count($CourseList);
@ -138,13 +138,13 @@ if($_POST['formSent'])
if(isset($_GET['add']))
header('Location: add_users_to_session.php?id_session='.$id_session.'&add=true');
else
else
header('Location: resume_session.php?id_session='.$id_session);
//header('Location: '.$_GET['page'].'?id_session='.$id_session);
}
Display::display_header($tool_name);
@ -153,7 +153,7 @@ api_display_tool_title($tool_name);
$sql="SELECT code, title, visual_code, id_session
FROM $tbl_course
FROM $tbl_course
LEFT JOIN $tbl_session_rel_course
ON code = course_code
ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title";
@ -165,14 +165,14 @@ $nosessionCourses = $sessionCourses = array();
foreach($Courses as $course)
if($course['id_session'] == $id_session)
if($course['id_session'] == $id_session)
$sessionCourses[$course['code']] = $course ;
foreach($Courses as $course)
if(empty($sessionCourses[$course['code']]) && empty($nosessionCourses[$course['code']]))
$nosessionCourses[$course['code']] = $course ;
unset($Courses);
?>
@ -189,7 +189,7 @@ if(!empty($errorMsg))
<table border="0" cellpadding="5" cellspacing="0" width="100%" align="center">
<tr>
<td width="45%" align="center"><b><?php echo get_lang('CourseListInPlatform') ?> :</b></td>
<td width="10%">&nbsp;</td>
<td align="center" width="45%"><b><?php echo get_lang('CourseListInSession') ?> :</b></td>
</tr>
@ -249,30 +249,30 @@ unset($sessionCourses);
<script type="text/javascript">
<!--
function moveItem(origin , destination){
for(var i = 0 ; i<origin.options.length ; i++) {
if(origin.options[i].selected) {
if(origin.options[i].selected) {
destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
origin.options[i]=null;
origin.options[i]=null;
i = i-1;
}
}
destination.selectedIndex = -1;
sortOptions(destination.options);
}
function sortOptions(options) {
function sortOptions(options) {
newOptions = new Array();
for (i = 0 ; i<options.length ; i++)
newOptions[i] = options[i];
newOptions = newOptions.sort(mysort);
newOptions = newOptions.sort(mysort);
options.length = 0;
for(i = 0 ; i < newOptions.length ; i++)
options[i] = newOptions[i];
}
function mysort(a, b){
@ -289,7 +289,7 @@ function valide(){
var options = document.getElementById('destination').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
document.forms.formulaire.submit();
}
-->

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
@ -27,7 +27,7 @@
==============================================================================
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file='admin';
// resetting the course id
@ -89,7 +89,7 @@ if($_POST['formSent'])
while($row = mysql_fetch_array($result)){
$existingUsers[] = $row['id_user'];
}
$result=api_sql_query("SELECT course_code FROM $tbl_session_rel_course WHERE id_session='$id_session'",__FILE__,__LINE__);
$CourseList=array();
@ -98,7 +98,7 @@ if($_POST['formSent'])
{
$CourseList[]=$row['course_code'];
}
foreach($CourseList as $enreg_course)
{
$nbr_users=0;
@ -106,7 +106,7 @@ if($_POST['formSent'])
{
if(!in_array($enreg_user, $existingUsers)){
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_course_rel_user(id_session,course_code,id_user) VALUES('$id_session','$enreg_course','$enreg_user')",__FILE__,__LINE__);
if(mysql_affected_rows())
{
$nbr_users++;
@ -117,7 +117,7 @@ if($_POST['formSent'])
if(!in_array($existing_user, $UserList)){
$sql = "DELETE FROM $tbl_session_rel_course_rel_user WHERE id_session='$id_session' AND course_code='$enreg_course' AND id_user='$existing_user'";
api_sql_query($sql);
if(mysql_affected_rows())
{
$nbr_users--;
@ -128,24 +128,24 @@ if($_POST['formSent'])
$rs = api_sql_query($sql, __FILE__, __LINE__);
list($nbr_users) = mysql_fetch_array($rs);
api_sql_query("UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'",__FILE__,__LINE__);
}
api_sql_query("DELETE FROM $tbl_session_rel_user WHERE id_session = $id_session");
$nbr_users = 0;
foreach($UserList as $enreg_user){
$nbr_users++;
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_user(id_session, id_user) VALUES('$id_session','$enreg_user')",__FILE__,__LINE__);
}
$nbr_users = count($UserList);
api_sql_query("UPDATE $tbl_session SET nbr_users= $nbr_users WHERE id='$id_session' ",__FILE__,__LINE__);
//if(empty($_GET['add']))
//header('Location: '.$_GET['page'].'?id_session='.$id_session);
//else
header('Location: resume_session.php?id_session='.$id_session);
}
}
@ -163,7 +163,7 @@ $Classes=api_store_result($result);
foreach($Classes as $classe)
if($classe['id_session'] == $id_session)
$sessionClassesList[$classe['id']] = $classe ;
foreach($Classes as $classe)
if(empty($sessionClassesList[$classe['user_id']]) && empty($nosessionClassesList[$classe['user_id']]))
$nosessionClassesList[$classe['id']] = $classe ;
@ -171,7 +171,7 @@ foreach($Classes as $classe)
//users
$sql="SELECT user_id, lastname, firstname, username, id_session
FROM $tbl_user
FROM $tbl_user
LEFT JOIN $tbl_session_rel_user
ON $tbl_session_rel_user.id_user = $tbl_user.user_id
ORDER BY lastname,firstname,username";
@ -181,15 +181,15 @@ $result=api_sql_query($sql,__FILE__,__LINE__);
$Users=api_store_result($result);
foreach($Users as $user)
if($user['id_session'] == $id_session)
if($user['id_session'] == $id_session)
$sessionUsersList[$user['user_id']] = $user ;
foreach($Users as $user)
if(empty($sessionUsersList[$user['user_id']]) && empty($nosessionUsersList[$user['user_id']]))
$nosessionUsersList[$user['user_id']] = $user ;
?>
@ -219,20 +219,20 @@ if(!empty($errorMsg))
<td align="center">
<div id="content_source">
<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:300px;">
<?php
foreach($nosessionUsersList as $enreg)
{
?>
<option value="<?php echo $enreg['user_id']; ?>"><?php echo $enreg['lastname'].' '.$enreg['firstname'].' ('.$enreg['username'].')'; ?></option>
<?php
}
unset($nosessionUsersList);
?>
</select>
</div>
</td>
@ -267,7 +267,7 @@ unset($sessionUsersList);
<?php
if(isset($_GET['add']))
echo '<input type="button" value="'.get_lang("FinishSessionCreation").'" onclick="valide()" />';
else
else
echo '<input type="button" value="'.get_lang('Ok').'" onclick="valide()" />';
?>
</td>
@ -282,30 +282,30 @@ unset($sessionUsersList);
<script type="text/javascript">
<!--
function moveItem(origin , destination){
for(var i = 0 ; i<origin.options.length ; i++) {
if(origin.options[i].selected) {
destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
origin.options[i]=null;
origin.options[i]=null;
i = i-1;
}
}
destination.selectedIndex = -1;
sortOptions(destination.options);
}
function sortOptions(options) {
function sortOptions(options) {
newOptions = new Array();
for (i = 0 ; i<options.length ; i++)
newOptions[i] = options[i];
newOptions = newOptions.sort(mysort);
newOptions = newOptions.sort(mysort);
options.length = 0;
for(i = 0 ; i < newOptions.length ; i++)
options[i] = newOptions[i];
}
function mysort(a, b){
@ -332,34 +332,34 @@ function valide(){
function loadUsersInSelect(select){
var xhr_object = null;
if(window.XMLHttpRequest) // Firefox
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // Internet Explorer
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
//xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
var xhr_object = null;
if(window.XMLHttpRequest) // Firefox
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // Internet Explorer
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
//xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
xhr_object.open("POST", "loadUsersInSelect.ajax.php");
xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
nosessionUsers = makepost(document.getElementById('origin_users'));
sessionUsers = makepost(document.getElementById('destination_users'));
nosessionClasses = makepost(document.getElementById('origin_classes'));
sessionClasses = makepost(document.getElementById('destination_classes'));
xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
xhr_object.onreadystatechange = function() {
xhr_object.onreadystatechange = function() {
if(xhr_object.readyState == 4) {
document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
//alert(xhr_object.responseText);
}
}
}
}
function makepost(select){
@ -368,7 +368,7 @@ function makepost(select){
var ret = "";
for (i = 0 ; i<options.length ; i++)
ret = ret + options[i].value +'::'+options[i].text+";;";
return ret;
}

@ -5,7 +5,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
@ -23,10 +23,10 @@
==============================================================================
*/
/**
==============================================================================
==============================================================================
@author Bart Mollet
* @package dokeos.admin
==============================================================================
==============================================================================
*/
/*
==============================================================================
@ -70,36 +70,36 @@ if($_GET['action'] == 'delete')
$idChecked="'".implode("','",$idChecked)."'";
api_sql_query("DELETE FROM $tbl_session_rel_course WHERE id_session='$id_session' AND course_code IN($idChecked)",__FILE__,__LINE__);
$nbr_affected_rows=mysql_affected_rows();
api_sql_query("DELETE FROM $tbl_session_rel_course_rel_user WHERE id_session='$id_session' AND course_code IN($idChecked)",__FILE__,__LINE__);
api_sql_query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'",__FILE__,__LINE__);
}
if(!empty($_GET['class'])){
api_sql_query("DELETE FROM $tbl_session_rel_class WHERE session_id='$id_session' AND class_id=".$_GET['class'],__FILE__,__LINE__);
$nbr_affected_rows=mysql_affected_rows();
api_sql_query("UPDATE $tbl_session SET nbr_classes=nbr_classes-$nbr_affected_rows WHERE id='$id_session'",__FILE__,__LINE__);
}
if(!empty($_GET['user'])){
api_sql_query("DELETE FROM $tbl_session_rel_user WHERE id_session='$id_session' AND id_user=".$_GET['user'],__FILE__,__LINE__);
$nbr_affected_rows=mysql_affected_rows();
api_sql_query("UPDATE $tbl_session SET nbr_users=nbr_users-$nbr_affected_rows WHERE id='$id_session'",__FILE__,__LINE__);
api_sql_query("DELETE FROM $tbl_session_rel_course_rel_user WHERE id_session='$id_session' AND id_user=".$_GET['user'],__FILE__,__LINE__);
$nbr_affected_rows=mysql_affected_rows();
api_sql_query("UPDATE $tbl_session_rel_course SET nbr_users=nbr_users-$nbr_affected_rows WHERE id_session='$id_session'",__FILE__,__LINE__);
}
}
}
$sql = 'SELECT name, nbr_courses, nbr_users, nbr_classes, DATE_FORMAT(date_start,"%d-%m-%Y") as date_start, DATE_FORMAT(date_end,"%d-%m-%Y") as date_end, lastname, firstname, username
FROM '.$tbl_session.'
FROM '.$tbl_session.'
LEFT JOIN '.$tbl_user.'
ON id_coach = user_id
WHERE '.$tbl_session.'.id='.$id_session;
@ -130,9 +130,9 @@ api_display_tool_title($tool_name);
<td><?php echo $session['lastname'].' '.$session['firstname'].' ('.$session['username'].')' ?></td>
</tr>
<tr>
<td><?php echo ('Dates'); ?> :</td>
<td><?php echo ('Dates'); ?> :</td>
<td>
<?php
<?php
if($session['date_start']=='00-00-0000')
echo get_lang('NoTimeLimits');
else
@ -168,7 +168,7 @@ if($session['nbr_courses']==0){
}
else {
$sql = "SELECT code,title,nbr_users, lastname, firstname, username
FROM $tbl_course,$tbl_session_rel_course
FROM $tbl_course,$tbl_session_rel_course
LEFT JOIN $tbl_user
ON $tbl_session_rel_course.id_coach = $tbl_user.user_id
WHERE course_code=code
@ -217,14 +217,14 @@ if($session['nbr_users']==0){
else {
// classe development, obsolete for the moment
$sql = 'SELECT '.$tbl_user.'.user_id, lastname, firstname, username
FROM '.$tbl_user.'
INNER JOIN '.$tbl_session_rel_user.'
ON '.$tbl_user.'.user_id = '.$tbl_session_rel_user.'.id_user
AND '.$tbl_session_rel_user.'.id_session = '.$id_session.'
ORDER BY lastname, firstname';
$result=api_sql_query($sql,__FILE__,__LINE__);
$users=api_store_result($result);
foreach($users as $user){
@ -244,11 +244,11 @@ else {
/*
==============================================================================
FOOTER
FOOTER
==============================================================================
*/
Display :: display_footer();
?>
?>

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
@ -44,8 +44,8 @@ $formSent=0;
$errorMsg='';
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
@ -73,14 +73,14 @@ if($_POST['formSent'] )
}
else
{
$sql = "SELECT id,name,username,date_start,date_end
FROM $tbl_session
$sql = "SELECT id,name,username,date_start,date_end
FROM $tbl_session
INNER JOIN $tbl_user
ON $tbl_user.user_id = $tbl_session.id_coach
WHERE id='$session_id'";
$result = api_sql_query($sql,__FILE__,__LINE__);
}
if(mysql_num_rows($result))
@ -100,10 +100,10 @@ if($_POST['formSent'] )
}
$archiveFile='export_sessions_'.$session_id.'_'.date('Y-m-d_H-i-s').'.'.$file_type;
while( file_exists($archivePath.$archiveFile))
{
$archiveFile='export_users_'.$session_id.'_'.date('Y-m-d_H-i-s').'_'.uniqid('').'.'.$file_type;
$archiveFile='export_users_'.$session_id.'_'.date('Y-m-d_H-i-s').'_'.uniqid('').'.'.$file_type;
}
$fp=fopen($archivePath.$archiveFile,'w');
@ -120,8 +120,8 @@ if($_POST['formSent'] )
while($row=mysql_fetch_array($result))
{
$add = '';
$row['name'] = str_replace(';',',',$row['name']);
$row['username'] = str_replace(';',',',$row['username']);
@ -137,13 +137,13 @@ if($_POST['formSent'] )
."\t\t<DateStart>$row[date_start]</DateStart>\n"
."\t\t<DateEnd>$row[date_end]</DateEnd>\n";
}
//users
$sql = "SELECT DISTINCT $tbl_user.username FROM $tbl_user
INNER JOIN $tbl_session_user
ON $tbl_user.user_id = $tbl_session_user.id_user
AND $tbl_session_user.id_session = '".$row['id']."'";
$rsUsers = api_sql_query($sql,__FILE__,__LINE__);
$users = '';
while($rowUsers = mysql_fetch_array($rsUsers)){
@ -156,15 +156,15 @@ if($_POST['formSent'] )
}
if(!empty($users) && $cvs)
$users = substr($users , 0, strlen($users)-1);
if($cvs)
if($cvs)
$users .= ';';
$add .= $users;
//courses
$sql = "SELECT DISTINCT $tbl_course.code, $tbl_user.username FROM $tbl_course
INNER JOIN $tbl_session_course
@ -173,10 +173,10 @@ if($_POST['formSent'] )
LEFT JOIN $tbl_user
ON $tbl_user.user_id = $tbl_session_course.id_coach";
$rsCourses = api_sql_query($sql,__FILE__,__LINE__);
$courses = '';
while($rowCourses = mysql_fetch_array($rsCourses)){
if($cvs){
$courses .= str_replace(';',',',$rowCourses['code']);
$courses .= '['.str_replace(';',',',$rowCourses['username']).'][';
@ -186,15 +186,15 @@ if($_POST['formSent'] )
$courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
$courses .= "\t\t\t<Coach>$rowCourses[username]</Coach>\n";
}
// rel user courses
$sql = "SELECT DISTINCT username
$sql = "SELECT DISTINCT username
FROM $tbl_user
INNER JOIN $tbl_session_course_user
ON $tbl_session_course_user.id_user = $tbl_user.user_id
AND $tbl_session_course_user.course_code='".$rowCourses['code']."'
AND id_session='".$row['id']."'";
$rsUsersCourse = api_sql_query($sql,__FILE__,__LINE__);
while($rowUsersCourse = mysql_fetch_array($rsUsersCourse)){
if($cvs){
@ -207,7 +207,7 @@ if($_POST['formSent'] )
if($cvs){
if(!empty($userscourse))
$userscourse = substr($userscourse , 0, strlen($userscourse)-1);
$courses .= $userscourse.']|';
}
else {
@ -217,7 +217,7 @@ if($_POST['formSent'] )
if(!empty($courses) && $cvs)
$courses = substr($courses , 0, strlen($courses)-1);
$add .= $courses;
if($cvs)
$add .= ';';
else
@ -225,7 +225,7 @@ if($_POST['formSent'] )
fputs($fp, $add);
}
if(!$cvs)
fputs($fp,"</Sessions>\n");
fclose($fp);
@ -294,8 +294,8 @@ unset($Courses);
<?php
/*
==============================================================================
FOOTER
FOOTER
==============================================================================
*/
*/
Display::display_footer();
?>

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
@ -60,21 +60,21 @@ if($_POST['formSent'])
{
if(isset($_FILES['import_file']['tmp_name']))
{
$formSent=$_POST['formSent'];
$file_type=$_POST['file_type'];
$sendMail=$_POST['sendMail']?1:0;
$sessions=array();
///////////////////////
//XML/////////////////
/////////////////////
if($file_type == 'xml')
{
$racine = simplexml_load_file($_FILES['import_file']['tmp_name']);
if(is_object($racine))
{
@ -88,17 +88,17 @@ if($_POST['formSent'])
$username = substr($username,0,20);
$isCut = 1;
}
$sql = "SELECT 1 FROM $tbl_user WHERE username='".addslashes($username)."'";
$sql = "SELECT 1 FROM $tbl_user WHERE username='".addslashes($username)."'";
$rs = api_sql_query($sql, __FILE__, __LINE__);
if(mysql_affected_rows()==0)
{
if($isCut)
{
$errorMsg .= get_lang('UsernameTooLongWasCut').' '.get_lang('From').' '.$user_name_dist.' '.get_lang('To').' '.$username.' <br />';
}
$lastname = $userNode->Lastname;
$firstname = $userNode->Firstname;
$password = $userNode->Password;
@ -112,11 +112,11 @@ if($_POST['formSent'])
{
case 'student' : $status = 5; break;
case 'teacher' : $status = 1; break;
default : $status = 5; $errorMsg = get_lang('StudentStatusWasGivenTo').' : '.$username.'<br />';
default : $status = 5; $errorMsg = get_lang('StudentStatusWasGivenTo').' : '.$username.'<br />';
}
$sql = "INSERT INTO $tbl_user SET
username = '".addslashes($username)."',
lastname = '".addslashes($lastname)."',
@ -126,9 +126,9 @@ if($_POST['formSent'])
official_code = '".addslashes($official_code)."',
phone = '".addslashes($phone)."',
status = '".addslashes($status)."'";
api_sql_query($sql, __FILE__, __LINE__);
if(mysql_affected_rows()>0 && $sendMail)
{
$emailto='"'.$firstname.' '.$lastname.'" <'.$email.'>';
@ -137,36 +137,36 @@ if($_POST['formSent'])
//#287 modifiée par Stéphane DEBIEVE - FOREM
$emailheaders='From: '.get_setting('administratorName').' '.get_setting('administratorSurname').' <'.get_setting('emailAdministrator').">\n";
$emailheaders.='Reply-To: '.get_setting('emailAdministrator');
@api_send_mail($emailto,$emailsubject,$emailbody,$emailheaders);
}
}
}
foreach($racine->Courses->Course as $courseNode)
{
$course_code = $courseNode->CourseCode;
$title = $courseNode->CourseTitle;
$description = $courseNode->CourseDescription;
$language = $courseNode->CourseLanguage;
$course_code = $courseNode->CourseCode;
$title = $courseNode->CourseTitle;
$description = $courseNode->CourseDescription;
$language = $courseNode->CourseLanguage;
$username = $courseNode->CourseTeacher;
$sql = "SELECT user_id, lastname, firstname FROM $tbl_user WHERE username='$username'";
$sql = "SELECT user_id, lastname, firstname FROM $tbl_user WHERE username='$username'";
$rs = api_sql_query($sql, __FILE__, __LINE__);
list($user_id, $lastname, $firstname) = mysql_fetch_array($rs);
$keys = define_course_keys($course_code, "", $dbNamePrefix);
$keys = define_course_keys($course_code, "", $dbNamePrefix);
if (sizeof($keys))
{
$currentCourseCode = $keys['visual_code'];
$currentCourseId = $keys["currentCourseId"];
if(empty($currentCourseCode))
$currentCourseCode = $keys['visual_code'];
$currentCourseId = $keys["currentCourseId"];
if(empty($currentCourseCode))
$currentCourseCode = $currentCourseId;
$currentCourseDbName = $keys["currentCourseDbName"];
$currentCourseRepository = $keys["currentCourseRepository"];
if($currentCourseId == strtoupper($course_code))
{
if (empty ($title))
@ -195,9 +195,9 @@ if($_POST['formSent'])
last_visit = NULL,
tutor_name = '".$lastname." ".$firstname."',
visual_code = '".$currentCourseCode."'";
api_sql_query($sql, __FILE__, __LINE__);
$sql = "INSERT INTO ".$tbl_course_user." SET
course_code = '".$currentCourseId."',
user_id = '".$user_id."',
@ -206,20 +206,20 @@ if($_POST['formSent'])
tutor_id='1',
sort='". ($sort +1)."',
user_course_cat='0'";
api_sql_query($sql, __FILE__, __LINE__);
}
}
}
foreach ($racine->Session as $sessionNode){ // foreach session
$countCourses = 0;
$countUsers = 0;
$SessionName = $sessionNode->SessionName;
$SessionName = $sessionNode->SessionName;
$Coach = $sessionNode->Coach;
if(!empty($Coach)){
$sqlCoach = "SELECT user_id FROM $tbl_user WHERE username='$Coach'";
$rsCoach = api_sql_query($sqlCoach);
@ -229,8 +229,8 @@ if($_POST['formSent'])
$errorMsg .= get_lang('UserDoesNotExist').' : '.$Coach.'<br />';
}
}
$DateStart = $sessionNode->DateStart;
$DateStart = $sessionNode->DateStart;
if(!empty($DateStart))
{
list($YearStart,$MonthStart, $DayStart) = explode('-',$DateStart);
@ -239,12 +239,12 @@ if($_POST['formSent'])
$errorMsg .= get_lang('WrongDate').' : '.$DateStart.'<br />';
break;
}
else
else
{
$timeStart = mktime(0,0,0,$MonthStart,$DayStart,$YearStart);
}
$DateEnd = $sessionNode->DateEnd;
$DateEnd = $sessionNode->DateEnd;
if(!empty($DateStart))
{
list($YearEnd,$MonthEnd, $DayEnd) = explode('-',$DateEnd);
@ -253,7 +253,7 @@ if($_POST['formSent'])
$errorMsg .= get_lang('WrongDate').' : '.$DateEnd.'<br />';
break;
}
else
else
{
$timeEnd = mktime(0,0,0,$MonthEnd,$DayEnd,$YearEnd);
}
@ -263,8 +263,8 @@ if($_POST['formSent'])
$errorMsg .= get_lang('DateStartMoreThanDateEnd').' : '.$DateEnd.'<br />';
}
}
// verify that session doesn't exist
while(!$uniqueName)
{
@ -272,7 +272,7 @@ if($_POST['formSent'])
$suffix = ' - '.$i;
$sql = 'SELECT 1 FROM '.$tbl_session.' WHERE name="'.addslashes($SessionName.$suffix).'"';
$rs = api_sql_query($sql, __FILE__, __LINE__);
if(mysql_result($rs,0,0))
{
$i++;
@ -282,8 +282,8 @@ if($_POST['formSent'])
$uniqueName = true;
$SessionName .= $suffix;
}
}
}
$sqlSession = "INSERT IGNORE INTO $tbl_session SET
name = '$SessionName',
id_coach = '$CoachId',
@ -291,34 +291,34 @@ if($_POST['formSent'])
date_end = '$DateEnd'";
$rsSession = api_sql_query($sqlSession, __FILE__, __LINE__);
$session_id = mysql_insert_id();
foreach ($sessionNode->User as $userNode){
$username = substr($userNode->nodeValue(),0,20);
$username = substr($userNode->nodeValue(),0,20);
$sqlUser = "SELECT user_id FROM $tbl_user WHERE username='".addslashes($username)."'";
$rsUser = api_sql_query($sqlUser);
list($user_id) = (mysql_fetch_array($rsUser));
if(!empty($user_id)){
$sql = "INSERT INTO $tbl_session_user SET
$sql = "INSERT INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rsUser = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_affected_rows()){
$countUsers++;
}
}
}
}
foreach($sessionNode->Course as $courseNode){
$CourseCode = $courseNode->CourseCode;
// verify that the course pointed by the course code node exists
$sql = 'SELECT 1 FROM '.$tbl_course.' WHERE code="'.mysql_escape_string($CourseCode).'"';
$rs = api_sql_query($sql, __FILE__, __LINE__);
if(mysql_num_rows($rs)>0)
{ // if the course exists we continue
$Coach = substr($courseNode->Coach,0,20);
$Coach = substr($courseNode->Coach,0,20);
if(!empty($Coach)){
$sqlCoach = "SELECT user_id FROM $tbl_user WHERE username='$Coach'";
$rsCoach = api_sql_query($sqlCoach,__FILE__,__LINE__);
@ -331,7 +331,7 @@ if($_POST['formSent'])
else {
$Coach = '';
}
$sqlCourse = "INSERT INTO $tbl_session_course SET
course_code = '$CourseCode',
id_coach='$CoachId',
@ -339,7 +339,7 @@ if($_POST['formSent'])
$rsCourse = api_sql_query($sqlCourse,__FILE__,__LINE__);
if(mysql_affected_rows()){
$countCourses++;
$countUsersCourses = 0;
foreach ($courseNode->User as $userNode){
$username = substr($userNode,0,20);
@ -348,15 +348,15 @@ if($_POST['formSent'])
list($user_id) = (mysql_fetch_array($rsUser));
if(!empty($user_id))
{
$sql = "INSERT IGNORE INTO $tbl_session_user SET
$sql = "INSERT IGNORE INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
if(mysql_affected_rows())
$countUsers++;
$rsUser = api_sql_query($sql,__FILE__,__LINE__);
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='$CourseCode',
id_session = '$session_id'";
@ -368,35 +368,35 @@ if($_POST['formSent'])
{
$errorMsg .= get_lang('UserDoesNotExist').' : '.$username.'<br />';
}
}
api_sql_query("UPDATE $tbl_session_course SET nbr_users='$countUsersCourses' WHERE course_code='$CourseCode'",__FILE__,__LINE__);
}
api_sql_query("UPDATE $tbl_session_course SET nbr_users='$countUsersCourses' WHERE course_code='$CourseCode'",__FILE__,__LINE__);
}
}
else
else
{ // if the course does not exists
$errorMsg .= get_lang('CourseDoesNotExist').' : '.$CourseCode.'<br />';
}
}
api_sql_query("UPDATE $tbl_session SET nbr_users='$countUsers', nbr_courses='$countCourses' WHERE id='$session_id'",__FILE__,__LINE__);
}
}
else
{
$errorMsg .= get_lang('XMLNotValid');
}
}
/////////////////////
// CSV /////////////
///////////////////
else
{
$content=file($_FILES['import_file']['tmp_name']);
@ -406,13 +406,13 @@ if($_POST['formSent'])
}
else
{
$tag_names=array();
foreach($content as $key=>$enreg)
{
$enreg=explode(';',trim($enreg));
if($key)
{
foreach($tag_names as $tag_key=>$tag_name)
@ -426,16 +426,16 @@ if($_POST['formSent'])
{
$tag_names[]=eregi_replace('[^a-z0-9_-]','',$tag_name);
}
if(!in_array('SessionName',$tag_names) || !in_array('DateStart',$tag_names) || !in_array('DateEnd',$tag_names))
{
$errorMsg=get_lang('NoNeededData');
break;
}
}
}
foreach($sessions as $enreg) {
$SessionName = $enreg['SessionName'];
$DateStart = $enreg['DateStart'];
@ -448,7 +448,7 @@ if($_POST['formSent'])
else {
$Coach = '';
}
$sqlSession = "INSERT IGNORE INTO $tbl_session SET
name = '$SessionName',
id_coach = '$Coach',
@ -458,16 +458,16 @@ if($_POST['formSent'])
$update = false;
if(!mysql_affected_rows($rsSession)){
$update = true;
$sqlSession = "UPDATE $tbl_session SET
$sqlSession = "UPDATE $tbl_session SET
id_coach = '$Coach',
date_start = '$DateStart',
date_end = '$DateEnd'
WHERE name = '$SessionName'";
$rsSession = api_sql_query($sqlSession, __FILE__, __LINE__);
$session_id = api_sql_query("SELECT id FROM $tbl_session WHERE name='$SessionName'",__FILE__,__LINE__);
list($session_id) = mysql_fetch_array($session_id);
list($session_id) = mysql_fetch_array($session_id);
api_sql_query("DELETE FROM $tbl_session_user WHERE id_session='$session_id'",__FILE__,__LINE__);
api_sql_query("DELETE FROM $tbl_session_course WHERE id_session='$session_id'",__FILE__,__LINE__);
api_sql_query("DELETE FROM $tbl_session_course_user WHERE id_session='$session_id'",__FILE__,__LINE__);
@ -475,29 +475,29 @@ if($_POST['formSent'])
else {
$session_id = mysql_insert_id($rsSession);
}
$users = explode('|',$enreg['Users']);
foreach ($users as $user){
foreach ($users as $user){
$sqlUser = "SELECT user_id FROM $tbl_user WHERE username='".$user."'";
$rsUser = api_sql_query($sqlUser);
list($user_id) = (mysql_fetch_array($rsUser));
$sql = "INSERT INTO $tbl_session_user SET
$sql = "INSERT INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rsUser = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_affected_rows()){
$countUsers++;
}
}
$courses = explode('|',$enreg['Courses']);
foreach($courses as $course){
$CourseCode = substr($course,0,strpos($course,'['));
$Coach = strstr($course,'[');
$Coach = substr($Coach,1,strpos($Coach,']')-1);
if(!empty($Coach)){
$sqlCoach = "SELECT user_id FROM $tbl_user WHERE username='$Coach'";
$rsCoach = api_sql_query($sqlCoach,__FILE__,__LINE__);
@ -506,16 +506,16 @@ if($_POST['formSent'])
else {
$Coach = '';
}
$sqlCourse = "INSERT INTO $tbl_session_course SET
course_code = '$CourseCode',
id_coach='$Coach',
id_session='$session_id'";
$rsCourse = api_sql_query($sqlCourse,__FILE__,__LINE__);
if(mysql_affected_rows()){
$countCourses++;
$users = substr($course , strpos($course,'[',1)+1 , strpos($course,']',1));
$users = explode('|',$enreg['Users']);
$countUsersCourses = 0;
@ -523,19 +523,19 @@ if($_POST['formSent'])
$sqlUser = "SELECT user_id FROM $tbl_user WHERE username='".$user."'";
$rsUser = api_sql_query($sqlUser);
list($user_id) = (mysql_fetch_array($rsUser));
$sql = "INSERT INTO $tbl_session_course_user SET
$sql = "INSERT INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='$CourseCode',
id_session = '$session_id'";
$rsUsers = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_affected_rows())
$countUsersCourses++;
}
api_sql_query("UPDATE $tbl_session_course SET nbr_users='$countUsersCourses' WHERE course_code='$CourseCode'",__FILE__,__LINE__);
}
api_sql_query("UPDATE $tbl_session_course SET nbr_users='$countUsersCourses' WHERE course_code='$CourseCode'",__FILE__,__LINE__);
}
}
api_sql_query("UPDATE $tbl_session SET nbr_users='$countUsers', nbr_courses='$countCourses' WHERE id='$session_id'",__FILE__,__LINE__);
}
}
}

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors

@ -4,7 +4,7 @@
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors

@ -1,4 +1,4 @@
<?php
<?php
/*
==============================================================================
Dokeos - elearning and course management software
@ -50,19 +50,19 @@ $dropbox_cnf['tbl_feedback'] = Database::get_course_table(TABLE_DROPBOX_FEEDBAC
$dropbox_cnf["courseId"] = $_cid;
$dropbox_cnf["sysPath"] = api_get_path('SYS_COURSE_PATH') . $_course["path"] . "/dropbox"; //path to dropbox subdir in course containing the uploaded files
$dropbox_cnf["webPath"] = api_get_path('WEB_COURSE_PATH') . $_course["path"] . "/dropbox";
$dropbox_cnf["maxFilesize"] = get_setting("dropbox_max_filesize"); //file size limit as imposed by the platform admin (see Dokeos Config Settings on the platform administration section)
$dropbox_cnf["maxFilesize"] = api_get_setting("dropbox_max_filesize"); //file size limit as imposed by the platform admin (see Dokeos Config Settings on the platform administration section)
//$dropbox_cnf["version"] = "1.4";
$dropbox_cnf["allowOverwrite"] = string_2_boolean(get_setting("dropbox_allow_overwrite"));
$dropbox_cnf["allowJustUpload"] = string_2_boolean(get_setting("dropbox_allow_just_upload"));
$dropbox_cnf["allowStudentToStudent"] = string_2_boolean(get_setting("dropbox_allow_student_to_student"));
$dropbox_cnf["allowGroup"] = string_2_boolean(get_setting("dropbox_allow_group"));
$dropbox_cnf["allowOverwrite"] = string_2_boolean(api_get_setting("dropbox_allow_overwrite"));
$dropbox_cnf["allowJustUpload"] = string_2_boolean(api_get_setting("dropbox_allow_just_upload"));
$dropbox_cnf["allowStudentToStudent"] = string_2_boolean(api_get_setting("dropbox_allow_student_to_student"));
$dropbox_cnf["allowGroup"] = string_2_boolean(api_get_setting("dropbox_allow_group"));
/**
* --------------------------------------
* RH:   INITIALISE MAILING VARIABLES
* --------------------------------------
*/
$dropbox_cnf["allowMailing"] = string_2_boolean(get_setting("dropbox_allow_mailing")); // false = no mailing functionality
$dropbox_cnf["allowMailing"] = string_2_boolean(api_get_setting("dropbox_allow_mailing")); // false = no mailing functionality
$dropbox_cnf["mailingIdBase"] = 10000000; // bigger than any user_id,
// allowing enough space for pseudo_ids as uploader_id, dest_user_id, user_id:
// mailing pseudo_id = dropbox_cnf("mailingIdBase") + mailing id

@ -236,7 +236,7 @@ else
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Jan Bols
Copyright (c) Rene Haentjens

@ -757,7 +757,7 @@ function removeMoreIfMailing($file_id)
*/
function dropbox_lang($variable, $notrans = 'DLTT')
{
return (get_setting('server_type') == 'test' ?
return (api_get_setting('server_type') == 'test' ?
get_lang('dropbox_lang["'.$variable.'"]', $notrans) :
str_replace("\\'", "'", $GLOBALS['dropbox_lang'][$variable]));
}

File diff suppressed because it is too large Load Diff

@ -1,31 +1,31 @@
<?php // $Id: admin.inc.php 3402 2005-02-17 11:44:22Z olivierb78 $
<?php // $Id: admin.inc.php 12502 2007-05-29 08:06:23Z pcool $
/*
==============================================================================
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Roan Embrechts (VUB)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
*/
/*
==============================================================================
==============================================================================
This is a language translation file.
This file provides the language sentences for the admin section.
==============================================================================
==============================================================================
*/
$langOtherCategory = "Other category";

@ -4,7 +4,7 @@
Dokeos - elearning and area management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
@ -20,7 +20,7 @@
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
// GENERIC
$langModify = "modify";

@ -1,33 +1,33 @@
<?php # $Id: bbimport.inc.php 1997 2004-07-07 14:55:42Z olivierb78 $
<?php # $Id: bbimport.inc.php 12502 2007-05-29 08:06:23Z pcool $
/*
==============================================================================
==============================================================================
Dokeos - elearning and area management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Roan Embrechts (VUB)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
*/
/*
==============================================================================
==============================================================================
This is a language translation file.
This fie provides the language sentences for the Blackboard import tool.
==============================================================================
==============================================================================
*/
$langViewCourseMaterialImport = "Bekijk het cursus materiaal zoals het ge&#239;mporteerd zal worden";
@ -36,19 +36,19 @@ $langViewForumImport = "Bekijk de forums zoals ze ge&#239;mporteerd worden";
$langImportCourseMaterial = "Importeer cursusmateriaal (Blackboard module \"Area Material\")";
$langImportExternalLinks = "Importeer links (Blackboard module \"External Links\")";
$langImportForum = "Importeer forums (Blackboard module \"Discussion Board\")";
$langImportForum = "Importeer forums (Blackboard module \"Discussion Board\")";
$langToolInfo = "This tool imports Blackboard 5.5 areas (Course Material, Discussion Board, and External Links). <br>In the future it will import more modules, Blackboard 6 and WebCT areas, and normal IMS and SCORM packages.";
/*
Import area Material
*/
/*
View forum as it will be imported
View area material as it will be imported
View area material as it will be imported
View hyperlinks as they will be imported;
*/
?>

@ -4,7 +4,7 @@
Dokeos - elearning and espacee management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".

@ -1,10 +1,10 @@
<?php # $Id: registration.inc.php 1996 2004-07-07 14:53:05Z olivierb78 $
<?php # $Id: registration.inc.php 12502 2007-05-29 08:06:23Z pcool $
/*
==============================================================================
Dokeos - elearning and espacee management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".

@ -6,7 +6,7 @@
Copyright (c) 2005 Dokeos S.A.
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
@ -35,7 +35,7 @@
/**
* Script
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = "scormdocument";
@ -75,8 +75,8 @@ function confirmation (name)
// Define the 'doc.inc.php' as language file
//$nameTools = get_lang("Doc");
// When GET['learnpath_id'] is defined, it means that
// a learnpath has been chosen, so we redirect to
// When GET['learnpath_id'] is defined, it means that
// a learnpath has been chosen, so we redirect to
// learnpath_handler - we possibly lose the $dialogBox warning here
if(!empty($_GET['learnpath_id']))
{
@ -205,7 +205,7 @@ if(api_is_allowed_to_edit())
echo "<!-- upload -->",
"<p align=\"right\">",
"<form action=\"".api_get_self()."?openDir=", rawurlencode($openDir),
"<form action=\"".api_get_self()."?openDir=", rawurlencode($openDir),
"&subdirs=$subdirs\" method=\"post\" enctype=\"multipart/form-data\">",
"<input type=\"hidden\" name=\"uploadPath\" value=\"$curDirPath\" />",
get_lang('DownloadFile'),"&nbsp;:&nbsp;",
@ -221,7 +221,7 @@ if(api_is_allowed_to_edit())
{
Display::display_normal_message($dialogBox);
}
echo "<table border='0' cellspacing='2' cellpadding='4'>
<tr>
<td valign='bottom'>
@ -342,7 +342,7 @@ if ($fileList)
$urlFileName = api_get_self().'?'.api_get_cidreq().'&subdirs=yes&openDir='.$cmdFileName;
$image="<img src=\"../img/dossier.gif\" border=\"0\" hspace=\"3\" align=\"absmiddle\" alt='scorm'>";
}
if ($curDirPath) {
$sqlpath=$curDirPath."/".$fileList['name'][$fileKey]."";
} else {
@ -369,25 +369,25 @@ if ($fileList)
{
$fileExtension=explode('.',$dspFileName);
$fileExtension=strtolower($fileExtension[sizeof($fileExtension)-1]);
/* export */
echo "<td align='center'><a href='".api_get_self()."?action=exportscorm&".api_get_cidreq()."&path=".$cmdFileName."'><img src=\"../img/save_zip.gif\" border=\"0\" title=\"".get_lang('Export')."\"></a>";
/* edit title and description */
echo "<td align='center'>",
"<a href='".api_get_self()."?action=editscorm&path=".$cmdFileName."'><img src=\"../img/edit.gif\" border=\"0\" title=\"".get_lang('_edit_learnpath')."\"></a>";
/* DELETE COMMAND */
echo
"<a href=\"".api_get_self()."?delete=",$cmdFileName,"\" ",
"onClick=\"return confirmation('",addslashes($dspFileName),"');\">",
"<img src=\"../img/delete.gif\" border=\"0\" title=\"".get_lang('_delete_learnpath')."\" />",
"</a>";
/* VISIBILITY COMMAND */
if ($fileList['visibility'][$fileKey] == "i")
{
echo "<a href=\"".api_get_self()."?make_directory_visible=",$cmdFileName,"\">",
@ -400,17 +400,17 @@ if ($fileList)
"<img src=\"../img/visible.gif\" border=\"0\" title=\"".get_lang('_no_publish')."\" />",
"</a>";
}
} // end if($is_allowedToEdit)
echo "</tr>\n";
} // end each ($fileList)
}// end if ( $fileList)
//display learning paths
if (!$curDirPath) {
echo "<tr><td colspan='4'>&nbsp;</td></tr>";
$sql="select * from $tbl_learnpath_main";
$result=api_sql_query($sql,__FILE__,__LINE__);
@ -418,7 +418,7 @@ if (!$curDirPath) {
while ($row=mysql_fetch_array($result)) {
$counter++;
if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; }
$id=$row["learnpath_id"];
$sql2="SELECT * FROM $tbl_learnpath_main where learnpath_id=$id";
$result2=api_sql_query($sql2,__FILE__,__LINE__);
@ -440,11 +440,11 @@ if (!$curDirPath) {
if(api_is_allowed_to_edit()) {
//no init of $circle1 here
echo "<td align='center'><a href='".api_get_self()."?action=exportpath&id=".$row["learnpath_id"]."'><img src=\"../img/save_zip.gif\" border=\"0\" title=\"".get_lang('Export')."\"></a>";
echo "<td align='center'><a href='".api_get_self()."?action=editpath&id=".$row["learnpath_id"]."'><img src=\"../img/edit.gif\" border=\"0\" title=\"".get_lang('_edit_learnpath')."\"></a>";
echo "<a href='".api_get_self()."?action=deletepath&id=".$row["learnpath_id"]."'><img src=\"../img/delete.gif\" border=\"0\" title=\"".get_lang('_delete_learnpath')."\" onClick=\"return confirmation('".$row2['learnpath_name']."');\"></a>";
if (($row3["visibility"])=='1') {
echo "<a href='".api_get_self()."?action=publishpath&set_visibility=i&id=".$row["learnpath_id"]."'><img src=\"../img/visible.gif\" border=\"0\" alt=\"".get_lang('_no_publish')."\" title=\"".get_lang('_no_publish')."\"></a>";
} else {

@ -5,7 +5,7 @@
Copyright (c) 2004-2006 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
@ -98,7 +98,7 @@ if(api_is_allowed_to_edit())
{
Display::display_normal_message(api_failure::get_last_failure());
}
//include('content_makers.inc.php');
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_lp">'.
'<img src="../img/wizard.gif" border="0" align="absmiddle" alt="scormbuilder">&nbsp;'.get_lang('_add_learnpath').
@ -170,7 +170,7 @@ if (is_array($flat_list))
{
$counter++;
if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; }
$url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id;
$name = $details['lp_name'];
$image='<img src="../img/kcmdf.gif" border="0" align="absmiddle" alt="scorm">'."\n";
@ -181,7 +181,7 @@ if (is_array($flat_list))
"</td>\n";
//$dsp_desc='<td>'.$details['lp_desc'].'</td>'."\n";
$dsp_desc = '';
$dsp_export = '';
$dsp_edit = '';
$dsp_delete = '';
@ -199,7 +199,7 @@ if (is_array($flat_list))
$dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$id.'">&nbsp;&nbsp;<img src="../img/edit.gif" border="0" title="'.get_lang('_edit_learnpath').'"></a></td>'."\n";
$fileExtension=explode('.',$dspFileName);
$fileExtension=strtolower($fileExtension[sizeof($fileExtension)-1]);
/* export */
//export not available for normal lps yet
if($details['lp_type']==1){
@ -220,19 +220,19 @@ if (is_array($flat_list))
"<img src=\"../img/cd_gray.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
//"</a>" .
"";
}
}
/* edit title and description */
$dsp_edit = '<td align="center">';
/* DELETE COMMAND */
$dsp_delete = "<a href=\"lp_controller.php?".api_get_cidreq()."&action=delete&lp_id=$id\" " .
"onClick=\"return confirmation('".addslashes($dspFileName)."');\">" .
"<img src=\"../img/delete.gif\" border=\"0\" title=\"".get_lang('_delete_learnpath')."\" />" .
"</a>";
/* VISIBILITY COMMAND */
if ($details['lp_visibility'] == "i")
{
$dsp_visible = "<a href=\"".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=v\">" .
@ -290,13 +290,13 @@ if (is_array($flat_list))
'<img src="../img/bug_gray.gif" border="0" alt="'.get_lang("ShowDebug").'" title="'.get_lang("ShowDebug").'"/>' .
'</a>&nbsp;';
}
} // end if($is_allowedToEdit)
//echo $dsp_line.$dsp_desc.$dsp_export.$dsp_edit.$dsp_delete.$dsp_visible;
//echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_default_view.$dsp_force_commit.$dsp_debug.$dsp_delete;
echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_force_commit.$dsp_delete;
echo "</tr>\n";
} // end foreach ($flat_list)
//TODO print some user-friendly message if counter is still = 0 to tell nothing can be displayd yet
}// end if ( is_array($flat_list)

@ -6,7 +6,7 @@
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
@ -17,20 +17,20 @@
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium,
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium,
info@dokeos.com
=============================================================================
*/
/**
=============================================================================
* This file is a container for functions related to SCORM and other
* This file is a container for functions related to SCORM and other
* standard or common course content types. It might later become a class
* instead of a functions library, as several components are likely to be
* re-used for different content types.
* @package dokeos.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
* @author Based on work from Denes NAgy, Isthvan Mandak and Roan Embrechts
=============================================================================
=============================================================================
*/
/**
* Delete a scorm directory (check for imsmanifest and if found, deletes the related rows in scorm tables also)
@ -64,29 +64,29 @@ function removescormDir($dir)
while ($row=mysql_fetch_array($result))
{
$c=$row['contentId'];
$sql2="DELETE FROM ".Database::get_scorm_table(TABLE_SCORM_SCO_DATA)." where contentId=$c";
$sql2="DELETE FROM ".Database::get_scorm_table(TABLE_SCORM_SCO_DATA)." where contentId=$c";
$result2=api_sql_query($sql2,__FILE__,__LINE__);
}
$sql="DELETE FROM ".Database::get_scorm_table(TABLE_SCORM_MAIN)." where (contentTitle='$scormdir' and dokeosCourse='$courseid')";
$result=api_sql_query($sql,__FILE__,__LINE__);
}
}
}
if(!@unlink($dir.'/'.$readdir))
{
return false;
}
} elseif(is_dir($dir.'/'.$readdir)) {
if(!removescormDir($dir.'/'.$readdir))
{
{
return false;
}
} elseif(is_dir($dir.'/'.$readdir)) {
if(!removescormDir($dir.'/'.$readdir))
{
return false;
}
}
}
}
closedir($opendir);
if(!@rmdir($dir)) {
return false;
}
}
}
}
closedir($opendir);
if(!@rmdir($dir)) {
return false;
}
return true;
}
/**

@ -5,7 +5,7 @@
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 University of Ghent (UGent)
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
@ -35,7 +35,7 @@
* Script init
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = "scormdocument";
$uncompress=1; //this variable shouldn't be found here (find its usage before removal)
@ -44,7 +44,7 @@ include("../learnpath/learnpath_functions.inc.php");
include_once('scorm.lib.php');
$is_allowedToEdit = api_is_allowed_to_edit();
/**
* Variables
*/
@ -118,15 +118,15 @@ switch($action){
$result=api_sql_query($sql,__FILE__,__LINE__);
$row=mysql_fetch_array($result);
$name=domesticate($row['learnpath_name']);
if ($set_visibility == 'i') {
$s=$name." ".get_lang('_no_published');
$dialogBox=$s;
$v=0;
if ($set_visibility == 'i') {
$s=$name." ".get_lang('_no_published');
$dialogBox=$s;
$v=0;
}
if ($set_visibility == 'v') {
$s=$name." ".get_lang('_published');
$dialogBox=$s;
$v=1;
if ($set_visibility == 'v') {
$s=$name." ".get_lang('_published');
$dialogBox=$s;
$v=1;
}
$sql="SELECT * FROM $tbl_tool where (name='$name' and image='scormbuilder.gif')";
$result=api_sql_query($sql,__FILE__,__LINE__);
@ -153,7 +153,7 @@ switch($action){
//parameter and database incompatible, do nothing
}
$result=api_sql_query($sql,__FILE__,__LINE__);
}
break;
case 'editpath':
@ -215,10 +215,10 @@ if($is_allowedToEdit) // TEACHER ONLY
* size set in php.ini, all variables from POST are cleared !
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST'
&& count($_FILES)>0
&& empty($submitImage)
&& empty($cancelSubmitImage)
if ($_SERVER['REQUEST_METHOD'] == 'POST'
&& count($_FILES)>0
&& empty($submitImage)
&& empty($cancelSubmitImage)
&& empty($action))
{
// A SCORM upload has been detected, now deal with the file...
@ -255,7 +255,7 @@ if($is_allowedToEdit) // TEACHER ONLY
//exit();
}
//directory creation end
$uploadPath=$openDir.'/'.$newDirName;
if(!$_FILES['userFile']['size'])
{
@ -309,13 +309,13 @@ if($is_allowedToEdit) // TEACHER ONLY
{
rmdir($baseWorkDir.$newDirPath.$openDir."/".$newDirName);
}
}
}//
else
{//the filename doesn't contain any alphanum chars (empty filename?)
//get a more detailed message?
$dialogBox .= get_lang('FileError').'<br />';
$dialogBox .= get_lang('FileError').'<br />';
}
/*======================================
@ -327,7 +327,7 @@ if($is_allowedToEdit) // TEACHER ONLY
if ( scorm_delete($baseWorkDir.$delete))
{
//$tbl_document = substr($tbl_document, 1, strlen($tbl_document) - 2); // RH...
update_db_info("delete", $delete);
update_db_info("delete", $delete);
$dialogBox = get_lang('DocDeleted');
}
}
@ -379,7 +379,7 @@ if($is_allowedToEdit) // TEACHER ONLY
======================================*/
if (!empty($make_directory_visible) || !empty($make_directory_invisible))
{
$visibilityPath = $make_directory_visible.$make_directory_invisible;
$visibilityPath = $make_directory_visible.$make_directory_invisible;
// At least one of these variables are empty. So it's okay to proceed this way
/* Check if there is yet a record for this file in the DB */
$result = mysql_query ("SELECT * FROM $tbl_document WHERE path LIKE '".$visibilityPath."'");

Loading…
Cancel
Save