dropbox_config.inc.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * DATABASE TABLE VARIABLES
  5. */
  6. $dropbox_cnf['tbl_user'] = Database::get_main_table(TABLE_MAIN_USER);
  7. $dropbox_cnf['tbl_course_user'] = Database::get_main_table(TABLE_MAIN_COURSE_USER);
  8. $dropbox_cnf['tbl_post'] = Database::get_course_table(TABLE_DROPBOX_POST);
  9. $dropbox_cnf['tbl_file'] = Database::get_course_table(TABLE_DROPBOX_FILE);
  10. $dropbox_cnf['tbl_person'] = Database::get_course_table(TABLE_DROPBOX_PERSON);
  11. $dropbox_cnf['tbl_intro'] = Database::get_course_table(TABLE_TOOL_INTRO);
  12. $dropbox_cnf['tbl_category'] = Database::get_course_table(TABLE_DROPBOX_CATEGORY);
  13. $dropbox_cnf['tbl_feedback'] = Database::get_course_table(TABLE_DROPBOX_FEEDBACK);
  14. /**
  15. * INITIALISE OTHER VARIABLES & CONSTANTS
  16. */
  17. $dropbox_cnf['courseId'] = $_cid;
  18. //path to dropbox subdir in course containing the uploaded files
  19. $dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox';
  20. $dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/dropbox';
  21. //file size limit as imposed by the platform admin (see Chamilo Config Settings on the platform administration section)
  22. $dropbox_cnf['maxFilesize'] = api_get_setting('dropbox_max_filesize');
  23. $dropbox_cnf['allowOverwrite'] = api_string_2_boolean(api_get_setting('dropbox_allow_overwrite'));
  24. $dropbox_cnf['allowJustUpload'] = api_string_2_boolean(api_get_setting('dropbox_allow_just_upload'));
  25. $dropbox_cnf['allowStudentToStudent'] = api_string_2_boolean(api_get_setting('dropbox_allow_student_to_student'));
  26. $dropbox_cnf['allowGroup'] = api_string_2_boolean(api_get_setting('dropbox_allow_group'));
  27. /**
  28. * MAILING VARIABLES
  29. */
  30. // false = no mailing functionality
  31. $dropbox_cnf['allowMailing'] = api_string_2_boolean(api_get_setting('dropbox_allow_mailing'));
  32. $dropbox_cnf['mailingIdBase'] = 10000000; // bigger than any user_id,
  33. // allowing enough space for pseudo_ids as uploader_id, dest_user_id, user_id:
  34. // mailing pseudo_id = dropbox_cnf('mailingIdBase') + mailing id
  35. $dropbox_cnf['mailingZipRegexp'] = '/^(.*)(STUDENTID|USERID|LOGINNAME)(.*)\.ZIP$/i';
  36. $dropbox_cnf['mailingWhereSTUDENTID'] = 'official_code';
  37. $dropbox_cnf['mailingWhereUSERID'] = 'username';
  38. $dropbox_cnf['mailingWhereLOGINNAME'] = 'username';
  39. $dropbox_cnf['mailingFileRegexp'] = '/^(.+)\.\w{1,4}$/';
  40. $dropbox_cnf['sent_received_tabs'] = true;
  41. return $dropbox_cnf;