Просмотр исходного кода

[svn r10204] coding standards for the inclusion of the language file.
$langFile -> $language_file
+ adding a consistent comment line throughout the code
+ some cleanup

Patrick Cool 18 лет назад
Родитель
Сommit
8c09063079
100 измененных файлов с 989 добавлено и 955 удалено
  1. 2 1
      index.php
  2. 2 1
      main/admin/add_courses_to_session.php
  3. 2 1
      main/admin/add_users_to_session.php
  4. 4 2
      main/admin/class_add.php
  5. 5 2
      main/admin/class_edit.php
  6. 3 2
      main/admin/class_import.php
  7. 3 2
      main/admin/class_information.php
  8. 4 2
      main/admin/class_list.php
  9. 2 1
      main/admin/class_user_import.php
  10. 2 1
      main/admin/configure_extensions.php
  11. 3 2
      main/admin/configure_homepage.php
  12. 4 2
      main/admin/course_add.php
  13. 3 2
      main/admin/course_category.php
  14. 4 2
      main/admin/course_create_content.php
  15. 4 2
      main/admin/course_edit.php
  16. 1 1
      main/admin/course_import.php
  17. 4 2
      main/admin/course_information.php
  18. 4 2
      main/admin/course_list.php
  19. 2 2
      main/admin/course_user_import.php
  20. 3 4
      main/admin/course_virtual.php
  21. 3 3
      main/admin/index.php
  22. 3 3
      main/admin/languages.php
  23. 3 1
      main/admin/resume_session.php
  24. 2 1
      main/admin/session_add.php
  25. 2 1
      main/admin/session_course_edit.php
  26. 2 1
      main/admin/session_course_list.php
  27. 2 1
      main/admin/session_course_user_list.php
  28. 2 1
      main/admin/session_edit.php
  29. 2 2
      main/admin/session_export.php
  30. 2 2
      main/admin/session_import.php
  31. 2 1
      main/admin/session_list.php
  32. 3 3
      main/admin/settings.php
  33. 3 3
      main/admin/statistics.php
  34. 2 2
      main/admin/statistics/index.php
  35. 3 3
      main/admin/subscribe_class2course.php
  36. 3 3
      main/admin/subscribe_user2class.php
  37. 3 3
      main/admin/subscribe_user2course.php
  38. 3 2
      main/admin/system_announcements.php
  39. 3 3
      main/admin/user_add.php
  40. 3 3
      main/admin/user_edit.php
  41. 3 3
      main/admin/user_export.php
  42. 3 3
      main/admin/user_import.php
  43. 3 2
      main/admin/user_information.php
  44. 3 3
      main/admin/user_list.php
  45. 5 5
      main/announcements/announcements.php
  46. 3 3
      main/auth/courses.php
  47. 3 3
      main/auth/inscription.php
  48. 3 3
      main/auth/inscription_second.php
  49. 3 2
      main/auth/lostPassword.php
  50. 2 1
      main/auth/my_progress.php
  51. 3 2
      main/auth/profile.php
  52. 2 1
      main/blog/blog.php
  53. 122 122
      main/blog/blog_admin.php
  54. 376 375
      main/blog/blog_backup_may3_surbhi.php
  55. 5 4
      main/blog/calendar.php
  56. 3 3
      main/calendar/agenda.php
  57. 3 3
      main/calendar/calendar.php
  58. 2 2
      main/calendar/myagenda.php
  59. 2 3
      main/calendar/print.php
  60. 3 2
      main/chat/chat.php
  61. 3 50
      main/conf/index.php
  62. 3 3
      main/course_description/index.php
  63. 3 3
      main/course_home/course_home.php
  64. 3 3
      main/course_info/delete_course.php
  65. 3 2
      main/course_info/infocours.php
  66. 2 1
      main/course_info/maintenance.php
  67. 3 2
      main/course_info/postpone.php
  68. 3 2
      main/coursecopy/backup.php
  69. 3 2
      main/coursecopy/copy_course.php
  70. 3 2
      main/coursecopy/create_backup.php
  71. 3 2
      main/coursecopy/import_backup.php
  72. 3 2
      main/coursecopy/recycle_course.php
  73. 3 2
      main/create_course/add_course.php
  74. 4 2
      main/document/create_document.php
  75. 4 2
      main/document/document.php
  76. 7 3
      main/document/edit_document.php
  77. 3 1
      main/document/headerpage.php
  78. 4 4
      main/document/quota.php
  79. 3 2
      main/document/slideshow.php
  80. 3 2
      main/document/slideshowoptions.php
  81. 4 4
      main/document/upload.php
  82. 2 1
      main/dropbox/dropbox_download.php
  83. 2 1
      main/dropbox/dropbox_init.inc.php
  84. 2 1
      main/exercice/addlimits.php
  85. 3 2
      main/exercice/admin.php
  86. 3 2
      main/exercice/adminhp.php
  87. 2 1
      main/exercice/exercice.php
  88. 3 2
      main/exercice/exercice_submit.php
  89. 3 2
      main/exercice/exercise_result.php
  90. 2 1
      main/exercice/exercise_show.php
  91. 2 1
      main/exercice/feedback.php
  92. 2 1
      main/exercice/hotpotatoes.php
  93. 214 213
      main/exercice/mark_free_answer.php
  94. 3 2
      main/exercice/question_pool.php
  95. 2 1
      main/exercice/savescores.php
  96. 2 1
      main/exercice/testheaderpage.php
  97. 2 1
      main/external_module/external_module.php
  98. 2 1
      main/forum/editpost.php
  99. 2 1
      main/forum/iframe_thread.php
  100. 2 1
      main/forum/index.php

+ 2 - 1
index.php

@@ -62,7 +62,8 @@ define("SCRIPTVAL_NewEntriesOfTheDayOfLastLogin", 5);
 define("SCRIPTVAL_NoTimeLimit", 6);
 // End 'don't change' section
 
-$langFile = array ('courses', 'index');
+// name of the language file that needs to be included 
+$language_file = array ('courses', 'index');
 $cidReset = true; /* Flag forcing the 'current course' reset,
                    as we're not inside a course anymore  */
 /*

+ 2 - 1
main/admin/add_courses_to_session.php

@@ -27,7 +27,8 @@
 ==============================================================================
 */
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 1
main/admin/add_users_to_session.php

@@ -27,7 +27,8 @@
 ==============================================================================
 */
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 4 - 2
main/admin/class_add.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: class_add.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: class_add.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -29,7 +29,9 @@
 ==============================================================================
 */
 
-$langFile = 'admin';
+// name of the language file that needs to be included 
+$language_file = 'admin';
+
 $cidReset = true;
 include ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 5 - 2
main/admin/class_edit.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: class_edit.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: class_edit.php 10204 2006-11-26 20:46:53Z pcool $
 
 /*
 ==============================================================================
@@ -28,7 +28,10 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
+
 $cidReset = true;
 include ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 3 - 2
main/admin/class_import.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: class_import.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: class_import.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -76,7 +76,8 @@ function save_data($classes)
 
 
 
-$langFile = array ('admin', 'registration');
+// name of the language file that needs to be included 
+$language_file = array ('admin', 'registration');
 
 $cidReset = true;
 

+ 3 - 2
main/admin/class_information.php

@@ -1,4 +1,4 @@
-<?php // $Id: class_information.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: class_information.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -34,7 +34,8 @@
 ==============================================================================
 */ 
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 4 - 2
main/admin/class_list.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: class_list.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: class_list.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -27,7 +27,9 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 $this_section = SECTION_PLATFORM_ADMIN;

+ 2 - 1
main/admin/class_user_import.php

@@ -144,7 +144,8 @@ function parse_csv_data($file)
 	return $courses;
 }
 
-$langFile = array ('admin', 'registration');
+// name of the language file that needs to be included 
+$language_file = array ('admin', 'registration');
 
 $cidReset = true;
 

+ 2 - 1
main/admin/configure_extensions.php

@@ -22,7 +22,8 @@
 ==============================================================================
 */
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 3 - 2
main/admin/configure_homepage.php

@@ -1,4 +1,4 @@
-<?php // $Id: configure_homepage.php 10191 2006-11-24 08:09:14Z pcool $
+<?php // $Id: configure_homepage.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -22,7 +22,8 @@
 ==============================================================================
 */
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 4 - 2
main/admin/course_add.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: course_add.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: course_add.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,7 +33,9 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = array('admin','create_course');
+
+// name of the language file that needs to be included 
+$language_file = array('admin','create_course');
 $cidReset = true;
 require_once ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 3 - 2
main/admin/course_category.php

@@ -1,4 +1,4 @@
-<?php // $Id: course_category.php 10191 2006-11-24 08:09:14Z pcool $
+<?php // $Id: course_category.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -27,7 +27,8 @@
 ==============================================================================
 */
 
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 4 - 2
main/admin/course_create_content.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: course_create_content.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: course_create_content.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -36,7 +36,9 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
 include ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;
 

+ 4 - 2
main/admin/course_edit.php

@@ -1,6 +1,6 @@
 <?php
 
-// $Id: course_edit.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: course_edit.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -34,7 +34,9 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
 $cidReset = true;
 include ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 1 - 1
main/admin/course_import.php

@@ -138,7 +138,7 @@ function parse_csv_data($file)
 	return $courses;
 }
 
-$langFile = array ('admin', 'registration','create_course');
+$language_file = array ('admin', 'registration','create_course');
 
 $cidReset = true;
 

+ 4 - 2
main/admin/course_information.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: course_information.php 10197 2006-11-26 18:45:33Z pcool $
+// $Id: course_information.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,7 +33,9 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 require_once(api_get_path(LIBRARY_PATH).'sortabletable.class.php');

+ 4 - 2
main/admin/course_list.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: course_list.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: course_list.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,7 +33,9 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included 
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 $this_section = SECTION_PLATFORM_ADMIN;

+ 2 - 2
main/admin/course_user_import.php

@@ -156,8 +156,8 @@ function parse_csv_data($file)
 	$courses = Import :: csv_to_array($file);
 	return $courses;
 }
-
-$langFile = array ('admin', 'registration');
+// name of the language file that needs to be included 
+$language_file = array ('admin', 'registration');
 
 $cidReset = true;
 

+ 3 - 4
main/admin/course_virtual.php

@@ -1,4 +1,4 @@
-<?php // $Id: course_virtual.php 10191 2006-11-24 08:09:14Z pcool $ 
+<?php // $Id: course_virtual.php 10204 2006-11-26 20:46:53Z pcool $ 
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -35,9 +35,8 @@
 ============================================================================== 
 */ 
 
-// name of the language file which needs to be included 
-// 'inc.php' is automatically appended to the file name 
-$langFile = "admin"; 
+// name of the language file that needs to be included 
+$language_file = 'admin'; 
 $extra_lang_file = "create_course";
 
 // global settings initialisation 

+ 3 - 3
main/admin/index.php

@@ -1,4 +1,4 @@
-<?php // $Id: index.php 10191 2006-11-24 08:09:14Z pcool $
+<?php // $Id: index.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -28,8 +28,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-
-$langFile=array('admin','tracking');
+// name of the language file that needs to be included <br />
+$language_file=array('admin','tracking');
 
 $cidReset=true;
 

+ 3 - 3
main/admin/languages.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: languages.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: languages.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -41,8 +41,8 @@
 	   INIT SECTION
 ============================================================================== 
 */
-// language file to be included 
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 // we are in the admin area so we do not need a course id
 $cidReset = true;

+ 3 - 1
main/admin/resume_session.php

@@ -33,7 +33,9 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'admin';
+
+// name of the language file that needs to be included
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 api_protect_admin_script();

+ 2 - 1
main/admin/session_add.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 1
main/admin/session_course_edit.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 1
main/admin/session_course_list.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 1
main/admin/session_course_user_list.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included 
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 1
main/admin/session_edit.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included
+$language_file ='admin';
 
 $cidReset=true;
 

+ 2 - 2
main/admin/session_export.php

@@ -26,8 +26,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-
-$langFile='admin';
+// name of the language file that needs to be included
+$language_file='admin';
 
 $cidReset=true;
 

+ 2 - 2
main/admin/session_import.php

@@ -26,8 +26,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-
-$langFile = array('admin','registration');
+// name of the language file that needs to be included
+$language_file = array('admin','registration');
 
 $cidReset=true;
 

+ 2 - 1
main/admin/session_list.php

@@ -1,5 +1,6 @@
 <?php
-$langFile='admin';
+// name of the language file that needs to be included
+$language_file='admin';
 
 $cidReset=true;
 

+ 3 - 3
main/admin/settings.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: settings.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: settings.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -40,8 +40,8 @@
 		INIT SECTION
 ==============================================================================
 */
-// stating the language file
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 // including some necessary dokeos files
 include_once ('../inc/global.inc.php');

+ 3 - 3
main/admin/statistics.php

@@ -1,4 +1,4 @@
-<?php // $Id: statistics.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: statistics.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -32,8 +32,8 @@
 		INIT SECTION
 ==============================================================================
 */
-
-$langFile='admin';
+// name of the language file that needs to be included
+$language_file='admin';
 $cidReset=true;
 include('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 2 - 2
main/admin/statistics/index.php

@@ -25,8 +25,8 @@
 * @package dokeos.statistics
 ==============================================================================
 */
-
-$langFile=array('admin','tracking');
+// name of the language file that needs to be included
+$language_file=array('admin','tracking');
 $cidReset = true;
 
 include('../../inc/global.inc.php');

+ 3 - 3
main/admin/subscribe_class2course.php

@@ -1,6 +1,6 @@
 <?php
 
-// $Id: subscribe_class2course.php 10190 2006-11-24 00:23:20Z pcool $
+// $Id: subscribe_class2course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -28,8 +28,8 @@
 *	@package dokeos.admin
 ============================================================================== 
 */
-
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 $cidReset = true;
 

+ 3 - 3
main/admin/subscribe_user2class.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: subscribe_user2class.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: subscribe_user2class.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -27,8 +27,8 @@
 *	@package dokeos.admin
 ============================================================================== 
 */
-
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 $cidReset = true;
 

+ 3 - 3
main/admin/subscribe_user2course.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: subscribe_user2course.php 10190 2006-11-24 00:23:20Z pcool $
+// $Id: subscribe_user2course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -39,8 +39,8 @@
 		INIT SECTION
 ==============================================================================
 */
-
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 $cidReset = true;
 

+ 3 - 2
main/admin/system_announcements.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: system_announcements.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: system_announcements.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,7 +33,8 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = array ('admin', 'agenda');
+// name of the language file that needs to be included
+$language_file = array ('admin', 'agenda');
 $cidReset = true;
 include ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 3 - 3
main/admin/user_add.php

@@ -1,4 +1,4 @@
-<?php // $Id: user_add.php 10190 2006-11-24 00:23:20Z pcool $
+<?php // $Id: user_add.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -27,8 +27,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-// language file
-$langFile = array('admin','registration');
+// name of the language file that needs to be included
+$language_file = array('admin','registration');
 $cidReset = true;
 
 // including necessary libraries

+ 3 - 3
main/admin/user_edit.php

@@ -1,4 +1,4 @@
-<?php // $Id: user_edit.php 10190 2006-11-24 00:23:20Z pcool $
+<?php // $Id: user_edit.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -27,8 +27,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-
-$langFile=array('admin','registration');
+// name of the language file that needs to be included
+$language_file=array('admin','registration');
 $cidReset=true;
 include('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 3 - 3
main/admin/user_export.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: user_export.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: user_export.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -28,8 +28,8 @@
 *	@package dokeos.admin
 ==============================================================================
 */
-
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 
 $cidReset = true;
 

+ 3 - 3
main/admin/user_import.php

@@ -1,6 +1,6 @@
 <?php
 
-// $Id: user_import.php 10190 2006-11-24 00:23:20Z pcool $
+// $Id: user_import.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -274,8 +274,8 @@ function parse_xml_data($file)
 	xml_parser_free($parser);
 	return $users;
 }
-
-$langFile = array ('admin', 'registration');
+// name of the language file that needs to be included
+$language_file = array ('admin', 'registration');
 
 $cidReset = true;
 include ('../inc/global.inc.php');

+ 3 - 2
main/admin/user_information.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: user_information.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: user_information.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,7 +33,8 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 $this_section=SECTION_PLATFORM_ADMIN;

+ 3 - 3
main/admin/user_list.php

@@ -1,6 +1,6 @@
 <?php
 
-// $Id: user_list.php 10197 2006-11-26 18:45:33Z pcool $
+// $Id: user_list.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -30,8 +30,8 @@
 ==============================================================================
 */
 
-
-$langFile = 'admin';
+// name of the language file that needs to be included
+$language_file = 'admin';
 $cidReset = true;
 require ('../inc/global.inc.php');
 require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');

+ 5 - 5
main/announcements/announcements.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.php 10197 2006-11-26 18:45:33Z pcool $
+<?php //$Id: announcements.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -40,10 +40,10 @@
 		INIT SECTION
 ==============================================================================
 */
-// setting the language file
-$langFile[] = "announcements";
-$langFile[] = "group";
-$langFile[] = "survey";
+// name of the language file that needs to be included
+$language_file[] = "announcements";
+$language_file[] = "group";
+$language_file[] = "survey";
 
 // setting the global file that gets the general configuration, the databases, the languages, ...
 include('../inc/global.inc.php');

+ 3 - 3
main/auth/courses.php

@@ -1,4 +1,4 @@
-<?php // $Id: courses.php 10197 2006-11-26 18:45:33Z pcool $
+<?php // $Id: courses.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -34,8 +34,8 @@
 		INIT SECTION
 ==============================================================================
 */
-// including the relevant language file
-$langFile = 'courses';
+// name of the language file that needs to be included
+$language_file = 'courses';
 
 // including the global file
 include('../inc/global.inc.php');

+ 3 - 3
main/auth/inscription.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: inscription.php 10190 2006-11-24 00:23:20Z pcool $
+// $Id: inscription.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -29,8 +29,8 @@
 *	@package	 dokeos.auth
 ==============================================================================
 */
-
-$langFile = "registration";
+// name of the language file that needs to be included
+$language_file = "registration";
 
 include ("../inc/global.inc.php");
 

+ 3 - 3
main/auth/inscription_second.php

@@ -1,4 +1,4 @@
-<?php // $Id: inscription_second.php 10190 2006-11-24 00:23:20Z pcool $ 
+<?php // $Id: inscription_second.php 10204 2006-11-26 20:46:53Z pcool $ 
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -35,8 +35,8 @@
 /*==========================
              INIT
   ==========================*/
-
-$langFile = "registration";
+// name of the language file that needs to be included
+$language_file = "registration";
 require("../inc/global.inc.php");
 
 $TABLEUSER      = Database::get_main_table(TABLE_MAIN_USER);

+ 3 - 2
main/auth/lostPassword.php

@@ -1,6 +1,6 @@
 <?php
 
-// $Id: lostPassword.php 10190 2006-11-24 00:23:20Z pcool $ 
+// $Id: lostPassword.php 10204 2006-11-26 20:46:53Z pcool $ 
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -39,7 +39,8 @@
 *	@package dokeos.auth
 ============================================================================== 
 */
-$langFile = "registration";
+// name of the language file that needs to be included
+$language_file = "registration";
 require ('../inc/global.inc.php');
 require_once ('lost_password.lib.php');
 require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');

+ 2 - 1
main/auth/my_progress.php

@@ -1,5 +1,6 @@
 <?php
-$langFile = array('registration','tracking');
+// name of the language file that needs to be included
+$language_file = array('registration','tracking');
 
 $cidReset = true;
 

+ 3 - 2
main/auth/profile.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: profile.php 10190 2006-11-24 00:23:20Z pcool $
+// $Id: profile.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -39,7 +39,8 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = 'registration';
+// name of the language file that needs to be included
+$language_file = 'registration';
 $cidReset = true;
 
 require ('../inc/global.inc.php');

+ 2 - 1
main/blog/blog.php

@@ -35,7 +35,8 @@
 	INIT
 ==============================================================================
 */
-$langFile = "blog";
+// name of the language file that needs to be included
+$language_file = "blog";
 $blog_id = intval($_GET['blog_id']);
 
 include ('../inc/global.inc.php');

+ 122 - 122
main/blog/blog_admin.php

@@ -1,123 +1,123 @@
-<?php
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004 Dokeos S.A.
-	Copyright (c) 2003 University of Ghent (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
-
-============================================================================== 
-
-    BLOG HOMEPAGE
-
-	This file takes care of all blog navigation and displaying.
-
-	@package dokeos.blogs
-============================================================================== 
-*/
-
-// Init
-$langFile = "blog";
-
-include('../inc/global.inc.php');
-require_once(api_get_path(LIBRARY_PATH) . "blog.lib.php");
-
-$nameTools = get_lang("blog_management");
-
-
-// showing the header if we are not in the learning path, if we are in 
-// the learning path, we do not include the banner so we have to explicitly 
-// include the stylesheet, which is normally done in the header
-if ($_GET['origin'] != 'learnpath') 
-{ 	
-	Display::display_header($nameTools,'Blogs');
-}
-else 
-{
-	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$clarolineRepositoryWeb."css/default.css\"/>";
-}
-/*
-==============================================================================
-	PROCESSING..
-============================================================================== 
-*/
-if ($_POST['new_blog_submit'])
-{
-	Blog::create_blog(mysql_real_escape_string($_POST['blog_name']),mysql_real_escape_string($_POST['blog_subtitle']));
-}
-if ($_POST['edit_blog_submit'])
-{
-	Blog::edit_blog(mysql_real_escape_string($_POST['blog_id']),mysql_real_escape_string($_POST['blog_name']),mysql_real_escape_string($_POST['blog_subtitle']));
-}
-if ($_GET['action'] == 'visibility')
-{	
-	Blog::change_blog_visibility(mysql_real_escape_string($_GET['blog_id']));
-}
-if ($_GET['action'] == 'delete')
-{
-	Blog::delete_blog(mysql_real_escape_string($_GET['blog_id']));
-}
-
-
-/*
-==============================================================================
-	DISPLAY
-============================================================================== 
-*/
-api_display_tool_title($nameTools);
-//api_introductionsection(TOOL_BLOG);
-
-
-	if ($_GET['action'] == 'add')
-	{
-		Blog::display_new_blog_form();
-	}
-	if ($_GET['action'] == 'edit')
-	{
-		Blog::display_edit_blog_form(mysql_real_escape_string($_GET['blog_id']));
-	}
-
-	echo "<a href='".$_SERVER['PHP_SELF']."?action=add'>",
-	"<img src='../img/blog.gif' border=\"0\" align=\"absmiddle\" alt='scormbuilder'>&nbsp;&nbsp;".get_lang('AddBlog')."</a>";
-	echo "<table width=\"100%\" border=\"0\" cellspacing=\"2\" class='data_table'>";
-	echo	"<tr bgcolor=\"$color2\" align=\"center\" valign=\"top\">",
-				 "<td width='290'><b>",get_lang('Title'),"</b></td>\n",
-				 "<td><b>",get_lang('Subtitle'),"</b></td>\n",
-				 "<td width='200'><b>",get_lang('Modify'),"</b></td>\n",
-			"</tr>\n";
-	Blog::display_blog_list();
-	echo "</table>";
-
-
-// The footer is displayed only if we are not in the learnpath
-if ($_GET['origin'] != 'learnpath') 
-{ 
-	include($includePath."/claro_init_footer.inc.php");
-}
-
-
-
-
-
-/*
-==============================================================================
-	FUNCTIONS
-============================================================================== 
-*/
-
-
+<?php
+/*
+==============================================================================
+	Dokeos - elearning and course management software
+
+	Copyright (c) 2004 Dokeos S.A.
+	Copyright (c) 2003 University of Ghent (UGent)
+	Copyright (c) 2001 Universite catholique de Louvain (UCL)
+	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
+
+============================================================================== 
+
+    BLOG HOMEPAGE
+
+	This file takes care of all blog navigation and displaying.
+
+	@package dokeos.blogs
+============================================================================== 
+*/
+
+// name of the language file that needs to be included
+$language_file = "blog";
+
+include('../inc/global.inc.php');
+require_once(api_get_path(LIBRARY_PATH) . "blog.lib.php");
+
+$nameTools = get_lang("blog_management");
+
+
+// showing the header if we are not in the learning path, if we are in 
+// the learning path, we do not include the banner so we have to explicitly 
+// include the stylesheet, which is normally done in the header
+if ($_GET['origin'] != 'learnpath') 
+{ 	
+	Display::display_header($nameTools,'Blogs');
+}
+else 
+{
+	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$clarolineRepositoryWeb."css/default.css\"/>";
+}
+/*
+==============================================================================
+	PROCESSING..
+============================================================================== 
+*/
+if ($_POST['new_blog_submit'])
+{
+	Blog::create_blog(mysql_real_escape_string($_POST['blog_name']),mysql_real_escape_string($_POST['blog_subtitle']));
+}
+if ($_POST['edit_blog_submit'])
+{
+	Blog::edit_blog(mysql_real_escape_string($_POST['blog_id']),mysql_real_escape_string($_POST['blog_name']),mysql_real_escape_string($_POST['blog_subtitle']));
+}
+if ($_GET['action'] == 'visibility')
+{	
+	Blog::change_blog_visibility(mysql_real_escape_string($_GET['blog_id']));
+}
+if ($_GET['action'] == 'delete')
+{
+	Blog::delete_blog(mysql_real_escape_string($_GET['blog_id']));
+}
+
+
+/*
+==============================================================================
+	DISPLAY
+============================================================================== 
+*/
+api_display_tool_title($nameTools);
+//api_introductionsection(TOOL_BLOG);
+
+
+	if ($_GET['action'] == 'add')
+	{
+		Blog::display_new_blog_form();
+	}
+	if ($_GET['action'] == 'edit')
+	{
+		Blog::display_edit_blog_form(mysql_real_escape_string($_GET['blog_id']));
+	}
+
+	echo "<a href='".$_SERVER['PHP_SELF']."?action=add'>",
+	"<img src='../img/blog.gif' border=\"0\" align=\"absmiddle\" alt='scormbuilder'>&nbsp;&nbsp;".get_lang('AddBlog')."</a>";
+	echo "<table width=\"100%\" border=\"0\" cellspacing=\"2\" class='data_table'>";
+	echo	"<tr bgcolor=\"$color2\" align=\"center\" valign=\"top\">",
+				 "<td width='290'><b>",get_lang('Title'),"</b></td>\n",
+				 "<td><b>",get_lang('Subtitle'),"</b></td>\n",
+				 "<td width='200'><b>",get_lang('Modify'),"</b></td>\n",
+			"</tr>\n";
+	Blog::display_blog_list();
+	echo "</table>";
+
+
+// The footer is displayed only if we are not in the learnpath
+if ($_GET['origin'] != 'learnpath') 
+{ 
+	include($includePath."/claro_init_footer.inc.php");
+}
+
+
+
+
+
+/*
+==============================================================================
+	FUNCTIONS
+============================================================================== 
+*/
+
+
 ?>

+ 376 - 375
main/blog/blog_backup_may3_surbhi.php

@@ -1,376 +1,377 @@
-<?php
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004 Dokeos S.A.
-	Copyright (c) 2003 University of Ghent (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
-
-============================================================================== 
-
-    BLOG HOMEPAGE
-
-	This file takes care of all blog navigation and displaying.
-
-	@package dokeos.blogs
-============================================================================== 
-*/
-
-/*
-==============================================================================
-	INIT
-============================================================================== 
-*/
-$langFile = "blog";
-$blog_id = intval($_GET['blog_id']);
-include('../inc/claro_init_global.inc.php');
-require_once(api_get_library_path() . "/display.lib.php");
-require_once(api_get_library_path() . "/text.lib.php");
-require_once(api_get_library_path() . "/blog.lib.php");
-require_once(api_get_library_path() . "/fckeditor.lib.php");
-$nameTools = get_lang("blogs");
-$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
-$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
-$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
-
-$current_page = $_GET['action'];
-
-/*
-==============================================================================
-	PROCESSING
-============================================================================== 
-*/
-if ($_POST['new_post_submit'])
-{
-	Blog::create_post(mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']),$blog_id);
-}
-if ($_POST['edit_post_submit'])
-{
-	Blog::edit_post(mysql_real_escape_string($_POST['post_id']), mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']),$blog_id);
-}
-if ($_POST['new_comment_submit'])
-{
-	Blog::create_comment(mysql_real_escape_string($_POST['comment_title']),mysql_real_escape_string($_POST['comment_text']),$blog_id,mysql_real_escape_string($_GET['post_id']),mysql_real_escape_string($_POST['comment_parent_id']));
-}
-if ($_POST['new_task_submit'])
-{
-	Blog::create_task($blog_id,mysql_real_escape_string($_POST['task_name']),mysql_real_escape_string($_POST['task_description']),mysql_real_escape_string($_POST['task_color']));
-}
-if ($_POST['edit_task_submit'])
-{
-	Blog::edit_task(mysql_real_escape_string($_POST['task_id']),mysql_real_escape_string($_POST['task_name']),mysql_real_escape_string($_POST['task_description']),mysql_real_escape_string($_POST['task_color']));
-}
-if ($_POST['assign_task_submit'])
-{
-	Blog::assign_task($blog_id,mysql_real_escape_string($_POST['task_user_id']),mysql_real_escape_string($_POST['task_task_id']),mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']));
-}
-if ($_POST['new_task_execution_submit'])
-{
-	Blog::create_comment(mysql_real_escape_string($_POST['comment_title']),mysql_real_escape_string($_POST['comment_text']),$blog_id,mysql_real_escape_string($_GET['post_id']),mysql_real_escape_string($_POST['comment_parent_id']), mysql_real_escape_string($_POST['task_id']));
-}
-if ($_POST['register'])
-{
-	foreach($_POST['user'] as $index => $user_id)
-	{
-		Blog::set_user_subscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($user_id));
-	}
-}
-if ($_POST['unregister'])
-{
-	foreach($_POST['user'] as $index => $user_id)
-	{
-		Blog::set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($user_id));
-	}
-}
-if ($_GET['register'])
-{
-	Blog::set_user_subscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($_GET['user_id']));
-}
-if ($_GET['unregister'])
-{
-	Blog::set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($_GET['user_id']));
-}
-if ($_GET['action'] == 'manage_tasks')
-{
-	if ($_GET['do'] == 'delete')
-	{
-		Blog::delete_task($blog_id, mysql_real_escape_string($_GET['task_id']));
-	}
-	// assigned tasks
-	if ($_GET['do'] == 'delete_assignment')
-	{
-		Blog::delete_assigned_task($blog_id, mysql_real_escape_string($_GET['assignment_id']));
-	}
-	if ($_GET['do'] == 'edit_assignment')
-	{
-		Blog::display_edit_assigned_task_form($blog_id, mysql_real_escape_string($_GET['assignment_id']));
-	}
-}
-if ($_GET['action'] == 'view_post')
-{
-	if ($_GET['do'] == 'delete_comment')
-	{
-		if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_delete')) {
-			Blog::delete_comment($blog_id, mysql_real_escape_string($_GET['comment_id']));
-		}
-		else
-		{
-			$error = true;
-			$message = get_lang('ActionNotAllowed');
-		}
-	}
-	if ($_GET['do'] == 'delete_article')
-	{
-		if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_delete')) {
-			Blog::delete_post($blog_id, mysql_real_escape_string($_GET['article_id']));
-			$current_page = ''; // Article is gone, go to blog home
-		}
-		else
-		{
-			$error = true;
-			$message = get_lang('ActionNotAllowed');
-		}
-	}
-	if ($_GET['do'] == 'rate')
-	{
-		if ($_GET['type'] == 'post')
-		{
-			if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_rate')) {
-				Blog::add_rating('post',$blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_GET['rating']));
-			}
-		}
-		if ($_GET['type'] == 'comment')
-		{
-			if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_add')) {
-				Blog::add_rating('comment',$blog_id, mysql_real_escape_string($_GET['comment_id']), mysql_real_escape_string($_GET['rating']));
-			}
-		}
-	}
-}
-/*
-==============================================================================
-	DISPLAY
-============================================================================== 
-*/
-$htmlHeadXtra[] = "<script src=\"tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
-
-// Set bredcrumb
-switch ($current_page)
-{
-	case "new_post":
-		$nameTools = get_lang('NewPost');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	case "manage_tasks":
-		$nameTools = get_lang('TaskManager');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	case "manage_members":
-		$nameTools = get_lang('MemberManager');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	case "manage_rights":
-		$nameTools = get_lang('RightsManager');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	case "view_search_result":
-		$nameTools = get_lang('SearchResults');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	case "execute_task":
-		$nameTools = get_lang('ExecuteThisTask');
-		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
-		Display::display_header($nameTools,'blogs');
-		break;
-	default:
-		$nameTools = Blog::get_blog_title($blog_id);
-		Display::display_header($nameTools,'blogs');
-}
-
-//Display::display_header($nameTools,'Blogs');
-
-?>
-<span class="blog_title"><?php echo Blog::get_blog_title($blog_id) ?></span><br />
-<span class="blog_subtitle"><?php echo Blog::get_blog_subtitle($blog_id) ?></span>
-<br /><br />
-<table width="100%">
-<tr>
-	<td width="220" class="blog_left" valign="top">
-		<?php
-			$month = $_GET['month'] ? $_GET['month'] : (int)date('m');
-			$year = $_GET['year'] ? $_GET['year'] : date('Y');
-			Blog::display_minimonthcalendar($month, $year, $blog_id);
-		?>
-		<br />
-		<table width="100%">
-			<tr>
-				<td class="blog_menu_title"><?php echo get_lang('ThisBlog') ?></td>
-			</tr>
-			<tr>
-				<td class="blog_menu">
-					<ul>
-						<li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('Home') ?>"><?php echo get_lang('Home') ?></a></li>
-						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"><?php echo get_lang('NewPost') ?></a></li><?php } ?>
-						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"><?php echo get_lang('TaskManager') ?></a></li> <?php } ?>
-						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"><?php echo get_lang('MemberManager') ?></a></li><?php } ?>
-						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'role_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_rights&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageRights') ?>"><?php echo get_lang('RightsManager') ?></a></li><?php } ?>
-					</ul>
-				</td>
-			</tr>
-		</table>
-		<br />
-		<table width="100%">
-			<tr>
-				<td class="blog_menu_title"><?php echo get_lang('Search') ?></td>
-			</tr>
-			<tr>
-				<td class="blog_menu">
-					<form action="blog.php" method="get" enctype="multipart/form-data">
-						<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
-						<input type="hidden" name="action" value="view_search_result" />
-						<input type="text" size="20" name="q" value="<?php echo (isset($_GET['q']) ? $_GET['q'] : ''); ?>" /><input type="submit" value="Go" />
-					</form>
-				</td>
-			</tr>
-		</table>
-		<br />
-		<table width="100%">
-			<tr>
-				<td class="blog_menu_title"><?php echo get_lang('MyTasks') ?></td>
-			</tr>
-			<tr>
-				<td class="blog_menu">
-					<?php Blog::get_personal_task_list(); ?>
-				</td>
-			</tr>
-		</table>
-		<!--
-		<br />
-		<table width="100%">
-			<tr>
-				<td class="blog_menu_title"><?php echo get_lang('FavoriteBlogs') ?></td>
-			</tr>
-			<tr>
-				<td class="blog_menu">
-					<ul>
-						<li>Favorite 1</li>
-						<li>Favorite 2</li>
-						<li>Favorite 3</li>
-					</ul>
-				</td>
-			</tr>
-		</table>
-		<br />
-		<table width="100%">
-			<tr>
-				<td class="blog_menu_title"><?php echo get_lang('TopTen') ?></td>
-			</tr>
-			<tr>
-				<td class="blog_menu">
-					<ul>
-						<li>Blog 1</li>
-						<li>Blog 2</li>
-						<li>Blog 3</li>
-					</ul>
-				</td>
-			</tr>
-		</table>
-	-->
-	</td>
-	<td valign="top" class="blog_right">
-		<?php
-			if ($error)
-			{
-				Display::display_error_message($message);
-			}
-			switch ($current_page)
-			{
-				case 'new_post':
-					Blog::display_form_new_post($blog_id);
-					break;
-				case 'view_post':
-					Blog::display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
-					break;
-				case 'edit_post':
-					Blog::display_form_edit_post($blog_id, mysql_real_escape_string($_GET['post_id']));
-					break;
-				case 'manage_members':
-					Blog::display_form_user_subscribe($blog_id);
-					echo '<br /><br />';
-					Blog::display_form_user_unsubscribe($blog_id);
-					break;
-				case 'manage_rights':
-					Blog::display_form_user_rights($blog_id);
-					break;
-				case 'manage_tasks':
-					if ($_GET['do'] == 'add')
-					{
-						Blog::display_new_task_form($blog_id);
-					}
-					if ($_GET['do'] == 'assign')
-					{
-						Blog::display_assign_task_form($blog_id);
-					}
-					if ($_GET['do'] == 'edit')
-					{
-						Blog::display_edit_task_form($blog_id, mysql_real_escape_string($_GET['task_id']));
-					}
-					Blog::display_task_list($blog_id);
-					echo '<br /><br />';
-					Blog::display_assigned_task_list($blog_id);
-					break;
-				case 'execute_task':
-					if (isset($_GET['post_id']))
-					{
-						Blog::display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
-					}
-					else
-					{
-						Blog::display_select_task_post($blog_id, mysql_real_escape_string($_GET['task_id']));
-					}
-					break;
-				case 'view_search_result':
-					Blog::display_search_results($blog_id,mysql_real_escape_string($_GET['q']));
-					break;
-				case '':
-				default:
-					if(isset($_GET['filter']) && !empty($_GET['filter']))
-					{
-						Blog::display_day_results($blog_id, mysql_real_escape_string($_GET['filter']));
-					}
-					else
-					{
-						Blog::display_blog_posts($blog_id);
-					}
-			}
-		 ?>
-	</td>
-</tr>
-</table>
-
-<?php
-// The footer is displayed only if we are not in the learnpath
-if ($_GET['origin'] != 'learnpath') 
-{ 
-	include($includePath."/claro_init_footer.inc.php");
-}
+<?php
+/*
+==============================================================================
+	Dokeos - elearning and course management software
+
+	Copyright (c) 2004 Dokeos S.A.
+	Copyright (c) 2003 University of Ghent (UGent)
+	Copyright (c) 2001 Universite catholique de Louvain (UCL)
+	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
+
+============================================================================== 
+
+    BLOG HOMEPAGE
+
+	This file takes care of all blog navigation and displaying.
+
+	@package dokeos.blogs
+============================================================================== 
+*/
+
+/*
+==============================================================================
+	INIT
+============================================================================== 
+*/
+// name of the language file that needs to be included
+$language_file = "blog";
+$blog_id = intval($_GET['blog_id']);
+include('../inc/claro_init_global.inc.php');
+require_once(api_get_library_path() . "/display.lib.php");
+require_once(api_get_library_path() . "/text.lib.php");
+require_once(api_get_library_path() . "/blog.lib.php");
+require_once(api_get_library_path() . "/fckeditor.lib.php");
+$nameTools = get_lang("blogs");
+$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
+$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
+$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
+
+$current_page = $_GET['action'];
+
+/*
+==============================================================================
+	PROCESSING
+============================================================================== 
+*/
+if ($_POST['new_post_submit'])
+{
+	Blog::create_post(mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']),$blog_id);
+}
+if ($_POST['edit_post_submit'])
+{
+	Blog::edit_post(mysql_real_escape_string($_POST['post_id']), mysql_real_escape_string($_POST['post_title']), mysql_real_escape_string($_POST['post_full_text']),$blog_id);
+}
+if ($_POST['new_comment_submit'])
+{
+	Blog::create_comment(mysql_real_escape_string($_POST['comment_title']),mysql_real_escape_string($_POST['comment_text']),$blog_id,mysql_real_escape_string($_GET['post_id']),mysql_real_escape_string($_POST['comment_parent_id']));
+}
+if ($_POST['new_task_submit'])
+{
+	Blog::create_task($blog_id,mysql_real_escape_string($_POST['task_name']),mysql_real_escape_string($_POST['task_description']),mysql_real_escape_string($_POST['task_color']));
+}
+if ($_POST['edit_task_submit'])
+{
+	Blog::edit_task(mysql_real_escape_string($_POST['task_id']),mysql_real_escape_string($_POST['task_name']),mysql_real_escape_string($_POST['task_description']),mysql_real_escape_string($_POST['task_color']));
+}
+if ($_POST['assign_task_submit'])
+{
+	Blog::assign_task($blog_id,mysql_real_escape_string($_POST['task_user_id']),mysql_real_escape_string($_POST['task_task_id']),mysql_real_escape_string($_POST['task_year'])."-".mysql_real_escape_string($_POST['task_month'])."-".mysql_real_escape_string($_POST['task_day']));
+}
+if ($_POST['new_task_execution_submit'])
+{
+	Blog::create_comment(mysql_real_escape_string($_POST['comment_title']),mysql_real_escape_string($_POST['comment_text']),$blog_id,mysql_real_escape_string($_GET['post_id']),mysql_real_escape_string($_POST['comment_parent_id']), mysql_real_escape_string($_POST['task_id']));
+}
+if ($_POST['register'])
+{
+	foreach($_POST['user'] as $index => $user_id)
+	{
+		Blog::set_user_subscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($user_id));
+	}
+}
+if ($_POST['unregister'])
+{
+	foreach($_POST['user'] as $index => $user_id)
+	{
+		Blog::set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($user_id));
+	}
+}
+if ($_GET['register'])
+{
+	Blog::set_user_subscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($_GET['user_id']));
+}
+if ($_GET['unregister'])
+{
+	Blog::set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']),mysql_real_escape_string($_GET['user_id']));
+}
+if ($_GET['action'] == 'manage_tasks')
+{
+	if ($_GET['do'] == 'delete')
+	{
+		Blog::delete_task($blog_id, mysql_real_escape_string($_GET['task_id']));
+	}
+	// assigned tasks
+	if ($_GET['do'] == 'delete_assignment')
+	{
+		Blog::delete_assigned_task($blog_id, mysql_real_escape_string($_GET['assignment_id']));
+	}
+	if ($_GET['do'] == 'edit_assignment')
+	{
+		Blog::display_edit_assigned_task_form($blog_id, mysql_real_escape_string($_GET['assignment_id']));
+	}
+}
+if ($_GET['action'] == 'view_post')
+{
+	if ($_GET['do'] == 'delete_comment')
+	{
+		if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_delete')) {
+			Blog::delete_comment($blog_id, mysql_real_escape_string($_GET['comment_id']));
+		}
+		else
+		{
+			$error = true;
+			$message = get_lang('ActionNotAllowed');
+		}
+	}
+	if ($_GET['do'] == 'delete_article')
+	{
+		if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_delete')) {
+			Blog::delete_post($blog_id, mysql_real_escape_string($_GET['article_id']));
+			$current_page = ''; // Article is gone, go to blog home
+		}
+		else
+		{
+			$error = true;
+			$message = get_lang('ActionNotAllowed');
+		}
+	}
+	if ($_GET['do'] == 'rate')
+	{
+		if ($_GET['type'] == 'post')
+		{
+			if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_rate')) {
+				Blog::add_rating('post',$blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_GET['rating']));
+			}
+		}
+		if ($_GET['type'] == 'comment')
+		{
+			if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_add')) {
+				Blog::add_rating('comment',$blog_id, mysql_real_escape_string($_GET['comment_id']), mysql_real_escape_string($_GET['rating']));
+			}
+		}
+	}
+}
+/*
+==============================================================================
+	DISPLAY
+============================================================================== 
+*/
+$htmlHeadXtra[] = "<script src=\"tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
+
+// Set bredcrumb
+switch ($current_page)
+{
+	case "new_post":
+		$nameTools = get_lang('NewPost');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	case "manage_tasks":
+		$nameTools = get_lang('TaskManager');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	case "manage_members":
+		$nameTools = get_lang('MemberManager');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	case "manage_rights":
+		$nameTools = get_lang('RightsManager');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	case "view_search_result":
+		$nameTools = get_lang('SearchResults');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	case "execute_task":
+		$nameTools = get_lang('ExecuteThisTask');
+		$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog::get_blog_title($blog_id));
+		Display::display_header($nameTools,'blogs');
+		break;
+	default:
+		$nameTools = Blog::get_blog_title($blog_id);
+		Display::display_header($nameTools,'blogs');
+}
+
+//Display::display_header($nameTools,'Blogs');
+
+?>
+<span class="blog_title"><?php echo Blog::get_blog_title($blog_id) ?></span><br />
+<span class="blog_subtitle"><?php echo Blog::get_blog_subtitle($blog_id) ?></span>
+<br /><br />
+<table width="100%">
+<tr>
+	<td width="220" class="blog_left" valign="top">
+		<?php
+			$month = $_GET['month'] ? $_GET['month'] : (int)date('m');
+			$year = $_GET['year'] ? $_GET['year'] : date('Y');
+			Blog::display_minimonthcalendar($month, $year, $blog_id);
+		?>
+		<br />
+		<table width="100%">
+			<tr>
+				<td class="blog_menu_title"><?php echo get_lang('ThisBlog') ?></td>
+			</tr>
+			<tr>
+				<td class="blog_menu">
+					<ul>
+						<li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('Home') ?>"><?php echo get_lang('Home') ?></a></li>
+						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_add')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"><?php echo get_lang('NewPost') ?></a></li><?php } ?>
+						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'task_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"><?php echo get_lang('TaskManager') ?></a></li> <?php } ?>
+						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'member_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"><?php echo get_lang('MemberManager') ?></a></li><?php } ?>
+						<?php if(api_is_allowed_to_edit('BLOG_'.$blog_id, 'role_management')) { ?><li><a href="<?php echo $_SERVER['PHP_SELF'] ?>?action=manage_rights&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageRights') ?>"><?php echo get_lang('RightsManager') ?></a></li><?php } ?>
+					</ul>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<table width="100%">
+			<tr>
+				<td class="blog_menu_title"><?php echo get_lang('Search') ?></td>
+			</tr>
+			<tr>
+				<td class="blog_menu">
+					<form action="blog.php" method="get" enctype="multipart/form-data">
+						<input type="hidden" name="blog_id" value="<?php echo $blog_id ?>" />
+						<input type="hidden" name="action" value="view_search_result" />
+						<input type="text" size="20" name="q" value="<?php echo (isset($_GET['q']) ? $_GET['q'] : ''); ?>" /><input type="submit" value="Go" />
+					</form>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<table width="100%">
+			<tr>
+				<td class="blog_menu_title"><?php echo get_lang('MyTasks') ?></td>
+			</tr>
+			<tr>
+				<td class="blog_menu">
+					<?php Blog::get_personal_task_list(); ?>
+				</td>
+			</tr>
+		</table>
+		<!--
+		<br />
+		<table width="100%">
+			<tr>
+				<td class="blog_menu_title"><?php echo get_lang('FavoriteBlogs') ?></td>
+			</tr>
+			<tr>
+				<td class="blog_menu">
+					<ul>
+						<li>Favorite 1</li>
+						<li>Favorite 2</li>
+						<li>Favorite 3</li>
+					</ul>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<table width="100%">
+			<tr>
+				<td class="blog_menu_title"><?php echo get_lang('TopTen') ?></td>
+			</tr>
+			<tr>
+				<td class="blog_menu">
+					<ul>
+						<li>Blog 1</li>
+						<li>Blog 2</li>
+						<li>Blog 3</li>
+					</ul>
+				</td>
+			</tr>
+		</table>
+	-->
+	</td>
+	<td valign="top" class="blog_right">
+		<?php
+			if ($error)
+			{
+				Display::display_error_message($message);
+			}
+			switch ($current_page)
+			{
+				case 'new_post':
+					Blog::display_form_new_post($blog_id);
+					break;
+				case 'view_post':
+					Blog::display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
+					break;
+				case 'edit_post':
+					Blog::display_form_edit_post($blog_id, mysql_real_escape_string($_GET['post_id']));
+					break;
+				case 'manage_members':
+					Blog::display_form_user_subscribe($blog_id);
+					echo '<br /><br />';
+					Blog::display_form_user_unsubscribe($blog_id);
+					break;
+				case 'manage_rights':
+					Blog::display_form_user_rights($blog_id);
+					break;
+				case 'manage_tasks':
+					if ($_GET['do'] == 'add')
+					{
+						Blog::display_new_task_form($blog_id);
+					}
+					if ($_GET['do'] == 'assign')
+					{
+						Blog::display_assign_task_form($blog_id);
+					}
+					if ($_GET['do'] == 'edit')
+					{
+						Blog::display_edit_task_form($blog_id, mysql_real_escape_string($_GET['task_id']));
+					}
+					Blog::display_task_list($blog_id);
+					echo '<br /><br />';
+					Blog::display_assigned_task_list($blog_id);
+					break;
+				case 'execute_task':
+					if (isset($_GET['post_id']))
+					{
+						Blog::display_post($blog_id, mysql_real_escape_string($_GET['post_id']));
+					}
+					else
+					{
+						Blog::display_select_task_post($blog_id, mysql_real_escape_string($_GET['task_id']));
+					}
+					break;
+				case 'view_search_result':
+					Blog::display_search_results($blog_id,mysql_real_escape_string($_GET['q']));
+					break;
+				case '':
+				default:
+					if(isset($_GET['filter']) && !empty($_GET['filter']))
+					{
+						Blog::display_day_results($blog_id, mysql_real_escape_string($_GET['filter']));
+					}
+					else
+					{
+						Blog::display_blog_posts($blog_id);
+					}
+			}
+		 ?>
+	</td>
+</tr>
+</table>
+
+<?php
+// The footer is displayed only if we are not in the learnpath
+if ($_GET['origin'] != 'learnpath') 
+{ 
+	include($includePath."/claro_init_footer.inc.php");
+}
 ?>

+ 5 - 4
main/blog/calendar.php

@@ -1,7 +1,8 @@
 <?php
-// including the relevant language file
-$langFile = "agenda";
-// including the claroline global 
+// name of the language file that needs to be included
+$language_file = 'agenda'; 
+
+// including the global 
 include('../inc/claro_init_global.inc.php');
 
 // the variables for the days and the months
@@ -123,7 +124,7 @@ foreach($DaysShort as $index => $day)
 //-->
 </script>
 </head>
-<body onload="initCalendar();">
+<body onLoad="initCalendar();">
 <div id="calendar_data"></div>
 <div id="clock_data"></div>
 </body>

+ 3 - 3
main/calendar/agenda.php

@@ -1,4 +1,4 @@
-<?php //$Id: agenda.php 10197 2006-11-26 18:45:33Z pcool $
+<?php //$Id: agenda.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -26,8 +26,8 @@
 	   INIT SECTION
 ============================================================================== 
 */
-// setting the language file
-$langFile = 'agenda';
+// name of the language file that needs to be included
+$language_file = 'agenda';
 
 // setting the global file that gets the general configuration, the databases, the languages, ...
 include('../inc/global.inc.php');

+ 3 - 3
main/calendar/calendar.php

@@ -1,6 +1,6 @@
 <?php
-// including the relevant language file
-$langFile = "agenda";
+// name of the language file that needs to be included
+$language_file = 'agenda';
 // including the claroline global 
 include('../inc/global.inc.php');
 
@@ -126,7 +126,7 @@ foreach($DaysShort as $index => $day)
 //-->
 </script>
 </head>
-<body onload="initCalendar();">
+<body onLoad="initCalendar();">
 <div id="calendar_data"></div>
 <div id="clock_data"></div>
 </body>

+ 2 - 2
main/calendar/myagenda.php

@@ -60,8 +60,8 @@
 ============================================================================== */
 
 
-// loading the language file
-$langFile = 'agenda';
+// name of the language file that needs to be included
+$language_file = 'agenda';
 // we are not inside a course, so we reset the course id
 $cidReset = true;
 // setting the global file that gets the general configuration, the databases, the languages, ...

+ 2 - 3
main/calendar/print.php

@@ -1,7 +1,6 @@
 <?php
-// setting the language file
-$langFile = "agenda";
-
+// name of the language file that needs to be included
+$language_file = 'agenda';
 $id=$_GET['id'];
 
 if(strstr($id,','))

+ 3 - 2
main/chat/chat.php

@@ -1,4 +1,4 @@
-<?php // $Id: chat.php 10141 2006-11-23 05:12:52Z gmludo $
+<?php // $Id: chat.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -37,7 +37,8 @@
 	Init section
 -----------------------------------------------------------
 */
-$langFile='chat';
+// name of the language file that needs to be included
+$language_file='chat';
 include('../inc/global.inc.php');
 
 $this_section=SECTION_COURSES;

+ 3 - 50
main/conf/index.php

@@ -1,50 +1,3 @@
-<?php
-/*
- * Created on 25 oct. 06
- *
- * To change the template for this generated file go to
- * Window - Preferences - PHPeclipse - PHP - Code Templates
- */
- 
- $langFile = "document";
- include("../inc/global.inc.php");
- api_protect_course_script();
-
- $_SESSION['document_url'] = api_get_path(WEB_COURSE_PATH).'document';
-
- header('Location: liveconf.php');
- /*
- $langFile='admin';
-
-include('../inc/global.inc.php');
-
-$nameTool = get_lang('Visioconf');
-Display::display_header($nameTool);
-?>
-<div id="main_visio" align="center">
-	<div id="extension_content_visio" style="display:block" class="accordion_content">		
-		<?php echo get_lang('VisioconfDescription') ?><br /><br />
-		<table width="100%">
-			<tr>
-				<td>
-					<img src="<?php echo api_get_path(WEB_IMG_PATH).'screenshot_conf.jpg' ?>" />
-				</td>
-				<td align="center" width="50%" style="color: red">
-					<?php echo get_lang('ExtensionActivedButNotYetOperational') ?>
-				</td>
-			</tr>
-		</table>
-	</div>
-</div>
-
-<?php
-
-/*
-==============================================================================
-		FOOTER
-==============================================================================
-*/
-/*
-Display::display_footer();
-*/
-?>
+<?php
+header('Location: liveconf.php');
+?>

+ 3 - 3
main/course_description/index.php

@@ -1,4 +1,4 @@
-<?php // $Id: index.php 10195 2006-11-25 15:26:00Z pcool $
+<?php // $Id: index.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -40,8 +40,8 @@
 		INIT SECTION
 ==============================================================================
 */
-
-$langFile = array ('course_description', 'pedaSuggest');
+// name of the language file that needs to be included
+$language_file = array ('course_description', 'pedaSuggest');
 
 include ('../inc/global.inc.php');
 $this_section = SECTION_COURSES;

+ 3 - 3
main/course_home/course_home.php

@@ -1,4 +1,4 @@
-<?php // $Id: course_home.php 10195 2006-11-25 15:26:00Z pcool $
+<?php // $Id: course_home.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -71,8 +71,8 @@ if(!isset($cidReq))
 // is this needed?????
 $section = "course";
 
-// The langauge file
-$langFile = "course_home";
+// name of the language file that needs to be included
+$language_file = "course_home";
 
 // inlcuding the global file
 include('../../main/inc/global.inc.php');

+ 3 - 3
main/course_info/delete_course.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: delete_course.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: delete_course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -33,8 +33,8 @@
 *	@package dokeos.course_info
 ==============================================================================
 */
-
-$langFile = 'course_info';
+// name of the language file that needs to be included
+$language_file = 'course_info';
 
 include ('../inc/global.inc.php');
 include (api_get_path(LIBRARY_PATH).'course.lib.php');

+ 3 - 2
main/course_info/infocours.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: infocours.php 10197 2006-11-26 18:45:33Z pcool $
+// $Id: infocours.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -44,7 +44,8 @@
 	   INIT SECTION
 ==============================================================================
 */
-$langFile = array ('create_course', 'course_info');
+// name of the language file that needs to be included
+$language_file = array ('create_course', 'course_info');
 include ('../inc/global.inc.php');
 $this_section = SECTION_COURSES;
 

+ 2 - 1
main/course_info/maintenance.php

@@ -4,7 +4,8 @@
 /*
  * Created on 18 October 2006 by Elixir Interactive http://www.elixir-interactive.com
  */
-$langFile = array ('admin','create_course', 'course_info', 'coursebackup');
+// name of the language file that needs to be included 
+$language_file = array ('admin','create_course', 'course_info', 'coursebackup');
 
 require ('../inc/global.inc.php');
 

+ 3 - 2
main/course_info/postpone.php

@@ -1,4 +1,4 @@
-<?php  // $Id: postpone.php 10190 2006-11-24 00:23:20Z pcool $
+<?php  // $Id: postpone.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -47,7 +47,8 @@
 ==============================================================================
 */ 
 
-$langFile = "postpone";
+// name of the language file that needs to be included 
+$language_file = "postpone";
 //$interbreadcrumb[]= array ("url"=>"index.php", "name"=> get_lang('Admin'));
 $htmlHeadXtra[] = "
 <style type=\"text/css\">

+ 3 - 2
main/coursecopy/backup.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: backup.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: backup.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -36,7 +36,8 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'coursebackup';
+// name of the language file that needs to be included 
+$language_file = 'coursebackup';
 include ('../inc/global.inc.php');
 $nameTools = get_lang('Backup');
 Display::display_header($nameTools);

+ 3 - 2
main/coursecopy/copy_course.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: copy_course.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: copy_course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -36,7 +36,8 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'coursebackup';
+// name of the language file that needs to be included 
+$language_file = 'coursebackup';
 include ('../inc/global.inc.php');
 include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
 require_once ('classes/CourseBuilder.class.php');

+ 3 - 2
main/coursecopy/create_backup.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: create_backup.php 9246 2006-09-25 13:24:53Z bmol $
+// $Id: create_backup.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -36,7 +36,8 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'coursebackup';
+// name of the language file that needs to be included 
+$language_file = 'coursebackup';
 include ('../inc/global.inc.php');
 include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
 $nameTools = get_lang('CreateBackup');

+ 3 - 2
main/coursecopy/import_backup.php

@@ -1,4 +1,4 @@
-<?php // $Id: import_backup.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: import_backup.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -35,7 +35,8 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'coursebackup';
+// name of the language file that needs to be included 
+$language_file = 'coursebackup';
 include ('../inc/global.inc.php');
 include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
 $nameTools = get_lang('ImportBackup');

+ 3 - 2
main/coursecopy/recycle_course.php

@@ -1,4 +1,4 @@
-<?php // $Id: recycle_course.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: recycle_course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -35,7 +35,8 @@
 		INIT SECTION
 ==============================================================================
 */ 
-$langFile = 'coursebackup';
+// name of the language file that needs to be included 
+$language_file = 'coursebackup';
 include ('../inc/global.inc.php');
 $nameTools = get_lang('RecycleCourse');
 Display::display_header($nameTools);

+ 3 - 2
main/create_course/add_course.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: add_course.php 10191 2006-11-24 08:09:14Z pcool $
+// $Id: add_course.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -36,7 +36,8 @@
 		INIT SECTION
 ==============================================================================
 */
-$langFile = "create_course";
+// name of the language file that needs to be included 
+$language_file = "create_course";
 include ('../inc/global.inc.php');
 $this_section=SECTION_COURSES;
 

+ 4 - 2
main/document/create_document.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: create_document.php 10195 2006-11-25 15:26:00Z pcool $
+// $Id: create_document.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -38,7 +38,9 @@
 ==============================================================================
 */
 
-$langFile = "document";
+// name of the language file that needs to be included 
+$language_file = 'document';
+
 
 include ('../inc/global.inc.php');
 $this_section = SECTION_COURSES;

+ 4 - 2
main/document/document.php

@@ -1,4 +1,4 @@
-<?php // $Id: document.php 10195 2006-11-25 15:26:00Z pcool $
+<?php // $Id: document.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -62,7 +62,9 @@
 ==============================================================================
 */
 
-$langFile = "document";
+// name of the language file that needs to be included 
+$language_file = 'document';
+
 include("../inc/global.inc.php");
 $this_section=SECTION_COURSES;
 

+ 7 - 3
main/document/edit_document.php

@@ -1,4 +1,4 @@
-<?php // $Id: edit_document.php 10195 2006-11-25 15:26:00Z pcool $
+<?php // $Id: edit_document.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -56,7 +56,9 @@
 ==============================================================================
 */
 
-$langFile = "document";
+// name of the language file that needs to be included 
+$language_file = 'document';
+
 
 /*
 ------------------------------------------------------------------------------
@@ -91,7 +93,9 @@ $baseServUrl = $_configuration['url_append']."/";
 $courseDir   = $_course['path']."/document";
 $baseWorkDir = $baseServDir.$courseDir;
 $group_document = false;
-$langFile = "document";
+// name of the language file that needs to be included 
+$language_file = 'document';
+
 $use_document_title = (get_setting('use_document_title')=='true')?true:false;
 $noPHP_SELF=true;
 

+ 3 - 1
main/document/headerpage.php

@@ -4,7 +4,9 @@
 *	@package dokeos.document
 ==============================================================================
 */
-	$langFile = "document";
+	// name of the language file that needs to be included 
+$language_file = 'document';
+
 
 	include('../inc/global.inc.php');
 

+ 4 - 4
main/document/quota.php

@@ -1,4 +1,4 @@
-<?php // $Id: quota.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: quota.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -36,9 +36,9 @@
 ==============================================================================
 */ 
 
-// name of the language file which needs to be included 
-// 'inc.php' is automatically appended to the file name 
-$langFile = "document"; 
+// name of the language file that needs to be included
+$language_file = 'document';
+ 
 
 // global settings initialisation 
 // also provides access to main api (inc/lib/main_api.lib.php)

+ 3 - 2
main/document/slideshow.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: slideshow.php 10195 2006-11-25 15:26:00Z pcool $
+// $Id: slideshow.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -56,7 +56,8 @@ Description:
 */
 // including the language file
 
-$langFile = "slideshow";
+// name of the language file that needs to be included 
+$language_file = "slideshow";
 
 include ('../inc/global.inc.php');
 

+ 3 - 2
main/document/slideshowoptions.php

@@ -1,4 +1,4 @@
-<?php // $Id: slideshowoptions.php 9972 2006-11-14 14:44:37Z pcool $ 
+<?php // $Id: slideshowoptions.php 10204 2006-11-26 20:46:53Z pcool $ 
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -59,7 +59,8 @@ Description:
 
 */
 // including the language file
-$langFile = "slideshow";
+// name of the language file that needs to be included 
+$language_file = "slideshow";
 
 include('../inc/global.inc.php');
 

+ 4 - 4
main/document/upload.php

@@ -1,4 +1,4 @@
-<?php // $Id: upload.php 10195 2006-11-25 15:26:00Z pcool $
+<?php // $Id: upload.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -61,9 +61,9 @@
 ==============================================================================
 */
 
-// name of the language file which needs to be included
-// 'inc.php' is automatically appended to the file name
-$langFile = "document";
+// name of the language file that needs to be included
+$language_file = 'document';
+
 
 // global settings initialisation
 // also provides access to main api (inc/lib/main_api.lib.php)

+ 2 - 1
main/dropbox/dropbox_download.php

@@ -28,7 +28,8 @@
 */
 // we cannot use dropbox_init.inc.php because this one already outputs data.
 //name of langfile
-$langFile = "dropbox";
+// name of the language file that needs to be included 
+$language_file = "dropbox";
 
 // including the basic Dokeos initialisation file
 require("../inc/global.inc.php");

+ 2 - 1
main/dropbox/dropbox_init.inc.php

@@ -52,7 +52,8 @@
 ==============================================================================
 */ 
 //name of langfile
-$langFile = "dropbox";	
+// 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
 //$noPHP_SELF = TRUE;	

+ 2 - 1
main/exercice/addlimits.php

@@ -35,7 +35,8 @@ define('FREE_ANSWER', 5);
 	Language
 -----------------------------------------------------------
 */
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 /*
 -----------------------------------------------------------

+ 3 - 2
main/exercice/admin.php

@@ -1,4 +1,4 @@
-<?php // $Id: admin.php 9972 2006-11-14 14:44:37Z pcool $
+<?php // $Id: admin.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -76,7 +76,8 @@ include('answer.class.php');
 
 
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include("../inc/global.inc.php");
 include('exercise.lib.php');

+ 3 - 2
main/exercice/adminhp.php

@@ -1,4 +1,4 @@
-<?php // $Id: adminhp.php 10197 2006-11-26 18:45:33Z pcool $
+<?php // $Id: adminhp.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -34,7 +34,8 @@ include('answer.class.php');
 
 include('exercise.lib.php');
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include('../inc/global.inc.php');
 $this_section=SECTION_COURSES;

+ 2 - 1
main/exercice/exercice.php

@@ -35,7 +35,8 @@
 ============================================================================== 
 */
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 require_once('../inc/global.inc.php');
 $this_section=SECTION_COURSES;

+ 3 - 2
main/exercice/exercice_submit.php

@@ -1,4 +1,4 @@
-<?php // $Id: exercice_submit.php 10110 2006-11-22 15:20:46Z develop-it $
+<?php // $Id: exercice_submit.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -62,7 +62,8 @@ define('FREE_ANSWER', 5);
 define('HOT_SPOT', 			6);
 define('HOT_SPOT_ORDER', 	7);
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include_once('../inc/global.inc.php');
 $this_section=SECTION_COURSES;

+ 3 - 2
main/exercice/exercise_result.php

@@ -1,4 +1,4 @@
-<?php // $Id: exercise_result.php 10197 2006-11-26 18:45:33Z pcool $
+<?php // $Id: exercise_result.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ============================================================================== 
 	Dokeos - elearning and course management software
@@ -56,7 +56,8 @@ define('MATCHING',		4);
 define('FREE_ANSWER', 5);
 define('HOT_SPOT', 6);
 global $_cid;
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include('../inc/global.inc.php');
 $this_section=SECTION_COURSES;

+ 2 - 1
main/exercice/exercise_show.php

@@ -16,7 +16,8 @@ define('MATCHING',		4);
 define('FREE_ANSWER', 5);
 define('HOTSPOT', 6);
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include('../inc/global.inc.php');
 

+ 2 - 1
main/exercice/feedback.php

@@ -5,7 +5,8 @@ include('answer.class.php');
 
 include('exercise.lib.php');
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include("../inc/global.inc.php");
 $this_section=SECTION_COURSES;

+ 2 - 1
main/exercice/hotpotatoes.php

@@ -34,7 +34,8 @@ $finish 		= (!empty($_POST['finish'])?$_POST['finish']:0);
 $imgcount		= (!empty($_POST['imgcount'])?$_POST['imgcount']:null);
 $fld					= (!empty($_POST['fld'])?$_POST['fld']:null);
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file ='exercice';
 include('../inc/global.inc.php');
 $this_section=SECTION_COURSES;
 

+ 214 - 213
main/exercice/mark_free_answer.php

@@ -1,213 +1,214 @@
-<?php // $Id: mark_free_answer.php,v 1.1.2.1 2005/08/30 01:47:37 yannoo Exp $
-/*
-============================================================================== 
-	Dokeos - elearning and course management software
-	
-	Copyright (c) 2004 Dokeos S.A.
-	Copyright (c) 2005 Yannick Warnier <yannick.warnier@dokeos.com>
-	
-	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
-============================================================================== 
-*/
-/**
-============================================================================== 
-*	FREE ANSWER MARKING SCRIPT  
-*
-*	This script allows a course tutor to mark a student's free answer.
-*@author Yannick Warnier <yannick.warnier@dokeos.com>
-*	@package dokeos.exercise
-============================================================================== 
-*/
-
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
-
-include('exercise.class.php');
-include('question.class.php');
-include('answer.class.php');
-
-// answer types
-define('UNIQUE_ANSWER',	1);
-define('MULTIPLE_ANSWER',	2);
-define('FILL_IN_BLANKS',	3);
-define('MATCHING',		4);
-define('FREE_ANSWER', 5);
-
-$langFile='exercice';
-
-include('../inc/global.inc.php');
-
-include(api_get_library_path().'/text.lib.php');
-
-$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
-$TBL_EXERCICES         = $_course['dbNameGlu'].'quiz';
-$TBL_QUESTIONS         = $_course['dbNameGlu'].'quiz_question';
-$TBL_REPONSES          = $_course['dbNameGlu'].'quiz_answer';
-
-//debug param. 0: no display - 1: debug display
-$debug=0;
-if($debug>0){echo str_repeat('&nbsp;',0).'Entered exercise_result.php'."<br />\n";var_dump($_POST);}
-
-// general parameters passed via POST/GET
-$my_course_code = mysql_real_escape_string($_GET['cid']);
-if(!empty($_REQUEST['exe'])){
-	$my_exe = $_REQUEST['exe'];
-}else{
-	$my_exe = null;
-}
-if(!empty($_REQUEST['qst'])){
-	$my_qst = $_REQUEST['qst'];
-}else{
-	$my_qst = null;
-}
-if(!empty($_REQUEST['usr'])){
-	$my_usr = $_REQUEST['usr'];
-}else{
-	$my_usr = null;
-}
-if(!empty($_REQUEST['cidReq'])){
-	$my_cid = $_REQUEST['cidReq'];
-}else{
-	$my_cid = null;
-}
-if(!empty($_POST['action'])){
-	$action = $_POST['action'];
-}else{
-	$action = '';
-}
-
-if (empty($my_qst) or empty($my_usr) or empty($my_cid) or empty($my_exe)){
-	header('Location: exercice.php');
-	exit();
-}
-
-if(!$is_courseTutor)
-{
-	api_not_allowed();
-}
-
-$obj_question=new Question();
-$obj_question->read($my_qst);
-
-$nameTools=get_lang('Exercice');
-
-$interbreadcrump[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
-
-$my_msg = 'No change.';
-
-if($action == 'mark'){
-	if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0){
-		
-		//mark the user mark into the database using something similar to the following function:
-		global $_configuration;
-		
-		if($_configuration['tracking_enabled'])
-		{
-			$exercise_table = Database::get_statistic_table('track_e_exercices');
-			#$tbl_learnpath_user = Database::get_course_table('learnpath_user');
-			#global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id;
-			$sql = "SELECT * FROM $exercise_table 
-				WHERE exe_user_id = '$my_usr' AND exe_cours_id = '$my_cid' AND exe_exo_id = '$my_exe' 
-				ORDER BY exe_date DESC";
-			#echo $sql;
-			$res = api_sql_query($sql,__FILE__,__LINE__);
-			if(mysql_num_rows($res)>0){
-				$row = mysql_fetch_array($res);
-				//@todo Check that just summing past score and the new free answer mark doesn't come up
-				// with a score higher than the possible score for that exercise
-				$my_score = $row['exe_result'] + $_POST['score'];
-				$sql = "UPDATE $exercise_table SET exe_result = '$my_score' 
-					WHERE exe_id = '".$row['exe_id']."'";
-				#echo $sql;
-				$res = api_sql_query($sql,__FILE__,__LINE__);
-				$my_msg = get_lang('MarkIsUpdated');
-			}else{
-				$my_score = $_POST['score'];
-				$reallyNow = time();
-				$sql = "INSERT INTO $exercise_table
-						  (
-						   `exe_user_id`,
-						   `exe_cours_id`,
-						   `exe_exo_id`,
-						   `exe_result`,
-						   `exe_weighting`,
-						   `exe_date`
-						  )
-				
-						  VALUES
-						  (
-						  ".$my_usr.",
-						   '".$my_cid."',
-						   '".$my_exe."',
-						   '".$my_score."',
-						   '".$obj_question->selectWeighting()."',
-						   FROM_UNIXTIME(".$reallyNow.")
-						  )";
-				#if ($origin == 'learnpath')
-				#{
-				#	if ($user_id == "NULL")
-				#	{
-				#		$user_id = '0';
-				#	}
-				#	$sql2 = "update `$tbl_learnpath_user` set score='$score' where (user_id=$user_id and learnpath_id='$learnpath_id' and learnpath_item_id='$learnpath_item_id')";
-				#	$res2 = api_sql_query($sql2,__FILE__,__LINE__);
-				#}
-				$res = api_sql_query($sql,__FILE__,__LINE__);
-				$my_msg = get_lang('MarkInserted');
-			}
-			//$mysql_query($sql);
-			//return 0;
-		}
-	}else{
-		$my_msg .= " There might have been a problem with the total score being too big...<br />\n";
-	}
-}
-
-Display::display_header($nameTools,"Exercise");
-
-// Display simple marking interface
-
-// 1a - result of previous marking then exit suggestion
-// 1b - user answer and marking box + submit button
-$objAnswerTmp = new Answer();
-$objAnswerTmp->selectAnswer($answerId);
-
-if($action == 'mark'){
-	echo $my_msg.'<br />
-		<a href="exercice.php?cidReq='.$cidReq.'">'.get_lang('Back').'</a>';
-}else{
-	
-
-	echo '<h2>'.$obj_question->question .':</h2>
-		'.$obj_question->selectTitle().'<br /><br />
-		'.get_lang('PleaseGiveAMark').
-		"<form action='' method='POST'>\n"
-		."<input type='hidden' name='exe' value='$my_exe'>\n"
-		."<input type='hidden' name='usr' value='$my_usr'>\n"
-		."<input type='hidden' name='cidReq' value='$my_cid'>\n"
-		."<input type='hidden' name='action' value='mark'>\n"
-		."<select name='score'>\n";
-		for($i=0 ; $i<$obj_question->selectWeighting() ; $i++){
-			echo '<option>'.$i.'</option>';
-		}
-		echo "</select>".
-		"<input type='submit' name='submit' value='".get_lang('Ok')."'>\n"
-		."</form>";
-}
-
-Display::display_footer();
-
-?>
+<?php // $Id: mark_free_answer.php,v 1.1.2.1 2005/08/30 01:47:37 yannoo Exp $
+/*
+============================================================================== 
+	Dokeos - elearning and course management software
+	
+	Copyright (c) 2004 Dokeos S.A.
+	Copyright (c) 2005 Yannick Warnier <yannick.warnier@dokeos.com>
+	
+	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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
+============================================================================== 
+*/
+/**
+============================================================================== 
+*	FREE ANSWER MARKING SCRIPT  
+*
+*	This script allows a course tutor to mark a student's free answer.
+*@author Yannick Warnier <yannick.warnier@dokeos.com>
+*	@package dokeos.exercise
+============================================================================== 
+*/
+
+/*
+==============================================================================
+		INIT SECTION
+==============================================================================
+*/
+
+include('exercise.class.php');
+include('question.class.php');
+include('answer.class.php');
+
+// answer types
+define('UNIQUE_ANSWER',	1);
+define('MULTIPLE_ANSWER',	2);
+define('FILL_IN_BLANKS',	3);
+define('MATCHING',		4);
+define('FREE_ANSWER', 5);
+
+// name of the language file that needs to be included 
+$language_file='exercice';
+
+include('../inc/global.inc.php');
+
+include(api_get_library_path().'/text.lib.php');
+
+$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
+$TBL_EXERCICES         = $_course['dbNameGlu'].'quiz';
+$TBL_QUESTIONS         = $_course['dbNameGlu'].'quiz_question';
+$TBL_REPONSES          = $_course['dbNameGlu'].'quiz_answer';
+
+//debug param. 0: no display - 1: debug display
+$debug=0;
+if($debug>0){echo str_repeat('&nbsp;',0).'Entered exercise_result.php'."<br />\n";var_dump($_POST);}
+
+// general parameters passed via POST/GET
+$my_course_code = mysql_real_escape_string($_GET['cid']);
+if(!empty($_REQUEST['exe'])){
+	$my_exe = $_REQUEST['exe'];
+}else{
+	$my_exe = null;
+}
+if(!empty($_REQUEST['qst'])){
+	$my_qst = $_REQUEST['qst'];
+}else{
+	$my_qst = null;
+}
+if(!empty($_REQUEST['usr'])){
+	$my_usr = $_REQUEST['usr'];
+}else{
+	$my_usr = null;
+}
+if(!empty($_REQUEST['cidReq'])){
+	$my_cid = $_REQUEST['cidReq'];
+}else{
+	$my_cid = null;
+}
+if(!empty($_POST['action'])){
+	$action = $_POST['action'];
+}else{
+	$action = '';
+}
+
+if (empty($my_qst) or empty($my_usr) or empty($my_cid) or empty($my_exe)){
+	header('Location: exercice.php');
+	exit();
+}
+
+if(!$is_courseTutor)
+{
+	api_not_allowed();
+}
+
+$obj_question=new Question();
+$obj_question->read($my_qst);
+
+$nameTools=get_lang('Exercice');
+
+$interbreadcrump[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
+
+$my_msg = 'No change.';
+
+if($action == 'mark'){
+	if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0){
+		
+		//mark the user mark into the database using something similar to the following function:
+		global $_configuration;
+		
+		if($_configuration['tracking_enabled'])
+		{
+			$exercise_table = Database::get_statistic_table('track_e_exercices');
+			#$tbl_learnpath_user = Database::get_course_table('learnpath_user');
+			#global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id;
+			$sql = "SELECT * FROM $exercise_table 
+				WHERE exe_user_id = '$my_usr' AND exe_cours_id = '$my_cid' AND exe_exo_id = '$my_exe' 
+				ORDER BY exe_date DESC";
+			#echo $sql;
+			$res = api_sql_query($sql,__FILE__,__LINE__);
+			if(mysql_num_rows($res)>0){
+				$row = mysql_fetch_array($res);
+				//@todo Check that just summing past score and the new free answer mark doesn't come up
+				// with a score higher than the possible score for that exercise
+				$my_score = $row['exe_result'] + $_POST['score'];
+				$sql = "UPDATE $exercise_table SET exe_result = '$my_score' 
+					WHERE exe_id = '".$row['exe_id']."'";
+				#echo $sql;
+				$res = api_sql_query($sql,__FILE__,__LINE__);
+				$my_msg = get_lang('MarkIsUpdated');
+			}else{
+				$my_score = $_POST['score'];
+				$reallyNow = time();
+				$sql = "INSERT INTO $exercise_table
+						  (
+						   `exe_user_id`,
+						   `exe_cours_id`,
+						   `exe_exo_id`,
+						   `exe_result`,
+						   `exe_weighting`,
+						   `exe_date`
+						  )
+				
+						  VALUES
+						  (
+						  ".$my_usr.",
+						   '".$my_cid."',
+						   '".$my_exe."',
+						   '".$my_score."',
+						   '".$obj_question->selectWeighting()."',
+						   FROM_UNIXTIME(".$reallyNow.")
+						  )";
+				#if ($origin == 'learnpath')
+				#{
+				#	if ($user_id == "NULL")
+				#	{
+				#		$user_id = '0';
+				#	}
+				#	$sql2 = "update `$tbl_learnpath_user` set score='$score' where (user_id=$user_id and learnpath_id='$learnpath_id' and learnpath_item_id='$learnpath_item_id')";
+				#	$res2 = api_sql_query($sql2,__FILE__,__LINE__);
+				#}
+				$res = api_sql_query($sql,__FILE__,__LINE__);
+				$my_msg = get_lang('MarkInserted');
+			}
+			//$mysql_query($sql);
+			//return 0;
+		}
+	}else{
+		$my_msg .= " There might have been a problem with the total score being too big...<br />\n";
+	}
+}
+
+Display::display_header($nameTools,"Exercise");
+
+// Display simple marking interface
+
+// 1a - result of previous marking then exit suggestion
+// 1b - user answer and marking box + submit button
+$objAnswerTmp = new Answer();
+$objAnswerTmp->selectAnswer($answerId);
+
+if($action == 'mark'){
+	echo $my_msg.'<br />
+		<a href="exercice.php?cidReq='.$cidReq.'">'.get_lang('Back').'</a>';
+}else{
+	
+
+	echo '<h2>'.$obj_question->question .':</h2>
+		'.$obj_question->selectTitle().'<br /><br />
+		'.get_lang('PleaseGiveAMark').
+		"<form action='' method='POST'>\n"
+		."<input type='hidden' name='exe' value='$my_exe'>\n"
+		."<input type='hidden' name='usr' value='$my_usr'>\n"
+		."<input type='hidden' name='cidReq' value='$my_cid'>\n"
+		."<input type='hidden' name='action' value='mark'>\n"
+		."<select name='score'>\n";
+		for($i=0 ; $i<$obj_question->selectWeighting() ; $i++){
+			echo '<option>'.$i.'</option>';
+		}
+		echo "</select>".
+		"<input type='submit' name='submit' value='".get_lang('Ok')."'>\n"
+		."</form>";
+}
+
+Display::display_footer();
+
+?>

+ 3 - 2
main/exercice/question_pool.php

@@ -1,4 +1,4 @@
-<?php // $Id: question_pool.php 9246 2006-09-25 13:24:53Z bmol $
+<?php // $Id: question_pool.php 10204 2006-11-26 20:46:53Z pcool $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -39,7 +39,8 @@ include('exercise.class.php');
 include('question.class.php');
 include('answer.class.php');
 
-$langFile='exercice';
+// name of the language file that needs to be included 
+$language_file='exercice';
 
 include('../inc/global.inc.php');
 $this_section=SECTION_COURSES;

+ 2 - 1
main/exercice/savescores.php

@@ -29,7 +29,8 @@
 *	@package dokeos.exercise
 ============================================================================== 
 */
-$langFile = 'learnpath';
+// name of the language file that needs to be included 
+$language_file = 'learnpath';
 include ('../inc/global.inc.php');
 $this_section=SECTION_COURSES;
 

+ 2 - 1
main/exercice/testheaderpage.php

@@ -29,7 +29,8 @@
 *	@package dokeos.exercise
 ============================================================================== 
 */
-	$langFile='exercice';
+	// name of the language file that needs to be included 
+$language_file='exercice';
 	include('../inc/global.inc.php');
 	
 	require_once($_configuration['root_sys'].'main/exercice/hotpotatoes.lib.php'); 

+ 2 - 1
main/external_module/external_module.php

@@ -36,7 +36,8 @@
 ==============================================================================
 */
 
-$langFile='external_module';
+// name of the language file that needs to be included 
+$language_file='external_module';
 
 $iconForImportedTools='external.gif';
 $iconForInactiveImportedTools='external_inactive.gif';

+ 2 - 1
main/forum/editpost.php

@@ -63,7 +63,8 @@
 	Language Initialisation
 -----------------------------------------------------------
 */
-$langFile = 'forum';
+// name of the language file that needs to be included 
+$language_file = 'forum';
 require ('../inc/global.inc.php');
 require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
 include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');

+ 2 - 1
main/forum/iframe_thread.php

@@ -63,7 +63,8 @@
 	Language Initialisation
 -----------------------------------------------------------
 */
-$langFile = 'forum';
+// name of the language file that needs to be included 
+$language_file = 'forum';
 require ('../inc/global.inc.php');
 require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
 include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');

+ 2 - 1
main/forum/index.php

@@ -63,7 +63,8 @@
 	Language Initialisation
 -----------------------------------------------------------
 */
-$langFile = 'forum';
+// name of the language file that needs to be included 
+$language_file = 'forum';
 require ('../inc/global.inc.php');
 require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
 include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');

Некоторые файлы не были показаны из-за большого количества измененных файлов