[svn r18551] Various minor fixes (warning and notice level)

skala
Yannick Warnier 17 years ago
parent 7f81c60794
commit 4b64462e45
  1. 63
      main/dropbox/dropbox_class.inc.php
  2. 39
      main/dropbox/dropbox_config.inc.php
  3. 25
      main/dropbox/dropbox_download.php
  4. 41
      main/dropbox/dropbox_functions.inc.php
  5. 24
      main/dropbox/dropbox_init.inc.php
  6. 29
      main/dropbox/dropbox_submit.php
  7. 25
      main/dropbox/dropbox_zipdownload.inc.php
  8. 28
      main/dropbox/index.php

@ -1,26 +1,5 @@
<?php <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
* Dropbox module for Dokeos * Dropbox module for Dokeos
@ -64,18 +43,18 @@
* @package dokeos.dropbox * @package dokeos.dropbox
**/ **/
class Dropbox_Work { class Dropbox_Work {
var $id; public $id;
var $uploader_id; public $uploader_id;
var $uploaderName; public $uploaderName;
var $filename; public $filename;
var $filesize; public $filesize;
var $title; public $title;
var $description; public $description;
var $author; public $author;
var $upload_date; public $upload_date;
var $last_upload_date; public $last_upload_date;
var $isOldWork; public $isOldWork;
var $feedback_date, $feedback; // RH: Feedback public $feedback_date, $feedback; // RH: Feedback
/** /**
* Constructor calls private functions to create a new work or retreive an existing work from DB * Constructor calls private functions to create a new work or retreive an existing work from DB
@ -247,7 +226,7 @@ class Dropbox_Work {
class Dropbox_SentWork extends Dropbox_Work class Dropbox_SentWork extends Dropbox_Work
{ {
var $recipients; //array of ["id"]["name"] arrays public $recipients; //array of ["id"]["name"] arrays
/** /**
* Constructor calls private functions to create a new work or retreive an existing work from DB * Constructor calls private functions to create a new work or retreive an existing work from DB
@ -371,12 +350,12 @@ class Dropbox_SentWork extends Dropbox_Work
class Dropbox_Person class Dropbox_Person
{ {
var $receivedWork; //array of Dropbox_Work objects public $receivedWork; //array of Dropbox_Work objects
var $sentWork; //array of Dropbox_SentWork objects public $sentWork; //array of Dropbox_SentWork objects
var $userId = 0; public $userId = 0;
var $isCourseAdmin = FALSE; public $isCourseAdmin = FALSE;
var $isCourseTutor = FALSE; public $isCourseTutor = FALSE;
var $_orderBy = ''; //private property that determines by which field public $_orderBy = ''; //private property that determines by which field
//the receivedWork and the sentWork arrays are sorted //the receivedWork and the sentWork arrays are sorted
/** /**

@ -1,36 +1,16 @@
<?php <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
* -------------------------------------- * --------------------------------------
*       DEBUGGING VARS * DEBUGGING VARS
* -------------------------------------- * --------------------------------------
*/ */
$DEBUG = TRUE; $DEBUG = TRUE;
/** /**
* -------------------------------------- * --------------------------------------
*       DATABASE TABLE VARIABLES * DATABASE TABLE VARIABLES
* -------------------------------------- * --------------------------------------
*/ */
$dropbox_cnf['tbl_post'] = Database::get_course_table(TABLE_DROPBOX_POST); $dropbox_cnf['tbl_post'] = Database::get_course_table(TABLE_DROPBOX_POST);
@ -44,7 +24,7 @@ $dropbox_cnf['tbl_feedback'] = Database::get_course_table(TABLE_DROPBOX_FEEDBAC
/** /**
* -------------------------------------- * --------------------------------------
*       INITIALISE OTHER VARIABLES & CONSTANTS * INITIALISE OTHER VARIABLES & CONSTANTS
* -------------------------------------- * --------------------------------------
*/ */
$dropbox_cnf["courseId"] = $_cid; $dropbox_cnf["courseId"] = $_cid;
@ -59,7 +39,7 @@ $dropbox_cnf["allowGroup"] = string_2_boolean(api_get_setting("dropbox_allow
/** /**
* -------------------------------------- * --------------------------------------
* RH:   INITIALISE MAILING VARIABLES * RH: INITIALISE MAILING VARIABLES
* -------------------------------------- * --------------------------------------
*/ */
$dropbox_cnf["allowMailing"] = string_2_boolean(api_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
@ -72,9 +52,4 @@ $dropbox_cnf["mailingWhereUSERID"] = "username";
$dropbox_cnf["mailingWhereLOGINNAME"] = "username"; $dropbox_cnf["mailingWhereLOGINNAME"] = "username";
$dropbox_cnf["mailingFileRegexp"] = '/^(.+)\.\w{1,4}$/'; $dropbox_cnf["mailingFileRegexp"] = '/^(.+)\.\w{1,4}$/';
$dropbox_cnf['sent_received_tabs']=true; $dropbox_cnf['sent_received_tabs']=true;
?>

@ -1,26 +1,5 @@
<?php <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* /*
============================================================================== ==============================================================================
INIT SECTION INIT SECTION

@ -1,26 +1,5 @@
<?php <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006-2008 Dokeos SPRL
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
* This file contains additional dropbox functions. Initially there were some * This file contains additional dropbox functions. Initially there were some
@ -488,10 +467,7 @@ function display_addcategory_form($category_name='', $id='')
*/ */
function display_add_form() function display_add_form()
{ {
global $_user; global $_user, $is_courseAdmin, $is_courseTutor, $course_info, $origin, $dropbox_unid;
global $is_courseAdmin;
global $is_courseTutor;
global $course_info; // this
$token = Security::get_token(); $token = Security::get_token();
$dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); $dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);
@ -505,8 +481,8 @@ function display_add_form()
<td> <td>
<input type="hidden" name="MAX_FILE_SIZE" value='<?php echo dropbox_cnf("maxFilesize")?>' /> <input type="hidden" name="MAX_FILE_SIZE" value='<?php echo dropbox_cnf("maxFilesize")?>' />
<input type="file" name="file" size="20" <?php if (dropbox_cnf("allowOverwrite")) echo 'onChange="checkfile(this.value)"'; ?> /> <input type="file" name="file" size="20" <?php if (dropbox_cnf("allowOverwrite")) echo 'onChange="checkfile(this.value)"'; ?> />
<input type="hidden" name="dropbox_unid" value="<?php echo $dropbox_unid?>" /> <input type="hidden" name="dropbox_unid" value="<?php echo $dropbox_unid ?>" />
<input type="hidden" name="sec_token" value="<?php echo $token?>" /> <input type="hidden" name="sec_token" value="<?php echo $token ?>" />
<?php <?php
if ($origin=='learnpath') if ($origin=='learnpath')
{ {
@ -621,7 +597,7 @@ function display_add_form()
{ {
if ($current_group['number_of_members'] > 0) if ($current_group['number_of_members'] > 0)
{ {
echo '<option value="group_'.$current_group['id'].'">G: '.$current_group['name'].' - '.$current_group['number_of_members'].' '.$langUsers.'</option>'; echo '<option value="group_'.$current_group['id'].'">G: '.$current_group['name'].' - '.$current_group['number_of_members'].' '.api_get_lang('Users').'</option>';
} }
} }
} }
@ -1193,7 +1169,8 @@ function zip_download ($array)
} }
// create the zip file // create the zip file
$temp_zip_file=$temp_zip_dir.'/dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip'; $name = 'dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip';
$temp_zip_file=$temp_zip_dir.'/'.$name;
$zip_folder=new PclZip($temp_zip_file); $zip_folder=new PclZip($temp_zip_file);
foreach ($files as $key=>$value) foreach ($files as $key=>$value)
@ -1279,7 +1256,7 @@ function zip_download_alternative($files)
$zip_folder->add($overview_file,PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path']."/temp"); $zip_folder->add($overview_file,PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path']."/temp");
// Step 5: send the file for download; // Step 5: send the file for download;
DocumentManager::file_send_for_download($temp_zip_file,true,$name); DocumentManager::file_send_for_download($temp_zip_file,true);
// Step 6: remove the files in the temp dir // Step 6: remove the files in the temp dir
foreach ($files as $key=>$value) foreach ($files as $key=>$value)

@ -1,26 +1,6 @@
<?php // $Id: dropbox_init1.inc.php,v 1.29 2005/09/12 08:16:16 renehaentjens Exp $ <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== ==============================================================================
* First initialisation file with initialisation of variables and * First initialisation file with initialisation of variables and

@ -1,26 +1,6 @@
<?php // $Id: dropbox_submit.php,v 1.27 2005/05/17 08:02:03 renehaentjens Exp $ <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* /*
* ======================================== * ========================================
@ -353,7 +333,10 @@ if ( isset( $_GET['mailingIndex'])) // examine or send
{ {
// string result = error message, array result = [user_id, lastname, firstname] // string result = error message, array result = [user_id, lastname, firstname]
global $var, $sel; unset($students); global $var, $sel;
if (isset($students)) {
unset($students);
}
$result = api_sql_query($sel . $thisRecip . "'",__FILE__,__LINE__); $result = api_sql_query($sel . $thisRecip . "'",__FILE__,__LINE__);
while ( ($res = mysql_fetch_array($result))) {$students[] = $res;} while ( ($res = mysql_fetch_array($result))) {$students[] = $res;}

@ -1,26 +1,5 @@
<?php <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
// the file that contains all the initialisation stuff (and includes all the configuration stuff) // the file that contains all the initialisation stuff (and includes all the configuration stuff)
require_once( "dropbox_init.inc.php"); require_once( "dropbox_init.inc.php");

@ -1,27 +1,5 @@
<?php // $Id: index.php,v 1.46 2005/09/26 10:20:25 pcool Exp $ <?php //$id: $
/* For licensing terms, see /dokeos_license.txt */
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006-2008 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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 address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== ==============================================================================
* @desc The dropbox is a personal (peer to peer) file exchange module that allows * @desc The dropbox is a personal (peer to peer) file exchange module that allows
@ -30,7 +8,7 @@
* @version 1.3 * @version 1.3
* *
* @author Jan Bols <jan@ivpv.UGent.be>, main programmer, initial version * @author Jan Bols <jan@ivpv.UGent.be>, main programmer, initial version
* @author Ren<EFBFBD> Haentjens <rene.haentjens@UGent.be>, several contributions (see RH) * @author René Haentjens <rene.haentjens@UGent.be>, several contributions (see RH)
* @author Roan Embrechts, virtual course support * @author Roan Embrechts, virtual course support
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University (see history version 1.3) * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University (see history version 1.3)
* *

Loading…
Cancel
Save