Patrick Cool 19 years ago
parent a39f12aa05
commit 77cd9b97f3
  1. 17
      main/dropbox/dropbox_class.inc.php
  2. 34
      main/dropbox/dropbox_config.inc.php
  3. 12
      main/dropbox/dropbox_init.inc.php
  4. 14
      main/dropbox/dropbox_submit.php
  5. 5
      main/dropbox/index.php
  6. 1
      main/inc/lib/add_course.lib.inc.php

@ -105,9 +105,12 @@ class Dropbox_Work {
* Constructor calls private functions to create a new work or retreive an existing work from DB
* depending on the number of parameters
*/
if (func_num_args()>1) {
if (func_num_args()>1)
{
$this->_createNewWork($arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
} else {
}
else
{
$this->_createExistingWork($arg1);
}
}
@ -162,7 +165,9 @@ class Dropbox_Work {
, last_upload_date = '".addslashes($this->last_upload_date)."'
WHERE id='".addslashes($this->id)."'";
$result = api_sql_query($sql,__FILE__,__LINE__);
} else {
}
else
{
$this->upload_date = $this->last_upload_date;
$sql="INSERT INTO `".dropbox_cnf("fileTbl")."`
(uploader_id, filename, filesize, title, description, author, upload_date, last_upload_date)
@ -427,7 +432,8 @@ class Dropbox_Person {
AND r.dest_user_id = p.user_id
AND r.file_id = p.file_id";
$result = api_sql_query($sql,__FILE__,__LINE__);
while ($res = mysql_fetch_array($result)) {
while ($res = mysql_fetch_array($result))
{
$this->receivedWork[] = new Dropbox_Work($res["file_id"]);
}
/*
@ -439,7 +445,8 @@ class Dropbox_Person {
AND f.uploader_id = p.user_id
AND f.id = p.file_id";
$result =api_sql_query($sql,__FILE__,__LINE__);
while ($res = mysql_fetch_array($result)) {
while ($res = mysql_fetch_array($result))
{
$this->sentWork[] = new Dropbox_SentWork($res["id"]);
}
}

@ -33,29 +33,29 @@ $DEBUG = TRUE;
*       DATABASE TABLE VARIABLES
* --------------------------------------
*/
$dropbox_cnf["postTbl"] = $_course["dbNameGlu"] . "dropbox_post";
$dropbox_cnf["fileTbl"] = $_course["dbNameGlu"] . "dropbox_file";
$dropbox_cnf["personTbl"] = $_course["dbNameGlu"] . "dropbox_person";
$dropbox_cnf["introTbl"] = $_course["dbNameGlu"] . "tool_intro";
$dropbox_cnf["userTbl"] = $_configuration['main_database'] . "`.`user";
$dropbox_cnf["courseUserTbl"] = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$dropbox_cnf['tbl_category'] = $_course["dbNameGlu"] . "dropbox_category";
$dropbox_cnf['tbl_feedback'] = $_course["dbNameGlu"] . "dropbox_feedback";
$dropbox_cnf["postTbl"] = $_course["dbNameGlu"] . "dropbox_post";
$dropbox_cnf["fileTbl"] = $_course["dbNameGlu"] . "dropbox_file";
$dropbox_cnf["personTbl"] = $_course["dbNameGlu"] . "dropbox_person";
$dropbox_cnf["introTbl"] = $_course["dbNameGlu"] . "tool_intro";
$dropbox_cnf["userTbl"] = $_configuration['main_database'] . "`.`user";
$dropbox_cnf["courseUserTbl"] = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$dropbox_cnf['tbl_category'] = $_course["dbNameGlu"] . "dropbox_category";
$dropbox_cnf['tbl_feedback'] = $_course["dbNameGlu"] . "dropbox_feedback";
/**
* --------------------------------------
*       INITIALISE OTHER VARIABLES & CONSTANTS
* --------------------------------------
*/
$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["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["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["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"));
/**
* --------------------------------------

@ -25,7 +25,7 @@
==============================================================================
* First initialisation file with initialisation of variables and
* without outputting anything to browser.
* 1. Calls claro_init_global.inc.php and lang file
* 1. Calls global.inc.php and lang file
* 2. Initialises $dropbox_cnf array with all relevant vars
* 3. Often used functions
*
@ -51,24 +51,23 @@
INIT SECTION
==============================================================================
*/
//name of langfile
// name of the language file that needs to be included
$language_file = "dropbox";
//this var disables the link in the breadcrumps on top of the page
//this var disables the link in the breadcrumbs on top of the page
//$noPHP_SELF = TRUE;
// including the basic Dokeos initialisation file
require("../inc/global.inc.php");
// the dropbox configuration parameters
include_once('dropbox_config.inc.php');
require_once('dropbox_config.inc.php');
// the dropbox sanity files (adds a new table and some new fields)
include_once('dropbox_sanity.inc.php');
//require_once('dropbox_sanity.inc.php');
// the dropbox file that contains additional functions
include_once('dropbox_functions.inc.php');
require_once('dropbox_functions.inc.php');
// protecting the script
api_protect_course_script();
@ -315,7 +314,6 @@ api_display_tool_title();
*/
if(! $is_allowed_in_course || ! $is_courseMember)
{
debug ($_SESSION);
api_not_allowed();
if ($origin != 'learnpath')
{

@ -73,9 +73,12 @@ api_session_register("dropbox_uniqueid");
*/
if ( isset( $_POST["submitWork"]))
{
if (file_exists(api_get_path(INCLUDE_PATH) . "/fileUploadLib.inc.php")) {
if (file_exists(api_get_path(INCLUDE_PATH) . "/fileUploadLib.inc.php"))
{
require_once(api_get_path(INCLUDE_PATH) . "/fileUploadLib.inc.php");
} else {
}
else
{
require_once(api_get_path(LIBRARY_PATH) . "/fileUpload.lib.php");
}
@ -399,9 +402,12 @@ if ( isset( $_GET['mailingIndex'])) // examine or send
}
}
if (file_exists(api_get_path(INCLUDE_PATH) . "/pclzip/pclzip.lib.php")) {
if (file_exists(api_get_path(INCLUDE_PATH) . "/pclzip/pclzip.lib.php"))
{
require(api_get_path(INCLUDE_PATH) . "/pclzip/pclzip.lib.php");
} else {
}
else
{
require(api_get_path(LIBRARY_PATH) . "/pclzip/pclzip.lib.php");
}

@ -332,11 +332,6 @@ if (!$_GET['view'] OR $_GET['view']=='received' OR $dropbox_cnf['sent_received_t
// the content of the sortable table = the received files
foreach ( $dropbox_person -> receivedWork as $dropbox_file)
{
//echo '<pre>';
//print_r($dropbox_file);
//echo '</pre>';
$dropbox_file_data=array();
if ($view_dropbox_category_received==$dropbox_file->category) // we only display the files that are in the category that we are in.
{

@ -856,6 +856,7 @@ function update_Db_course($courseDbName)
dest_user_id int unsigned NOT NULL default 0,
feedback_date datetime NOT NULL default '0000-00-00 00:00:00',
feedback text default '',
cat_id int(11) NOT NULLL default 0,
PRIMARY KEY (file_id,dest_user_id)
)");

Loading…
Cancel
Save