Removing require_once already added in global.inc or via composer

skala
Julio Montoya 12 years ago
parent 627c7bb720
commit dac6350c3e
  1. 1
      main/admin/calendar_ical_export.php
  2. 5
      main/announcements/download.php
  3. 1
      main/calendar/agenda.inc.php
  4. 2
      main/calendar/allagendas.php
  5. 5
      main/calendar/download.php
  6. 17
      main/calendar/ical_export.php
  7. 5
      main/calendar/myagenda.inc.php
  8. 1
      main/chat/chat.php
  9. 1
      main/chat/chat_chat.php
  10. 1
      main/chat/chat_hidden.php
  11. 2
      main/chat/chat_message.php
  12. 1
      main/conference/api.php
  13. 2
      main/coursecopy/classes/CourseRestorer.class.php
  14. 17
      main/document/create_draw.php
  15. 35
      main/document/record_audio.php
  16. 13
      main/document/record_audio_wami.php
  17. 4
      main/document/remote.php
  18. 3
      main/document/showinframesmin.php
  19. 4
      main/document/upload.php
  20. 43
      main/document/webcam_clip.php
  21. 50
      main/dropbox/dropbox_download.php
  22. 2
      main/dropbox/dropbox_init.inc.php
  23. 1
      main/exercice/exercice.php
  24. 1
      main/exercice/exercise.class.php
  25. 3
      main/exercice/exercise.lib.php
  26. 7
      main/exercice/export/qti2/qti2_classes.php
  27. 1
      main/exercice/feedback.php
  28. 29
      main/forum/index.php
  29. 3
      main/gradebook/gradebook.php
  30. 5
      main/gradebook/lib/fe/dataform.class.php
  31. 1
      main/gradebook/lib/fe/evalform.class.php
  32. 1
      main/gradebook/lib/fe/linkaddeditform.class.php
  33. 11
      main/gradebook/lib/fe/linkform.class.php
  34. 1
      main/gradebook/lib/fe/userform.class.php
  35. 15
      main/group/group_overview.php
  36. 2
      main/inc/ajax/document.ajax.php
  37. 41
      main/inc/ajax/nanogong.ajax.php
  38. 2
      main/inc/lib/export.lib.inc.php
  39. 3
      main/inc/lib/fck_course_document.inc.php
  40. 2
      main/inc/lib/fckeditor/repository.php
  41. 1
      main/inc/lib/groupmanager.lib.php
  42. 5
      main/inc/lib/jpegcam/webcam_receiver.php
  43. 1
      main/inc/lib/main_api.lib.php
  44. 1
      main/inc/lib/svg-edit/extensions/filesave.php
  45. 27
      main/inc/lib/svg-edit/extensions/imagelib/groups.php
  46. 13
      main/inc/lib/svg-edit/extensions/imagelib/index.php
  47. 3
      main/inc/lib/wami-recorder/record_document.php
  48. 2
      main/messages/download.php
  49. 2
      main/newscorm/scorm.class.php
  50. 1
      main/permissions/blog_permissions.inc.php
  51. 1
      main/permissions/user_permissions.inc.php
  52. 2
      main/upload/index.php
  53. 4
      main/upload/upload_word.php

@ -16,7 +16,6 @@ $cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_MYAGENDA;
api_block_anonymous_users();
require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH).'icalcreator/iCalcreator.class.php');
// setting the name of the tool
$nameTools = get_lang('MyAgenda');

@ -16,7 +16,6 @@
session_cache_limiter('nocache');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
// IMPORTANT to avoid caching of documents
header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
@ -52,7 +51,7 @@ if (is_dir($full_file_name)) {
//create the path
$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
//redirect
header('Location: '.$document_explorer);
header('Location: '.$document_explorer);
}
$tbl_announcement_attachment = Database::get_course_table(TABLE_ANNOUNCEMENT_ATTACHMENT);
@ -71,7 +70,7 @@ $result= Database::query($sql);
if (Database::num_rows($result) > 0) {
$row= Database::fetch_array($result);
$title = str_replace(' ','_', $row['filename']);
if (Security::check_abs_path($full_file_name, api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/announcements/')) {
if (Security::check_abs_path($full_file_name, api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/announcements/')) {
DocumentManager::file_send_for_download($full_file_name,TRUE, $title);
}
}

@ -32,7 +32,6 @@ $(function() {
});
</script>';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
/**
* Retrieves all the agenda items from the table

@ -18,8 +18,6 @@ $cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_MYAGENDA;
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
require_once 'agenda.inc.php';
require_once 'myagenda.inc.php';

@ -17,7 +17,6 @@ session_cache_limiter('public');
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once 'agenda.inc.php';
// IMPORTANT to avoid caching of documents
@ -40,7 +39,7 @@ if (empty($course_id) || empty($doc_url)) {
$is_user_is_subscribed = CourseManager::is_user_subscribed_in_course($user_id, $course_info['code'], true, $session_id);
if (!api_is_allowed_to_edit() && !$is_user_is_subscribed) {
if (!api_is_allowed_to_edit() && !$is_user_is_subscribed) {
api_not_allowed();
}
@ -75,7 +74,7 @@ $sql='SELECT filename FROM '.$tbl_agenda_attachment.'
$result = Database::query($sql);
if (Database::num_rows($result)) {
$row = Database::fetch_array($result);
$row = Database::fetch_array($result);
$title = str_replace(' ','_', $row['filename']);
if (Security::check_abs_path($full_file_name, api_get_path(SYS_COURSE_PATH).$course_info['path'].'/upload/calendar/')) {
DocumentManager::file_send_for_download($full_file_name,TRUE, $title);

@ -17,7 +17,6 @@ require_once '../inc/global.inc.php';
$this_section = SECTION_MYAGENDA;
api_block_anonymous_users();
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'icalcreator/iCalcreator.class.php';
require_once api_get_path(SYS_CODE_PATH).'calendar/agenda.lib.php';
@ -53,7 +52,7 @@ $event = $agenda->get_event($id);
if (!empty($event)) {
define('ICAL_LANG',api_get_language_isocode());
$ical = new vcalendar();
$ical->setConfig('unique_id',api_get_path(WEB_PATH));
$ical->setProperty( 'method', 'PUBLISH' );
@ -74,14 +73,14 @@ if (!empty($event)) {
$vevent->setClass('PRIVATE');
break;
}
$event['start_date'] = api_get_local_time($event['start_date']);
$event['end_date'] = api_get_local_time($event['end_date']);
switch($type) {
case 'personal':
case 'personal':
case 'platform':
$vevent->setProperty( 'summary', api_convert_encoding($event['title'],'UTF-8', $charset));
if(empty($event['start_date'])){header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));}
@ -105,7 +104,7 @@ if (!empty($event)) {
$ical->setComponent ($vevent); // add event to calendar
$ical->returnCalendar();
break;
case 'course':
case 'course':
$vevent->setProperty( 'summary', api_convert_encoding($event['title'],'UTF-8',$charset));
if(empty($event['start_date'])){header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));}
list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$event['start_date']);
@ -138,7 +137,7 @@ if (!empty($event)) {
default:
header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));
die();
}
}
} else {
header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));
die();

@ -16,9 +16,6 @@
*/
$setting_agenda_link = 'coursecode'; // valid values are coursecode and icon
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
/**
* This function retrieves all the agenda items of all the courses the user is subscribed to
*/
@ -928,7 +925,7 @@ function get_personal_agenda_items_between_dates($user_id, $date_start='', $date
// get agenda-items for every course
$courses = api_get_user_courses($user_id,false);
require_once(api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
foreach ($courses as $id => $course)
{
$c = api_get_course_info($course['code']);

@ -12,7 +12,6 @@ $language_file = array('chat');
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_CHAT;
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$this_section = SECTION_COURSES;
$nameTools = get_lang('ToolChat');

@ -15,7 +15,6 @@ define('FRAME', 'chat');
$language_file = array('chat');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
$course = $_GET['cidReq'];
$session_id = intval($_SESSION['id_session']);

@ -16,7 +16,6 @@ define('FRAME', 'hidden');
$language_file = array('chat');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
require_once 'chat_functions.lib.php';
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);

@ -18,7 +18,6 @@ define('FRAME', 'message');
$language_file = array('chat');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$course = api_get_course_id();
$session_id = api_get_session_id();
@ -63,7 +62,6 @@ if (empty($_user['user_id'])) {
// if we have the session set up
if (!empty($course) && !empty($_user['user_id'])) {
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
/* Constants and variables */

@ -43,7 +43,6 @@ if ($_SERVER['HTTP_USER_AGENT'] == 'Shockwave Flash') {
/*==== INCLUDE ====*/
require_once '../inc/global.inc.php';
api_block_anonymous_users();
require_once (api_get_path(LIBRARY_PATH)."document.lib.php");
require_once ("../newscorm/learnpath.class.php");
require_once ("../newscorm/openoffice_presentation.class.php");

@ -25,8 +25,6 @@ require_once 'Glossary.class.php';
require_once 'wiki.class.php';
require_once 'Thematic.class.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
define('FILE_SKIP', 1);
define('FILE_RENAME', 2);
define('FILE_OVERWRITE', 3);

@ -24,7 +24,6 @@ $_SESSION['whereami'] = 'document/createdraw';
$this_section = SECTION_COURSES;
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools = get_lang('Draw');
@ -34,7 +33,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -117,7 +116,7 @@ if (isset ($group)) {
// Copied from document.php
$dir_array = explode('/', $dir);
$array_len = count($dir_array);
/*
TODO:check and delete this code
if (!$is_certificate_mode) {
@ -144,7 +143,7 @@ echo '<div class="actions">';
echo '</div>';
if (api_browser_support('svg')){
//automatic loading the course language
$svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langsvgedit = api_get_language_isocode();
@ -152,9 +151,9 @@ if (api_browser_support('svg')){
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?lang='.$langsvgedit ;
?>
<script type="text/javascript">
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>');
function resizeIframe() {
var height = window.innerHeight -50;
@ -166,14 +165,14 @@ if (api_browser_support('svg')){
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
<?php
echo '<noscript>';
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0" src="'.$svg_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>';
} else {
} else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG'));
}

@ -24,7 +24,6 @@ $_SESSION['whereami'] = 'document/voicerecord';
$this_section = SECTION_COURSES;
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools = get_lang('VoiceRecord');
@ -34,7 +33,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -106,14 +105,14 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
$counter = 0;
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
$counter++;
continue;
continue;
}
}
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@ -127,8 +126,8 @@ echo '<div class="actions">';
echo '</div>';
?>
<script type="text/javascript">
function submitVoice() {
<script type="text/javascript">
function submitVoice() {
//lang vars
var lang_no_applet="<?php echo get_lang('NanogongNoApplet'); ?>";
var lang_record_before_save="<?php echo get_lang('NanogongRecordBeforeSave'); ?>";
@ -142,15 +141,15 @@ function submitVoice() {
//path, url and filename
var filename = document.getElementById("audio_title").value+"_chnano_.wav";//adding name file, tag and extension
var filename = filename.replace(/\s/g, "_");//replace spaces by _
var filename = encodeURIComponent(filename);
var filename = encodeURIComponent(filename);
var filepath="<?php echo urlencode($filepath); ?>";
var dir="<?php echo urlencode($dir); ?>";
var course_code="<?php echo urlencode($course_code); ?>";
//
var urlnanogong="../inc/lib/nanogong/receiver.php?filename="+filename+"&filepath="+filepath+"&dir="+dir+"&course_code="+course_code+"&nano_group_id="+nano_group_id+"&nano_session_id="+nano_session_id+"&nano_user_id="+nano_user_id;
var cookie="<?php echo 'ch_sid='.session_id(); ?>";
//check
//check
var recorder
if (!(recorder = document.getElementById("nanogong"))) {
alert(lang_no_applet)
@ -160,16 +159,16 @@ function submitVoice() {
if (duration <= 0) {
alert(lang_record_before_save)
return
}
}
if (!document.getElementById("audio_title").value) {
alert(lang_give_a_title)
return
}
//
var applet = document.getElementById("nanogong");
//
var applet = document.getElementById("nanogong");
var ret = applet.sendGongRequest( "PostToForm", urlnanogong, "voicefile", cookie, "temp");//'PostToForm', postURL, inputname, cookie, filename
if (ret == null) {
alert(lang_failled_to_submit);
if (ret == null) {
alert(lang_failled_to_submit);
} else {
alert(lang_submitted+"\n"+ret);
$("#status").attr('value', '1');
@ -190,14 +189,14 @@ echo '<applet id="nanogong" archive="'.api_get_path(WEB_LIBRARY_PATH).'nanogong/
echo '<param name="ShowTime" value="true" />'; // default false
//echo '<param name="Color" value="#C0E0FF" />'; // default #FFFFFF
//echo '<param name="StartTime" value="10.5" />';
//echo '<param name="EndTime" value="65" />';
//echo '<param name="EndTime" value="65" />';
echo '<param name="AudioFormat" value="ImaADPCM" />';// ImaADPCM (more speed), Speex (more compression)|(default Speex)
//echo '<param name="SamplingRate" value="32000" />';//Quality for ImaADPCM (low 8000, medium 11025, normal 22050, hight 44100) OR Quality for Speex (low 8000, medium 16000, normal 32000, hight 44100) | (default 44100)
//echo '<param name="MaxDuration" value="60" />';
//echo '<param name="SoundFileURL" value="http://somewhere.com/mysoundfile.wav" />';//load a file |(default "")
//echo '<param name="SoundFileURL" value="http://somewhere.com/mysoundfile.wav" />';//load a file |(default "")
echo '</applet>';
echo '<form name="form_nanogong">';
echo '<form name="form_nanogong">';
echo '<input placeholder="'.get_lang('InputNameHere').'" type="text" id="audio_title">';
echo '<input id="status" type="hidden" name="status" value="0">';
echo '<button class="upload" type="submit" value="'.get_lang('Send').'" onClick="submitVoice()" />'.get_lang('Send').'</button>';

@ -24,7 +24,6 @@ $_SESSION['whereami'] = 'document/voicerecord';
$this_section = SECTION_COURSES;
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools = get_lang('VoiceRecord');
@ -34,7 +33,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -114,14 +113,14 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
$counter = 0;
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
$counter++;
continue;
continue;
}
}
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@ -164,7 +163,7 @@ echo '</div>';
document.getElementById('audio_title').readOnly = true;
//document.getElementById('audio_title').style.display='none';
document.getElementById('audio_button').style.display='none';
Wami.setup({
id : "wami",
onReady : setupGUI
@ -175,7 +174,7 @@ echo '</div>';
function setupGUI() {
var waminame = document.getElementById("audio_title").value+".wav";//adding name file and extension
var waminame_play=waminame;
var gui = new Wami.GUI({
id : "wami",
singleButton : true,
@ -184,7 +183,7 @@ echo '</div>';
buttonUrl : "<?php echo api_get_path(WEB_LIBRARY_PATH) ?>wami-recorder/buttons.png",
swfUrl : "<?php echo api_get_path(WEB_LIBRARY_PATH) ?>wami-recorder/Wami.swf"
});
gui.setPlayEnabled(false);
}

@ -11,7 +11,7 @@
* @param string Course code (cidReq=...)
* @param string Current working directory (cwd=...)
* @return string JSON output
*/
*/
/* FIX for IE cache when using https */
session_cache_limiter('none');
/*==== DEBUG ====*/
@ -31,8 +31,6 @@ if ($debug>0) {
/*==== INCLUDE ====*/
require_once '../inc/global.inc.php';
api_block_anonymous_users();
require_once (api_get_path(LIBRARY_PATH).'course.lib.php');
require_once (api_get_path(LIBRARY_PATH).'document.lib.php');
require_once ('../newscorm/learnpath.class.php');
/*==== Variables initialisation ====*/
$action = $_REQUEST['action']; //safe as only used in if()'s

@ -12,9 +12,6 @@
$language_file[] = 'document';
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'glossary.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
// Protection
api_protect_course_script();

@ -41,7 +41,6 @@ $language_file = array('document','gradebook');
require_once '../inc/global.inc.php';
// Including additional libraries
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
require_once 'document.inc.php';
@ -122,8 +121,7 @@ $group_properties = array();
// This needs cleaning!
if (api_get_group_id()) {
// If the group id is set, check if the user has the right to be here
// Needed for group related stuff
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
// Get group info
$group_properties = GroupManager::get_group_properties(api_get_group_id());

@ -24,7 +24,6 @@ $_SESSION['whereami'] = 'document/webcamclip';
$this_section = SECTION_COURSES;
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools = get_lang('WebCamClip');
@ -34,7 +33,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -113,14 +112,14 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
$counter = 0;
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
$counter++;
continue;
continue;
}
}
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@ -145,7 +144,7 @@ echo '</div>';
<h3><?php echo get_lang('LocalInputImage'); ?></h3>
<!-- First, include the JPEGCam JavaScript Library -->
<script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/webcam.js"></script>
<!-- Configure a few settings -->
<script language="JavaScript">
var clip_filename='video_clip.jpg';
@ -154,14 +153,14 @@ echo '</div>';
webcam.set_shutter_sound( true,'<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/shutter.mp3' ); // true play shutter click sound
webcam.set_quality( 90 ); // JPEG quality (1 - 100)
webcam.set_api_url( '<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/webcam_receiver.php?webcamname='+escape(clip_filename)+'&webcamdir=<?php echo $webcamdir; ?>&webcamuserid=<?php echo $webcamuserid; ?>' );
</script>
<!-- Next, write the movie to the page at 320x240 -->
<script language="JavaScript">
document.write( webcam.get_html(320, 240) );
</script>
<!-- Some buttons for controlling things -->
<br/>
<form>
@ -171,16 +170,16 @@ echo '</div>';
<input type=button value="<?php echo get_lang('Send'); ?>" onClick="do_upload()">
&nbsp;&nbsp;||&nbsp;&nbsp;
<input type=button value="<?php echo get_lang('Auto'); ?>" onClick="start_video();">
<input type=button value="<?php echo get_lang('Stop'); ?>" onClick="stop_video()">
<input type=button value="<?php echo get_lang('Stop'); ?>" onClick="stop_video()">
<br/>
<input type=button value="<?php echo get_lang('Configure'); ?>" onClick="webcam.configure()">
</form>
<!-- Code to handle the server response (see webcam_receiver.php) -->
<script language="JavaScript">
webcam.set_hook( 'onComplete', 'my_completion_handler' );
function do_upload() {
// upload to server
if (this.loaded){
@ -188,19 +187,19 @@ echo '</div>';
}
webcam.upload();
}
function my_completion_handler(msg) {
// extract URL out of PHP output
if (msg.match(/(http\:\/\/\S+)/)) {
var image_url = RegExp.$1;
image_url=image_url.replace(/\\/g,'/').replace( /.*\//, '' );// extract basename
image_url='<?php echo api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'.$dir;?>'+image_url+'<?php echo '?'.api_get_cidreq(); ?>';
// show JPEG image in page
document.getElementById('upload_results').innerHTML =
document.getElementById('upload_results').innerHTML =
'<div style="width: 320px;">' +
'<h3><?php echo get_lang('ClipSent'); ?></h3>' +
'<h3><?php echo get_lang('ClipSent'); ?></h3>' +
'<img src="' + image_url + '">' +
'</div>';
// reset camera for another shot
@ -209,7 +208,7 @@ echo '</div>';
else alert("PHP Error: " + msg);
}
</script>
<script language=javascript>
var internaval=null;
var timeout=null;
@ -217,7 +216,7 @@ echo '</div>';
var fps=1000;//one frame per second
var maxclip=25;//maximum number of clips
var maxtime=60000;//stop after one minute
function stop_video() {
interval=window.clearInterval(interval);
}
@ -226,7 +225,7 @@ echo '</div>';
webcam.set_stealth( true ); // do not freeze image upon capture
interval=window.setInterval("clip_send_video()",fps);
}
function clip_send_video() {
counter++
timeout=setTimeout('stop_video()',maxtime);
@ -238,8 +237,8 @@ echo '</div>';
}
}
</script>
</td><td width=50>&nbsp;</td><td valign=top>
<div id="upload_results" style="background-color:#ffffff;"></div>
</td></tr></table>

@ -24,8 +24,6 @@ require_once 'dropbox_functions.inc.php';
// the dropbox class
require_once 'dropbox_class.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
/* DOWNLOAD A FOLDER */
$course_id = api_get_course_int_id();
@ -37,37 +35,37 @@ if (isset($_GET['cat_id']) AND is_numeric($_GET['cat_id']) AND $_GET['action'] =
// in dropbox_person (which stores the link file-person)
// Therefore we have to create to separate sql statements to find which files are in the categorie (depending if we zip-download a sent category or a
// received category)
if ($_GET['sent_received'] == 'sent') {
// here we also incorporate the person table to make sure that deleted sent documents are not included.
$sql = "SELECT DISTINCT file.id, file.filename, file.title
FROM ".$dropbox_cnf['tbl_file']." file INNER JOIN ".$dropbox_cnf['tbl_person']." person
$sql = "SELECT DISTINCT file.id, file.filename, file.title
FROM ".$dropbox_cnf['tbl_file']." file INNER JOIN ".$dropbox_cnf['tbl_person']." person
ON (person.file_id=file.id AND file.c_id = $course_id AND person.c_id = $course_id)
WHERE
file.uploader_id = $user_id AND
file.cat_id='".intval($_GET['cat_id'])."' AND
WHERE
file.uploader_id = $user_id AND
file.cat_id='".intval($_GET['cat_id'])."' AND
person.user_id = $user_id";
}
if ($_GET['sent_received'] == 'received') {
$sql = "SELECT DISTINCT file.id, file.filename, file.title
$sql = "SELECT DISTINCT file.id, file.filename, file.title
FROM ".$dropbox_cnf['tbl_file']." file INNER JOIN ".$dropbox_cnf['tbl_person']." person
ON (person.file_id=file.id AND file.c_id = $course_id AND person.c_id = $course_id)
INNER JOIN ".$dropbox_cnf['tbl_post']." post
ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id)
WHERE
post.cat_id = ".intval($_GET['cat_id'])." AND
WHERE
post.cat_id = ".intval($_GET['cat_id'])." AND
post.dest_user_id = $user_id" ;
}
}
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
$files_to_download[] = $row['id'];
}
}
if (!is_array($files_to_download) OR empty($files_to_download)) {
header('location: index.php?view='.Security::remove_XSS($_GET['sent_received']).'&error=ErrorNoFilesInFolder');
exit;
}
}
zip_download($files_to_download);
exit;
}
@ -99,36 +97,36 @@ if (!$allowed_to_download) {
Display::display_error_message(get_lang('YouAreNotAllowedToDownloadThisFile'));
Display::display_footer();
exit;
} else {
/* DOWNLOAD THE FILE */
} else {
/* DOWNLOAD THE FILE */
// the user is allowed to download the file
$_SESSION['_seen'][$_course['id']][TOOL_DROPBOX][] = intval($_GET['id']);
$work = new Dropbox_work($_GET['id']);
$path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server
if (!Security::check_abs_path($path, dropbox_cnf('sysPath').'/')) {
exit;
}
$file = $work->title;
$file = $work->title;
$mimetype = DocumentManager::file_get_mime_type(true);
$fileinfo = pathinfo($file);
$extension = $fileinfo['extension'];
if (!empty($extension) && isset($mimetype[$extension]) && $_GET['action'] != 'download') {
if (!empty($extension) && isset($mimetype[$extension]) && $_GET['action'] != 'download') {
// give hint to browser about filetype
header( 'Content-type: ' . $mimetype[$extension] . "\n");
} else {
//no information about filetype: force a download dialog window in browser
header( "Content-type: application/octet-stream\n");
}
/*if (!in_array(strtolower($extension), array('doc', 'xls', 'ppt', 'pps', 'sxw', 'sxc', 'sxi'))) {
header('Content-Disposition: inline; filename='.$file); // bugs with open office
} else {
header('Content-Disposition: attachment; filename='.$file);
}*/
header('Content-Disposition: attachment; filename='.$file);
/**
@ -153,10 +151,10 @@ if (!$allowed_to_download) {
header("Cache-Control: no-store, no-cache, must-revalidate\n"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0\n", false);
}*/
header('Content-Description: '.trim(htmlentities($file)));
header('Content-transfer-encoding: binary');
header("Content-Length: " . filesize($path)."\n" );
$fp = fopen( $path, 'rb');

@ -59,8 +59,6 @@ require_once 'dropbox_class.inc.php';
// including some libraries that are also used in the documents tool
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php'; // we use a function build_document_icon_tag
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
/* Virtual course support */

@ -124,7 +124,6 @@ if ($is_allowedToEdit && !empty ($choice) && $choice == 'exportqti2') {
require_once 'export/qti2/qti2_export.php';
$export = export_exercise($exerciseId, true);
require_once api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php';
$archive_path = api_get_path(SYS_ARCHIVE_PATH);
$temp_dir_short = api_get_unique_id();
$temp_zip_dir = $archive_path."/".$temp_dir_short;

@ -2461,7 +2461,6 @@ class Exercise
$nano = null;
if ($answerType == ORAL_EXPRESSION) {
require_once api_get_path(LIBRARY_PATH).'nanogong.lib.php';
$exe_info = get_exercise_results_by_attempt($exeId);
$exe_info = $exe_info[$exeId];

@ -134,9 +134,6 @@ function showQuestion($questionId, $only_questions = false, $origin = false, $cu
} elseif ($answerType == ORAL_EXPRESSION) {
//Add nanog
if (api_get_setting('enable_nanogong') == 'true') {
require_once api_get_path(LIBRARY_PATH).'nanogong.lib.php';
//@todo pass this as a parameter
global $exercise_stat_info, $exerciseId, $exe_id;

@ -11,7 +11,6 @@
if ( count( get_included_files() ) == 1 ) die( '---' );
if (!function_exists('mime_content_type')) {
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
function mime_content_type($filename) {
return DocumentManager::file_get_mime_type((string)$filename);
}
@ -97,8 +96,8 @@ class ImsAnswerMultipleChoice extends Answer
$out .= ' <prompt> ' . $questionStatment . ' </prompt>'. "\n";
if (is_array($this->answerList)) {
foreach ($this->answerList as $current_answer) {
$out .= ' <simpleChoice identifier="answer_' . $current_answer['id'] . '" fixed="false">' . $current_answer['answer'];
if (isset($current_answer['comment']) && $current_answer['comment'] != '')
{
@ -247,7 +246,7 @@ class ImsAnswerFillInBlanks extends Answer
$out = '';
if (is_array($this->answerList)) {
foreach ($this->answerList as $answerKey=>$answer) {
$answerKey = $answer['id'];
$answer = $answer['answer'];
$out .= ' <responseDeclaration identifier="fill_' . $answerKey . '" cardinality="single" baseType="identifier">' . "\n";

@ -22,7 +22,6 @@ $language_file = 'exercice';
include("../inc/global.inc.php");
$this_section = SECTION_COURSES;
include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
$nameTools = get_lang('ExerciseManagement');
if (isset($_SESSION['gradebook'])) {

@ -13,7 +13,7 @@
* multiple forums per group
* - sticky messages
* - new view option: nested view
* - quoting a message
* - quoting a message
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @copyright Ghent University
@ -54,7 +54,6 @@ $this_section = SECTION_COURSES;
api_protect_course_script(true);
// Including additional library scripts.
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools = get_lang('Forums');
@ -93,11 +92,11 @@ if ($actions == 'add') {
$interbreadcrumb[] = array('url' =>'index.php?gradebook='.$gradebook.'&amp;search='.$search_forum, 'name' => get_lang('Forum'));
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('AddForumCategory'));
break;
default:
default:
break;
}
} else {
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ForumCategories'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ForumCategories'));
}
Display::display_header('');
@ -108,9 +107,9 @@ Display::display_introduction_section(TOOL_FORUM);
$form_count = 0;
if (api_is_allowed_to_edit(false, true)) {
//if is called from a learning path lp_id
$lp_id = isset($_REQUEST['lp_id']) ? Security::remove_XSS($_REQUEST['lp_id']): null;
//if is called from a learning path lp_id
$lp_id = isset($_REQUEST['lp_id']) ? Security::remove_XSS($_REQUEST['lp_id']): null;
handle_forum_and_forumcategories($lp_id);
}
@ -174,7 +173,7 @@ $session_id = api_get_session_id();
echo '<div class="actions">';
//if is called from learning path
if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])){
if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])){
echo "<a href=\"../newscorm/lp_controller.php?".api_get_cidreq()."&gradebook=&action=add_item&type=step&lp_id=".$lp_id."#resource_tab-5\">".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"),'',ICON_SIZE_MEDIUM)."</a>";
}
if (!empty($forum_list)) {
@ -198,7 +197,7 @@ if (is_array($forum_categories_list)) {
// The forums in this category.
$forums_in_category = get_forums_in_category($forum_category['cat_id']);
echo '<table class="forum_table">';
// Validacion when belongs to a session.
@ -243,7 +242,7 @@ if (is_array($forum_categories_list)) {
echo '</tr>';
// Step 5: We display all the forums in this category.
foreach ($forum_list as $forum) {
// Here we clean the whatnew_post_info array a little bit because to display the icon we
// test if $whatsnew_post_info[$forum['forum_id']] is empty or not.
@ -259,7 +258,7 @@ if (is_array($forum_categories_list)) {
}
// Note: This can be speeded up if we transform the $forum_list to an array that uses the forum_category as the key.
if ($forum['forum_category'] == $forum_category['cat_id']) {
if ($forum['forum_category'] == $forum_category['cat_id']) {
// The forum has to be showed if
// 1.v it is a not a group forum (teacher and student)
// 2.v it is a group forum and it is public (teacher and student)
@ -278,10 +277,10 @@ if (is_array($forum_categories_list)) {
} else {
// you are not a teacher
// it is not a group forum => show forum (invisible forums are already left out see get_forums function)
if ($forum['forum_of_group'] == '0') {
if ($forum['forum_of_group'] == '0') {
$show_forum = true;
} else {
$show_forum = GroupManager::user_has_access($user_id, $forum['forum_of_group'], GroupManager::GROUP_TOOL_FORUM);
$show_forum = GroupManager::user_has_access($user_id, $forum['forum_of_group'], GroupManager::GROUP_TOOL_FORUM);
}
}
@ -402,8 +401,8 @@ if (is_array($forum_categories_list)) {
}
}
}
} else {
echo '<tr><td>'.get_lang('NoForumInThisCategory').'</td>'.(api_is_allowed_to_edit(false, true) ? '<td colspan="6"></td>' : '<td colspan="6"></td>').'</tr>';
} else {
echo '<tr><td>'.get_lang('NoForumInThisCategory').'</td>'.(api_is_allowed_to_edit(false, true) ? '<td colspan="6"></td>' : '<td colspan="6"></td>').'</tr>';
}
echo '</table>';
}

@ -32,9 +32,8 @@ require_once 'lib/gradebook_data_generator.class.php';
require_once 'lib/fe/gradebooktable.class.php';
require_once 'lib/fe/displaygradebook.php';
require_once 'lib/fe/userform.class.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'ezpdf/class.ezpdf.php';
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
for (i=0;i<$(".actions").length;i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {

@ -10,7 +10,6 @@
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../be.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
/**
* Extends formvalidator with import and export forms
@ -43,7 +42,7 @@ class DataForm extends FormValidator {
$this->build_export_form_option(false);
} else {
$this->build_export_form();
}
}
}
elseif ($this->form_type == self :: TYPE_EXPORT_PDF) {
$this->build_pdf_export_form();
@ -80,7 +79,7 @@ class DataForm extends FormValidator {
$this->addElement('header', get_lang('ChooseFormat'));
$this->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV (Comma-Separated Values)', 'csv');
$this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml');
$this->addElement('radio', 'file_type', Display::return_icon('info3.gif',get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled'));
$this->addElement('radio', 'file_type', Display::return_icon('info3.gif',get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled'));
$this->addElement('style_submit_button', 'submit', get_lang('Export'), 'class="upload"');
$this->setDefaults(array (
'file_type' => 'csv'

@ -10,7 +10,6 @@
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../be.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
/**
* Extends formvalidator with add&edit forms for evaluations

@ -10,7 +10,6 @@
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../be.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
/**
* Form used to add or edit links

@ -10,7 +10,6 @@
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../be.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
/**
* Forms related to links
@ -75,20 +74,20 @@ class LinkForm extends FormValidator
$select = $this->addElement('select', 'select_link', get_lang('ChooseLink'), null, array('onchange' => 'document.create_link.submit()'));
$linktypes = LinkFactory :: get_all_types();
$select->addoption('['.get_lang('ChooseLink').']', 0);
$cc = $this->category_object->get_course_code();
foreach ($linktypes as $linktype) {
$link = LinkFactory :: create ($linktype);
$link = LinkFactory :: create ($linktype);
if (!empty($cc)) {
$link->set_course_code($cc);
} elseif(!empty($_GET['course_code'])) {
$link->set_course_code(Database::escape_string($_GET['course_code']));
}
}
// disable this element if the link works with a dropdownlist
// and if there are no links left
// and if there are no links left
if (!$link->needs_name_and_description() && count($link->get_all_links()) == '0') {
$select->addoption($link->get_type_name(), $linktype, 'disabled');
} else {

@ -10,7 +10,6 @@
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../be.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php';
/**
* Extends formvalidator with import and export forms

@ -30,7 +30,6 @@ $nameTools = get_lang('GroupOverview');
/* Libraries */
include_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
include_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
if (isset($_GET['action'])) {
@ -101,7 +100,7 @@ foreach ($categories as $index => $category) {
}
$groups = GroupManager::get_group_list($category['id']);
echo '<ul>';
if (!empty($groups)) {
if (!empty($groups)) {
foreach ($groups as $index => $group) {
echo '<li>';
echo Display::tag('h3', Security::remove_XSS($group['name']));
@ -112,16 +111,16 @@ foreach ($categories as $index => $category) {
$user_info = api_get_user_info($user);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $user_info['username']), ENT_QUOTES);
echo '<li title="'.$username.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</li>';
}
}
} else {
//echo Display::tag('li', get_lang('NoStudents'));
//echo Display::tag('li', get_lang('NoStudents'));
}
echo '</ul>';
echo '</li>';
}
} else {
//echo Display::tag('li', get_lang('NoData'));
}
}
} else {
//echo Display::tag('li', get_lang('NoData'));
}
echo '</ul>';
}

@ -5,8 +5,6 @@
*/
require_once '../global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
$action = $_REQUEST['a'];
switch($action) {
case 'upload_file':

@ -8,22 +8,21 @@ $language_file = array('exercice','document');
require_once '../global.inc.php';
//@todo for some reason nanogong doesn't like this variables
//@todo for some reason nanogong doesn't like this variables
//api_protect_course_script(true);
$action = $_REQUEST['a'];
require_once api_get_path(LIBRARY_PATH).'nanogong.lib.php';
unset($_REQUEST['a']);
$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
//Fix in order to add the exe_id
//Fix in order to add the exe_id
if (isset($_REQUEST['from_htaccess'])) {
if (isset($_REQUEST['file'])) {
$fileinfo = pathinfo($_REQUEST['file']);
$items = explode('-', $fileinfo['filename']);
$_REQUEST['exe_id'] = $items[5];
$_REQUEST['exe_id'] = $items[5];
}
}
$nano = new Nanogong($_REQUEST);
@ -33,29 +32,29 @@ if (isset($_REQUEST['is_nano'])) {
$is_nano = true;
}
switch ($action) {
case 'get_file':
switch ($action) {
case 'get_file':
if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
$file_path = $nano->load_filename_if_exists();
//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
if ($file_path) {
$info = pathinfo($file_path);
//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
if ($file_path) {
$info = pathinfo($file_path);
$user_info = api_get_user_info($nano->params['user_id']);
$name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
$download = true;
if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) {
$download = false;
}
}
DocumentManager::file_send_for_download($file_path, $download);
exit;
}
}
}
break;
case 'show_audio':
case 'show_audio':
if (!$is_nano) {
echo $nano->return_js($_REQUEST);
}
echo $nano->show_audio_file($is_nano);
echo $nano->show_audio_file($is_nano);
break;
case 'delete':
$return = $nano->delete_files();
@ -68,15 +67,15 @@ switch ($action) {
break;
case 'show_form':
api_protect_course_script(true);
Display::display_reduced_header();
echo $nano->return_js($_REQUEST);
Display::display_reduced_header();
echo $nano->return_js($_REQUEST);
echo $nano->return_form();
break;
case 'save_file':
break;
case 'save_file':
//User access same as upload.php
$return = $nano->upload_file($is_nano);
if ($is_nano) {
//nano looks for numbers
if ($return == 1) {
@ -87,7 +86,7 @@ switch ($action) {
//Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension'));
}
} else {
Display::display_reduced_header();
Display::display_reduced_header();
echo $nano->return_js($_REQUEST);
//normal form
if ($return == 1) {
@ -95,7 +94,7 @@ switch ($action) {
$message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm');
} else {
$message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning');
}
}
echo $nano->return_form($message);
}
break;

@ -11,8 +11,6 @@
/**
* Code
*/
require_once 'document.lib.php';
/**
*
* @package chamilo.library

@ -4,13 +4,12 @@
/* INIT SECTION */
$language_file = array('create_course', 'document');
require 'global.inc.php';
require_once 'global.inc.php';
/* Libraries */
require_once api_get_path(LIBRARY_PATH).'fckeditor/repository.php';
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
//if(!$is_in_admin){
if (!api_is_platform_admin()){

@ -23,8 +23,6 @@ $permissions_for_new_directories = api_get_permissions_for_new_directories();
$permissions_for_new_files = api_get_permissions_for_new_files();
if (!empty($_course['path'])) {
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
// Get the Chamilo session properties. Before ajaximagemanager!!!
$to_group_id = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : 0;

@ -7,7 +7,6 @@
/**
* Code
*/
require_once 'document.lib.php';
/**
* This library contains some functions for group-management.

@ -4,11 +4,10 @@
/* Receives JPEG webcam submission and saves to local file. */
/* Make sure your directory has permission to write files as your web server user! */
require_once '../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
////Add security from Chamilo
//Add security from Chamilo
api_protect_course_script();
api_block_anonymous_users();
///
# Save the audio to a URL-accessible directory for playback.
parse_str($_SERVER['QUERY_STRING'], $params);

@ -2779,7 +2779,6 @@ function api_is_allowed($tool, $action, $task_id = 0) {
//if (!$_SESSION['total_permissions'][$_course['code']] and $_course)
if (is_array($_course) and count($_course) > 0) {
require_once api_get_path(SYS_CODE_PATH).'permissions/permissions_functions.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
// Getting the permissions of this user.
if ($task_id == 0) {

@ -16,7 +16,6 @@ $language_file = array('document'); //Chamilo load lang var
//Chamilo load libraries
require_once '../../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
//Add security from Chamilo
api_protect_course_script();

@ -5,8 +5,6 @@
*/
//Chamilo load libraries
require_once '../../../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//Add security from Chamilo
api_protect_course_script();
@ -16,7 +14,6 @@ $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$course_info = api_get_course_info();
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$groupdirpath = $group_properties['directory'];
$group_disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$groupdirpath.'/';
@ -24,7 +21,7 @@ $group_web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/documen
//get all group files and folders
$docs_and_folders = DocumentManager::get_all_document_data($course_info, $groupdirpath, api_get_group_id(), null, $is_allowed_to_edit, false);
//get all group filenames
$array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array();
@ -33,7 +30,7 @@ if (count($array_to_search) > 0) {
$all_files[] = basename($array_to_search[$key]['path']);
}
}
//get all svg and png group files
$accepted_extensions = array('.svg', '.png');
@ -61,23 +58,23 @@ $style .='</style>';
echo '<h2>'.get_lang('GroupSingle').': '.$group_properties['name'].'</h2>';
if (($group_properties['doc_state'] == 2 && ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $_SESSION['_gid']))) || $group_properties['doc_state'] == 1){
if (!empty($png_svg_files)) {
echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
echo '<ul>';
foreach($png_svg_files as $filename) {
$image = $group_disk_path.$filename;
foreach($png_svg_files as $filename) {
$image = $group_disk_path.$filename;
if (strpos($filename, "svg")){
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
}
else {
$new_sizes = api_resize_image($image, 60, 60);
}
}
echo '<li style="display:inline; padding:8px;">';
echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">';
echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}
echo '</ul>';
}
@ -91,8 +88,8 @@ if (($group_properties['doc_state'] == 2 && ($is_allowed_to_edit || GroupManager
$('a').click(function() {
var href = this.href;
// Convert Non-SVG images to data URL first
// Convert Non-SVG images to data URL first
// (this could also have been done server-side by the library)
if(this.href.indexOf('.svg') === -1) {
@ -101,7 +98,7 @@ $('a').click(function() {
id: href
});
window.top.postMessage(meta_str, "*");
var img = new Image();
img.onload = function() {
var canvas = document.createElement("canvas");
@ -132,7 +129,7 @@ $('a').click(function() {
data = '|' + href + '|' + data;
// This is where the magic happens!
window.top.postMessage(data, "*");
}, 'html'); // 'html' is necessary to keep returned data as a string
}
return false;

@ -5,7 +5,6 @@
*/
//Chamilo load libraries
require_once '../../../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
//Add security from Chamilo
api_protect_course_script();
@ -62,7 +61,7 @@ if (!empty($png_svg_files)) {
echo '<ul>';
foreach($png_svg_files as $filename) {
$image=$disk_path.$filename;
if (strpos($filename, "svg")){
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
@ -70,7 +69,7 @@ if (!empty($png_svg_files)) {
else {
$new_sizes = api_resize_image($image, 60, 60);
}
echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}
echo '</ul>';
@ -82,8 +81,8 @@ if (!empty($png_svg_files)) {
<script>
$('a').click(function() {
var href = this.href;
// Convert Non-SVG images to data URL first
// Convert Non-SVG images to data URL first
// (this could also have been done server-side by the library)
if(this.href.indexOf('.svg') === -1) {
@ -92,7 +91,7 @@ $('a').click(function() {
id: href
});
window.top.postMessage(meta_str, "*");
var img = new Image();
img.onload = function() {
var canvas = document.createElement("canvas");
@ -123,7 +122,7 @@ $('a').click(function() {
data = '|' + href + '|' + data;
// This is where the magic happens!
window.top.postMessage(data, "*");
}, 'html'); // 'html' is necessary to keep returned data as a string
}
return false;

@ -1,7 +1,6 @@
<?php
require_once '../../../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
////Add security from Chamilo
//Add security from Chamilo
api_protect_course_script();
api_block_anonymous_users();
//

@ -15,8 +15,6 @@
session_cache_limiter('public');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
// IMPORTANT to avoid caching of documents
header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');

@ -889,8 +889,6 @@ class scorm extends learnpath
//zip everything that is in the corresponding scorm dir
//write the zip file somewhere (might be too big to return)
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once 'learnpath_functions.inc.php';
$course_id = api_get_course_int_id();
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);

@ -35,7 +35,6 @@ if ($mainUserInfo['status']==1)
}
include_once('permissions_functions.inc.php');
include_once(api_get_path(LIBRARY_PATH) . "/groupmanager.lib.php");
// ACTIONS
if (isset($_GET['do']))
{

@ -12,7 +12,6 @@ if ($mainUserInfo['status']==1)
}
include_once('permissions_functions.inc.php');
include_once('all_permissions.inc.php');
include_once (api_get_library_path()."/groupmanager.lib.php");
include_once (api_get_library_path()."/blog.lib.php");
// ---------------------------------------------------
// ACTIONS

@ -54,8 +54,6 @@ if (!$is_allowed_to_edit) {
api_not_allowed(true);
}
require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
/*
Variables
- some need defining before inclusion of libraries

@ -15,9 +15,7 @@ $language_file[] = "document"; //the document file is loaded because most of the
$language_file[] = "learnpath";
$language_file[] = "scormdocument";
// global settings initialisation
// also provides access to main api (inc/lib/main_api.lib.php)
include("../inc/global.inc.php");
require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
require_once "../inc/global.inc.php";
$form_style = '

Loading…
Cancel
Save