[svn r10757] Update the course creation file.

Add more default images when create a course in the document tool
skala
Julian Prud'homme 19 years ago
parent fa272eb08a
commit c6ff9611dc
  1. BIN
      main/img/default_courses_img/board.gif
  2. BIN
      main/img/default_courses_img/book.gif
  3. BIN
      main/img/default_courses_img/book_highlight.gif
  4. BIN
      main/img/default_courses_img/bookcase.gif
  5. BIN
      main/img/default_courses_img/calendar.gif
  6. BIN
      main/img/default_courses_img/computer.gif
  7. BIN
      main/img/default_courses_img/emot_happy.gif
  8. BIN
      main/img/default_courses_img/emot_neutral.gif
  9. BIN
      main/img/default_courses_img/emot_sad.gif
  10. BIN
      main/img/default_courses_img/emot_wink.gif
  11. BIN
      main/img/default_courses_img/female.gif
  12. BIN
      main/img/default_courses_img/floppy.gif
  13. BIN
      main/img/default_courses_img/geometry.gif
  14. BIN
      main/img/default_courses_img/group.gif
  15. BIN
      main/img/default_courses_img/hal.gif
  16. BIN
      main/img/default_courses_img/homework.gif
  17. BIN
      main/img/default_courses_img/idea.gif
  18. BIN
      main/img/default_courses_img/interaction.gif
  19. BIN
      main/img/default_courses_img/japanese.gif
  20. BIN
      main/img/default_courses_img/keyboard.gif
  21. BIN
      main/img/default_courses_img/linux.gif
  22. BIN
      main/img/default_courses_img/male.gif
  23. BIN
      main/img/default_courses_img/maths.gif
  24. BIN
      main/img/default_courses_img/mechanism.gif
  25. BIN
      main/img/default_courses_img/mouse.gif
  26. BIN
      main/img/default_courses_img/newspaper.gif
  27. BIN
      main/img/default_courses_img/note.gif
  28. BIN
      main/img/default_courses_img/planet.gif
  29. BIN
      main/img/default_courses_img/presentation.gif
  30. BIN
      main/img/default_courses_img/redlight.gif
  31. BIN
      main/img/default_courses_img/science.gif
  32. BIN
      main/img/default_courses_img/search.gif
  33. BIN
      main/img/default_courses_img/speech.gif
  34. BIN
      main/img/default_courses_img/teacher.gif
  35. BIN
      main/img/default_courses_img/time.gif
  36. BIN
      main/img/default_courses_img/tutorial.gif
  37. BIN
      main/img/default_courses_img/wallet.gif
  38. BIN
      main/img/default_courses_img/wikipedia.gif
  39. BIN
      main/img/default_courses_img/work.gif
  40. BIN
      main/img/default_courses_img/world.gif
  41. BIN
      main/img/default_courses_img/write.gif
  42. 87
      main/inc/lib/add_course.lib.inc.php

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

@ -214,6 +214,7 @@ function prepare_course_repository($courseRepository, $courseId)
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository, 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document", 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/images", 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/images/default_course_img/", 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/audio", 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/flash", 0777);
mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/video", 0777);
@ -1275,18 +1276,41 @@ function fill_course_repository($courseRepository)
fputs($fp, $enreg);
}
fclose($fp);
$img_code_path = api_get_path(SYS_CODE_PATH)."img/default_courses_img/";
$course_documents_folder=$sys_course_path.$courseRepository.'/document/images/';
$course_documents_folder=$sys_course_path.$courseRepository.'/document/images/default_course_img/';
mkdir($course_documents_folder,'0777');
$dirs=array();
$handle = opendir($img_code_path);
while (false !== ($file = readdir($handle))) {
copy($img_code_path.$file,$course_documents_folder.$file);
chmod($course_documents_folder.$file,"0777");
if(is_dir($img_code_path.$file) && $file!=".svn" && $file!="." && $file!=".."){
mkdir($course_documents_folder.$file,'0777');
$dirs[]=$file.'/';
}
elseif(is_file($img_code_path.$file) && $file!="." && $file!=".." && $file!=".svn"){
copy($img_code_path.$file,$course_documents_folder.$file);
chmod($course_documents_folder.$file,"0777");
}
}
fclose($fp);
closedir($handle);
foreach($dirs as $current_dir){
$handle = opendir($img_code_path.$current_dir);
while (false !== ($file = readdir($handle))) {
if(is_file($img_code_path.$current_dir.$file) && $file!="." && $file!=".."){
copy($img_code_path.$current_dir.$file,$course_documents_folder.$current_dir.$file);
chmod($course_documents_folder.$current_dir.$file,"0777");
}
}
closedir($handle);
}
return 0;
};
@ -1479,7 +1503,11 @@ function fill_Db_course($courseDbName, $courseRepository, $language)
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('/images','".get_lang('Images')."','folder','0')");
$example_doc_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$example_doc_id,'DocumentAdded',1,0,NULL,0)");
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('/images/default_course_img','".get_lang('DefaultCourseImages')."','folder','0')");
$example_doc_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$example_doc_id,'DocumentAdded',1,0,NULL,0)");
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('/audio','".get_lang('Audio')."','folder','0')");
$example_doc_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$example_doc_id,'DocumentAdded',1,0,NULL,0)");
@ -1495,18 +1523,55 @@ function fill_Db_course($courseDbName, $courseRepository, $language)
//FILL THE COURSE DOCUMENT WITH DEFAULT COURSE PICTURES
$img_code_path = api_get_path(SYS_CODE_PATH)."img/default_courses_img/";
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$img_code_path = api_get_path(SYS_CODE_PATH)."img/default_courses_img/";
$img_documents='/images/default_course_img/';
$dirs=array();
$handle = opendir($img_code_path);
while (false !== ($file = readdir($handle))) {
if($file!="." && $file!=".."){
$file=lang2db($file);
if(is_dir($img_code_path.$file) && $file!=".svn" && $file!="." && $file!=".."){
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('$img_documents$file','$file','folder','0')");
$image_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$image_id,'DocumentAdded',1,0,NULL,0)");
$dirs[]=$file.'/';
}
elseif(is_file($img_code_path.$file) && $file!="." && $file!=".." && $file!=".svn"){
$file_size=filesize($img_code_path.$file);
$file=lang2db($file);
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('/images/','$file','file','$file_size')");
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('$img_documents$file','$file','file','$file_size')");
$image_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$image_id,'DocumentAdded',1,0,NULL,0)");
}
}
closedir($handle);
$img_documents='/images/default_course_img/';
foreach($dirs as $current_dir){
$handle = opendir($img_code_path.$current_dir);
while (false !== ($file = readdir($handle))) {
if(is_file($img_code_path.$current_dir.$file) && $file!="." && $file!=".."){
$file_size=filesize($img_code_path.$current_dir.$file);
api_sql_query("INSERT INTO `".$TABLETOOLDOCUMENT . "`(path,title,filetype,size) VALUES ('$img_documents$current_dir$file','$langTitle','file','$file_size')");
$image_id = Database :: get_last_insert_id();
api_sql_query("INSERT INTO `".$TABLEITEMPROPERTY . "` (tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility) VALUES ('document',1,NOW(),NOW(),$image_id,'DocumentAdded',1,0,NULL,0)");
}
}
closedir($handle);
}
/*
-----------------------------------------------------------

Loading…
Cancel
Save