cfasanando vor 15 Jahren
Ursprung
Commit
5e32cbd7e8
34 geänderte Dateien mit 796 neuen und 759 gelöschten Zeilen
  1. 5 0
      documentation/changelog.html
  2. 2 6
      main/auth/courses.php
  3. 0 2
      main/auth/lostPassword.php
  4. 1 1
      main/auth/lost_password.lib.php
  5. 1 1
      main/auth/my_progress.php
  6. 3 5
      main/auth/profile.php
  7. 32 61
      main/course_info/delete_course.php
  8. 25 24
      main/course_info/download.lib.php
  9. 4 6
      main/course_info/download.php
  10. 121 128
      main/course_info/infocours.php
  11. 17 17
      main/course_info/maintenance.php
  12. 40 64
      main/course_info/postpone.php
  13. 5 5
      main/gradebook/lib/fe/exportgradebook.php
  14. 30 51
      main/help/allowed_html_tags.php
  15. 39 68
      main/help/faq.php
  16. 42 74
      main/help/help.php
  17. 38 30
      main/inc/lib/course_home.lib.php
  18. 2 11
      main/inc/lib/fckeditor/fckeditor.php
  19. 101 81
      main/inc/lib/internationalization.lib.php
  20. 0 26
      main/inc/lib/internationalization_internal.lib.php
  21. 33 3
      main/inc/lib/text.lib.php
  22. 4 14
      main/inc/tool_navigation_menu.inc.php
  23. 3 0
      main/lang/bulgarian/course_info.inc.php
  24. 15 0
      main/lang/bulgarian/exercice.inc.php
  25. 78 2
      main/lang/bulgarian/trad4all.inc.php
  26. 10 0
      main/lang/english/trad4all.inc.php
  27. 0 1
      main/lang/french/tracking.inc.php
  28. 12 0
      main/lang/galician/admin.inc.php
  29. 11 11
      main/lang/slovenian/tracking.inc.php
  30. 54 54
      main/lang/slovenian/trad4all.inc.php
  31. 1 1
      main/lang/spanish/announcements.inc.php
  32. 33 1
      main/lang/spanish/trad4all.inc.php
  33. 12 11
      tests/main/inc/lib/internationalization.lib.test.php
  34. 22 0
      tests/main/inc/lib/text.lib.test.php

+ 5 - 0
documentation/changelog.html

@@ -24,6 +24,11 @@
 <p>Chamilo 1.8.7 is a intermediate&nbsp;release including a lot of new features, mostly focused on social network, the handling of sessions (which will help many educational institutions, public or private, to manage their contents in a more flexible way) and visual style, and a few important bugfixes. It lays the first stable stone in the Chamilo software project.</p>
 <h3>New Features</h3>
 <ul>
+  <li>Full UTF-8 support has been implemented (Feature #272). UTF-8 becomes recommended system encoding to be used. It is recommended too that html-documents created with external tools to be UTF-8 encoded.
+  <br />For newly installed systems: UTF-8 is the default value of the administrator's setting "Character set". Database tables are created for storing UTF-8 encoded texts.
+  <br />For upgraded systems: Upgrade procedure does not change to UTF-8 the administrator's setting "Character set". This may be done later, on administrator's decision. During upgrade database tables are converted to UTF-8. Conversion to UTF-8 of stored in the file system html-documents is not performed, this is not mandatory.
+  <br />Note about integration with external systems: Keep in maind that since version 1.8.7 texts kept in database are UTF-8 encoded. If an external system accesses database records directly, some corrections mignt be necessary about encoding used by the external database.
+  </li>
   <li>New tool: Class attendance (usable in Gradebook)</li>
   <li>New Tool: Student certificate </li>
   <li>Thematic advance option added in course description (shown on course homepage)</li>

+ 2 - 6
main/auth/courses.php

@@ -1,17 +1,13 @@
 <?php
-/* For licensing terms, see /dokeos_license.txt */
+/* For licensing terms, see /license.txt */
 /**
-==============================================================================
-*	@package dokeos.auth
+*	@package chamilo.auth
 *	@todo check if unsubscribing from a course WITH group memberships works as it should
 *	@todo constants are in uppercase, variables aren't
-==============================================================================
 */
 
 /*
-==============================================================================
 		INIT SECTION
-==============================================================================
 */
 
 // Names of the language file that needs to be included.

+ 0 - 2
main/auth/lostPassword.php

@@ -1,7 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-==============================================================================
  * SCRIPT PURPOSE :
  *
  * This script allows users to retrieve the password of their profile(s)
@@ -14,7 +13,6 @@
 *	@todo refactor, move relevant functions to code libraries
 *
 *	@package chamilo.auth
-==============================================================================
 */
 // name of the language file that needs to be included
 $language_file = 'registration';

+ 1 - 1
main/auth/lost_password.lib.php

@@ -1,5 +1,5 @@
 <?php
-/* For licensing terms, see /dokeos_license.txt */
+/* For licensing terms, see /license.txt */
 
 /**
  * @deprecated by Ivan Tcholakov, 09-OCT-2009.

+ 1 - 1
main/auth/my_progress.php

@@ -1,5 +1,5 @@
 <?php
-/* For licensing terms, see /dokeos_license.txt */
+/* For licensing terms, see /license.txt */
 // name of the language file that needs to be included
 $language_file = array('registration', 'tracking', 'exercice', 'admin');
 

+ 3 - 5
main/auth/profile.php

@@ -1,14 +1,12 @@
-<?php // $Id: profile.php 22233 2009-07-20 09:54:05Z ivantcholakov $
-/* For licensing terms, see /dokeos_license.txt */
+<?php
+/* For licensing terms, see /license.txt */
 /**
-==============================================================================
 * This file displays the user's profile,
 * optionally it allows users to modify their profile as well.
 *
 * See inc/conf/profile.conf.php to modify settings
 *
-* @package dokeos.auth
-==============================================================================
+* @package chamilo.auth
 */
 
 /**

+ 32 - 61
main/course_info/delete_course.php

@@ -1,82 +1,53 @@
 <?php
-// $Id: delete_course.php 17195 2008-12-09 23:47:07Z iflorespaz $
-/*
-==============================================================================
-	Dokeos - elearning and course management software
+/* For licensing terms, see /license.txt */
 
-	Copyright (c) 2004 Dokeos S.A.
-	Copyright (c) 2003 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-	Copyright (c) Olivier brouckaert
-	Copyright (c) Roan Embrechts
-	Copyright (c) Bart Mollet, Hogeschool Gent
-
-	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
-==============================================================================
-*/
 /**
-==============================================================================
-*	This script is about deleting a course.
-*	It displays a message box ('are you sure you wish to delete this course')
-*	and deletes the course if the user answers affirmatively
-*
-*	@package dokeos.course_info
-==============================================================================
-*/
-// name of the language file that needs to be included
-$language_file = array ('admin','course_info');
-
-require_once ('../inc/global.inc.php');
-require_once (api_get_path(LIBRARY_PATH).'course.lib.php');
+ *	This script is about deleting a course.
+ *	It displays a message box ('are you sure you wish to delete this course')
+ *	and deletes the course if the user answers affirmatively
+ *
+ *	@package chamilo.course_info
+ */
+
+// Language files that need to be included
+$language_file = array('admin', 'course_info');
+
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
 require_once '../gradebook/lib/be/gradebookitem.class.php';
 require_once '../gradebook/lib/be/category.class.php';
 $this_section = SECTION_COURSES;
 
-$currentCourseCode = $_course['official_code'];
-$currentCourseName = $_course['name'];
+$current_course_code = $_course['official_code'];
+$current_course_name = $_course['name'];
 
-if (!api_is_allowed_to_edit())
-{
+if (!api_is_allowed_to_edit()) {
 	api_not_allowed(true);
 }
 $tool_name = get_lang('DelCourse');
-if (isset($_GET['delete']) && $_GET['delete'] == 'yes')
-{
+
+if (isset($_GET['delete']) && $_GET['delete'] == 'yes') {
+
 	CourseManager :: delete_course($_course['sysCode']);
 
-	$obj_cat=new Category();
+	$obj_cat = new Category();
 	$obj_cat->update_category_delete($_course['sysCode']);
 
 	// DELETE CONFIRMATION MESSAGE
-	unset ($_course);
-	unset ($_cid);
+	unset($_course);
+	unset($_cid);
 	$noPHP_SELF = true;
-	$message = get_lang('Course')." &quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") ".get_lang('HasDel');
-	$message .=  "<br /><br /><a href=\"../../index.php\">".get_lang('BackHome')." ".api_get_setting('siteName')."</a>";
+	$message = get_lang('Course').' &quot;'.$current_course_name.'&quot; ('.$current_course_code.') '.get_lang('HasDel');
+	$message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').' '.api_get_setting('siteName').'</a>';
 
-} // end if $delete
-else
-{
-	$message = "&quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") "."<p>".get_lang("ByDel")."</p>"."<p>"."<a href=\"maintenance.php\">".get_lang("N")."</a>"."&nbsp;&nbsp;|&nbsp;&nbsp;"."<a href=\"".api_get_self()."?delete=yes\">".get_lang("Y")."</a>"."</p>";
-	$interbreadcrumb[] = array ("url" => "maintenance.php", "name" => get_lang('Maintenance'));
+} else {
+	$message = '&quot;'.$current_course_name.'&quot; ('.$current_course_code.') <p>'.get_lang('ByDel').'</p><p><a href="maintenance.php">'.get_lang('No').'</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="'.api_get_self().'?delete=yes">'.get_lang('Yes').'</a></p>';
+	$interbreadcrumb[] = array('url' => 'maintenance.php', 'name' => get_lang('Maintenance'));
 }
-Display :: display_header($tool_name, "Settings");
+Display :: display_header($tool_name, 'Settings');
 api_display_tool_title($tool_name);
-Display::display_warning_message($message,false);
-/*
-==============================================================================
-		FOOTER
-==============================================================================
-*/
+Display::display_warning_message($message, false);
+
+/*	FOOTER */
+
 Display :: display_footer();
-?>

+ 25 - 24
main/course_info/download.lib.php

@@ -1,42 +1,43 @@
 <?php
+/* For licensing terms, see /license.txt */
+
+// TODO: Where this file is used? Is it needed at all?
 
 //require '../inc/global.inc.php';
 
 function create_backup_is_admin($_cid) {
-	
+
 	$this_section = SECTION_COURSES;
-	if(isset($_GET['session']) && $_GET['session'] == true ) 
-	{
-			$archive_path = api_get_path(SYS_ARCHIVE_PATH);
-			$_cid = true;
-			$is_courseAdmin = true;
+	if (isset($_GET['session']) && $_GET['session']) {
+		$archive_path = api_get_path(SYS_ARCHIVE_PATH);
+		$_cid = true;
+		$is_courseAdmin = true;
+	} else {
+		$archive_path = api_get_path(SYS_ARCHIVE_PATH);
 	}
-	 	else 
-	 	{
-			$archive_path = api_get_path(SYS_ARCHIVE_PATH);
-		}
-
-		$archive_file = $_GET['archive'];
-		$archive_file = str_replace(array('..', '/', '\\'), '', $archive_file);
-
-		list($extension) = getextension($archive_file);
-		
-	if (empty($extension) || !file_exists($archive_path.$archive_file)) 
-	{
+
+	$archive_file = $_GET['archive'];
+	$archive_file = str_replace(array('..', '/', '\\'), '', $archive_file);
+
+	list($extension) = getextension($archive_file);
+
+	if (empty($extension) || !file_exists($archive_path.$archive_file)) {
 		return false;
 	}
 
+	$extension = strtolower($extension);
 	$content_type = '';
-	if (in_array(strtolower($extension), array('xml','csv')) && (api_is_platform_admin(true) || api_is_drh())) {
+	if (in_array($extension, array('xml', 'csv')) && (api_is_platform_admin(true) || api_is_drh())) {
 		$content_type = 'application/force-download';
-	} elseif (strtolower($extension) == 'zip' || ('html' && $_cid && (api_is_platform_admin(true) || $is_courseAdmin))) {
+	// TODO: The following unclear condition is commented ant is to be checked. A replacement has been proposed.
+	//} elseif (strtolower($extension) == 'zip' || ('html' && $_cid && (api_is_platform_admin(true) || $is_courseAdmin))) {
+	} elseif ($extension == 'zip' && $_cid && (api_is_platform_admin(true) || $is_courseAdmin)) {
+	//
 		$content_type = 'application/force-download';
 	}
 	if (empty($content_type)) {
-		return false ;
+		return false;
 	}
 	return true;
 }
-return true;
-
-?>
+return true; // TODO: Why is this line here?

+ 4 - 6
main/course_info/download.php

@@ -6,7 +6,7 @@ $this_section = SECTION_COURSES;
 
 require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
 
-if(isset($_GET['session']) && $_GET['session'] == true ){
+if (isset($_GET['session']) && $_GET['session'] == true) {
 	$archive_path = api_get_path(SYS_ARCHIVE_PATH).'temp/';
 	$_cid = true;
 	$is_courseAdmin = true;
@@ -19,17 +19,16 @@ $archive_file = str_replace(array('..', '/', '\\'), '', $archive_file);
 
 list($extension) = getextension($archive_file);
 
-
 if (empty($extension) || !file_exists($archive_path.$archive_file)) {
 	exit();
 }
 
+$extension = strtolower($extension);
 $content_type = '';
 
-if (in_array(strtolower($extension), array('xml','csv')) && (api_is_platform_admin(true) || api_is_drh())) {
+if (in_array($extension, array('xml', 'csv')) && (api_is_platform_admin(true) || api_is_drh())) {
 	$content_type = 'application/force-download';
-}
-elseif (strtolower($extension) == 'zip' && $_cid && (api_is_platform_admin(true) || $is_courseAdmin)) {
+} elseif ($extension == 'zip' && $_cid && (api_is_platform_admin(true) || $is_courseAdmin)) {
 	$content_type = 'application/force-download';
 }
 
@@ -37,7 +36,6 @@ if (empty($content_type)) {
 	api_not_allowed(true);
 }
 
-
 header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
 header('Cache-Control: public');

+ 121 - 128
main/course_info/infocours.php

@@ -1,57 +1,58 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-*	Code to display the course settings form (for the course admin)
-*	and activate the changes.
-*
-*	See ./inc/conf/course_info.conf.php for settings
-* @todo: Move $canBeEmpty from course_info.conf.php to config-settings
-* @todo: Take those config settings into account in this script
-* @author Patrick Cool <patrick.cool@UGent.be>
-* @author Roan Embrechts, refactoring
-* and improved course visibility|subscribe|unsubscribe options
-* @package chamilo.course_info
-*/
-/*	   INIT SECTION 	*/
-// name of the language file that needs to be included
-$language_file = array ('create_course', 'course_info');
+ *	Code to display the course settings form (for the course admin)
+ *	and activate the changes.
+ *
+ *	See ./inc/conf/course_info.conf.php for settings
+ * @todo: Move $canBeEmpty from course_info.conf.php to config-settings
+ * @todo: Take those config settings into account in this script
+ * @author Patrick Cool <patrick.cool@UGent.be>
+ * @author Roan Embrechts, refactoring
+ * and improved course visibility|subscribe|unsubscribe options
+ * @package chamilo.course_info
+ */
+
+/*	   INIT SECTION */
+
+// Language files that need to be included
+$language_file = array('create_course', 'course_info');
 require_once '../inc/global.inc.php';
 $this_section = SECTION_COURSES;
 
-$nameTools = get_lang("ModifInfo");
+$nameTools = get_lang('ModifInfo');
 
-/*	Libraries	*/
+/*	Libraries */
 require_once api_get_path(LIBRARY_PATH).'course.lib.php';
-require_once api_get_path(INCLUDE_PATH)."conf/course_info.conf.php";
-require_once api_get_path(INCLUDE_PATH)."lib/debug.lib.inc.php";
+require_once api_get_path(INCLUDE_PATH).'conf/course_info.conf.php';
+require_once api_get_path(INCLUDE_PATH).'lib/debug.lib.inc.php';
 require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
-/*	Constants and variables	*/
-define("MODULE_HELP_NAME", "Settings");
-define("COURSE_CHANGE_PROPERTIES", "COURSE_CHANGE_PROPERTIES");
+
+/*	Constants and variables */
+define('MODULE_HELP_NAME', 'Settings');
+define('COURSE_CHANGE_PROPERTIES', 'COURSE_CHANGE_PROPERTIES');
 $TABLECOURSE 				= Database :: get_main_table(TABLE_MAIN_COURSE);
 $TABLEFACULTY 				= Database :: get_main_table(TABLE_MAIN_CATEGORY);
 $TABLECOURSEHOME 			= Database :: get_course_table(TABLE_TOOL_LIST);
 $TABLELANGUAGES 			= Database :: get_main_table(TABLE_MAIN_LANGUAGE);
 $TABLEBBCONFIG 				= Database :: get_course_table(TOOL_FORUM_CONFIG_TABLE);
 $currentCourseID 			= $_course['sysCode'];
-$currentCourseRepository 	= $_course["path"];
+$currentCourseRepository 	= $_course['path'];
 $is_allowedToEdit 			= $is_courseAdmin || $is_platformAdmin;
 $course_setting_table 		= Database::get_course_table(TABLE_COURSE_SETTING);
 
-/*		LOGIC FUNCTIONS		*/
-function is_settings_editable()
-{
-	return $GLOBALS["course_info_is_editable"];
-}
-$course_code = $_course["sysCode"];
+$course_code = $_course['sysCode'];
 $course_access_settings = CourseManager :: get_access_settings($course_code);
 
-/*
-		MAIN CODE
-*/
+/*		LOGIC FUNCTIONS */
+function is_settings_editable() {
+	return $GLOBALS['course_info_is_editable'];
+}
+
+/*		MAIN CODE */
 
-if (!$is_allowedToEdit)
-{
+if (!$is_allowedToEdit) {
 	api_not_allowed(true);
 }
 
@@ -65,17 +66,17 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
 $sql = "SELECT code,name FROM ".$table_course_category." WHERE auth_course_child ='TRUE'  OR code = '".Database::escape_string($_course['categoryCode'])."'  ORDER BY tree_pos";
 $res = Database::query($sql);
 
-$s_select_course_tutor_name="SELECT tutor_name FROM $tbl_course WHERE code='$course_code'";
-$q_tutor=Database::query($s_select_course_tutor_name);
-$s_tutor=Database::result($q_tutor,0,"tutor_name");
+$s_select_course_tutor_name = "SELECT tutor_name FROM $tbl_course WHERE code='$course_code'";
+$q_tutor = Database::query($s_select_course_tutor_name);
+$s_tutor = Database::result($q_tutor, 0, 'tutor_name');
 
-$s_sql_course_titular="SELECT DISTINCT username, lastname, firstname FROM $tbl_user as user, $tbl_course_user as course_rel_user WHERE (course_rel_user.status='1') AND user.user_id=course_rel_user.user_id AND course_code='".$course_code."'";
-$q_result_titulars=Database::query($s_sql_course_titular);
+$s_sql_course_titular = "SELECT DISTINCT username, lastname, firstname FROM $tbl_user as user, $tbl_course_user as course_rel_user WHERE (course_rel_user.status='1') AND user.user_id=course_rel_user.user_id AND course_code='".$course_code."'";
+$q_result_titulars = Database::query($s_sql_course_titular);
 
 $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname';
-if(Database::num_rows($q_result_titulars)==0){
-	$sql="SELECT username, lastname, firstname FROM $tbl_user as user, $tbl_admin as admin WHERE admin.user_id=user.user_id ORDER BY ".$target_name." ASC";
-	$q_result_titulars=Database::query($sql);
+if (Database::num_rows($q_result_titulars) == 0) {
+	$sql = "SELECT username, lastname, firstname FROM $tbl_user as user, $tbl_admin as admin WHERE admin.user_id=user.user_id ORDER BY ".$target_name." ASC";
+	$q_result_titulars = Database::query($sql);
 }
 
 $a_profs[0] = '-- '.get_lang('NoManager').' --';
@@ -94,8 +95,7 @@ while ($a_titulars = Database::fetch_array($q_result_titulars)) {
 	$a_profs[api_get_person_name($s_firstname, $s_lastname)] = api_get_person_name($s_lastname, $s_firstname).' ('.$s_username.')';
 }
 
-while ($cat = Database::fetch_array($res))
-{
+while ($cat = Database::fetch_array($res)) {
 	$categories[$cat['code']] = '('.$cat['code'].') '.$cat['name'];
 	ksort($categories);
 }
@@ -107,26 +107,26 @@ $linebreak = '<div class="row"><div class="label"></div><div class="formw" style
 $form = new FormValidator('update_course');
 
 // COURSE SETTINGS
-$form->addElement('html','<div class="sectiontitle"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="coursesettings" id="coursesettings"></a>'.Display::return_icon('settings.gif',get_lang('CourseSettings')).' '.get_lang('CourseSettings').'</div>');
-$visual_code=$form->addElement('text','visual_code', get_lang('Code'));
-	$visual_code->freeze();
+$form->addElement('html', '<div class="sectiontitle"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="coursesettings" id="coursesettings"></a>'.Display::return_icon('settings.gif', get_lang('CourseSettings')).' '.get_lang('CourseSettings').'</div>');
+$visual_code=$form->addElement('text', 'visual_code', get_lang('Code'));
+$visual_code->freeze();
 $form->applyFilter('visual_code', 'strtoupper');
 //$form->add_textfield('tutor_name', get_lang('Professors'), true, array ('size' => '60'));
 $prof = &$form->addElement('select', 'tutor_name', get_lang('Professors'), $a_profs);
-$form->applyFilter('tutor_name','html_filter');
+$form->applyFilter('tutor_name', 'html_filter');
 
 $prof -> setSelected($s_selected_tutor);
-$form->add_textfield('title', get_lang('Title'), true, array ('size' => '60'));
-//$form->applyFilter('title','html_filter');
-$form->applyFilter('title','trim');
+$form->add_textfield('title', get_lang('Title'), true, array('size' => '60'));
+//$form->applyFilter('title', 'html_filter');
+$form->applyFilter('title', 'trim');
 
 $form->addElement('select', 'category_code', get_lang('Fac'), $categories);
-$form->add_textfield('department_name', get_lang('Department'), false, array ('size' => '60'));
-//$form->applyFilter('department_name','html_filter');
-$form->applyFilter('department_name','trim');
+$form->add_textfield('department_name', get_lang('Department'), false, array('size' => '60'));
+//$form->applyFilter('department_name', 'html_filter');
+$form->applyFilter('department_name', 'trim');
 
-$form->add_textfield('department_url', get_lang('DepartmentUrl'), false, array ('size' => '60'));
-//$form->applyFilter('department_url','html_filter');
+$form->add_textfield('department_url', get_lang('DepartmentUrl'), false, array('size' => '60'));
+//$form->applyFilter('department_url', 'html_filter');
 
 $form->addRule('tutor_name', get_lang('ThisFieldIsRequired'), 'required');
 $form->addElement('select_language', 'course_language', get_lang('Ln'));
@@ -136,43 +136,42 @@ $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class=
 
 
 // COURSE ACCESS
-$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="coursesaccess" id="coursesaccess"></a>'.Display::return_icon('course.gif',get_lang('CourseAccess')).' '.get_lang('CourseAccess').'</div>');
+$form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="coursesaccess" id="coursesaccess"></a>'.Display::return_icon('course.gif', get_lang('CourseAccess')).' '.get_lang('CourseAccess').'</div>');
 $form->addElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
 $form->addElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
 $form->addElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
 $form->addElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
 $form->addElement('static', null, null, get_lang("CourseAccessConfigTip"));
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1);
 $form->addElement('radio', 'subscribe', null, get_lang('Denied'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1);
 $form->addElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
-$form->add_textfield('course_registration_password', get_lang('CourseRegistrationPassword'), false, array ('size' => '60'));
+$form->add_textfield('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60'));
 
 $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
 
 
-
 // EMAIL NOTIFICATIONS
-$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="emailnotifications" id="emailnotifications"></a>'.Display::return_icon('mail.png',get_lang('EmailNotifications')).' '.get_lang('EmailNotifications').'</div>');
+$form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="emailnotifications" id="emailnotifications"></a>'.Display::return_icon('mail.png', get_lang('EmailNotifications')).' '.get_lang('EmailNotifications').'</div>');
 
 $form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', get_lang('NewUserEmailAlert'), get_lang('NewUserEmailAlertEnable'), 1);
-$form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null,get_lang('NewUserEmailAlertToTeacharAndTutor'),2);
+$form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertToTeacharAndTutor'), 2);
 $form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertDisable'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'email_alert_manager_on_new_doc', get_lang('WorkEmailAlert'), get_lang('WorkEmailAlertActivate'), 1);
 $form->addElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertDeactivate'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'email_alert_on_new_doc_dropbox', get_lang('DropboxEmailAlert'), get_lang('DropboxEmailAlertActivate'), 1);
 $form->addElement('radio', 'email_alert_on_new_doc_dropbox', null, get_lang('DropboxEmailAlertDeactivate'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'email_alert_manager_on_new_quiz', get_lang('QuizEmailAlert'), get_lang('QuizEmailAlertActivate'), 1);
 $form->addElement('radio', 'email_alert_manager_on_new_quiz', null, get_lang('QuizEmailAlertDeactivate'), 0);
@@ -182,18 +181,18 @@ $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class=
 
 
 // USER RIGHTS
-$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="userrights" id="userrights"></a>'.Display::return_icon('members.gif',get_lang('UserRights')).' '.get_lang('UserRights').'</div>');
+$form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="userrights" id="userrights"></a>'.Display::return_icon('members.gif', get_lang('UserRights')).' '.get_lang('UserRights').'</div>');
 $form->addElement('radio', 'allow_user_edit_agenda', get_lang('AllowUserEditAgenda'), get_lang('AllowUserEditAgendaActivate'), 1);
 $form->addElement('radio', 'allow_user_edit_agenda', null, get_lang('AllowUserEditAgendaDeactivate'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'allow_user_edit_announcement', get_lang('AllowUserEditAnnouncement'), get_lang('AllowUserEditAnnouncementActivate'), 1);
 $form->addElement('radio', 'allow_user_edit_announcement', null, get_lang('AllowUserEditAnnouncementDeactivate'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'allow_user_image_forum', get_lang('AllowUserImageForum'), get_lang('AllowUserImageForumActivate'), 1);
 $form->addElement('radio', 'allow_user_image_forum', null, get_lang('AllowUserImageForumDeactivate'), 0);
-$form -> addElement('html',$linebreak);
+$form -> addElement('html', $linebreak);
 
 $form->addElement('radio', 'allow_user_view_user_list', get_lang('AllowUserViewUserList'), get_lang('AllowUserViewUserListActivate'), 1);
 $form->addElement('radio', 'allow_user_view_user_list', null, get_lang('AllowUserViewUserListDeactivate'), 0);
@@ -202,7 +201,7 @@ $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class=
 
 
 // CHAT SETTINGS
-$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="chatsettings" id="chatsettings"></a>'.Display::return_icon('chat.gif',get_lang('ConfigChat')).' '.get_lang('ConfigChat').'</div>');
+$form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="chatsettings" id="chatsettings"></a>'.Display::return_icon('chat.gif', get_lang('ConfigChat')).' '.get_lang('ConfigChat').'</div>');
 $form->addElement('radio', 'allow_open_chat_window', get_lang('AllowOpenchatWindow'), get_lang('AllowOpenChatWindowActivate'), 1);
 $form->addElement('radio', 'allow_open_chat_window', null, get_lang('AllowOpenChatWindowDeactivate'), 0);
 
@@ -211,22 +210,22 @@ $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class=
 
 // COURSE THEME PICKER
 if (api_get_setting('allow_course_theme') == 'true') {
-	$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="theme" id="theme"></a>'.Display::return_icon('theme.gif',get_lang('Theming')).' '.get_lang('Theming').'</div><div style="clear:both;"></div>');
+	$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="theme" id="theme"></a>'.Display::return_icon('theme.gif', get_lang('Theming')).' '.get_lang('Theming').'</div><div style="clear:both;"></div>');
 
-	//Allow Learning path
+	// Allow Learning path
 	$form->addElement('radio', 'allow_learning_path_theme', get_lang('AllowLearningPathTheme'), get_lang('AllowLearningPathThemeAllow'), 1);
 	$form->addElement('radio', 'allow_learning_path_theme', null, get_lang('AllowLearningPathThemeDisallow'), 0);
-	$form -> addElement('html',$linebreak);
+	$form -> addElement('html', $linebreak);
 
 	$form->addElement('select_theme', 'course_theme', get_lang('Theme'));
 	$form->applyFilter('course_theme', 'trim');
-	$form -> addElement('html',$linebreak);
+	$form -> addElement('html', $linebreak);
 }
 
 if (is_settings_editable()) {
 	$form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
 } else {
-	// is it allowed to edit the course settings?
+	// Is it allowed to edit the course settings?
 	if (!is_settings_editable())
 		$disabled_output = "disabled";
 	$form->freeze();
@@ -234,7 +233,7 @@ if (is_settings_editable()) {
 
 
 // THEMATIC SETTINGS
-$form->addElement('html','<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif',get_lang('Top')).'</a><a name="chatsettings" id="chatsettings"></a>'.Display::return_icon('attendance.gif',get_lang('ConfigChat')).' '.get_lang('ThematicAdvanceConfiguration').'</div>');
+$form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="chatsettings" id="chatsettings"></a>'.Display::return_icon('attendance.gif', get_lang('ConfigChat')).' '.get_lang('ThematicAdvanceConfiguration').'</div>');
 $form->addElement('radio', 'display_info_advance_inside_homecourse', get_lang('InfoAboutAdvanceInsideHomeCourse'), get_lang('DisplayAboutLastDoneAdvance'), 1);
 $form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDone'), 0);
 
@@ -242,7 +241,7 @@ $form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_l
 $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
 
 
-// get all the course information
+// Get all the course information
 $all_course_information =  CourseManager::get_course_information($_course['sysCode']);
 
 
@@ -259,29 +258,29 @@ $values['visibility'] = $_course['visibility'];
 $values['subscribe'] = $course_access_settings['subscribe'];
 $values['unsubscribe'] = $course_access_settings['unsubscribe'];
 $values['course_registration_password'] =  $all_course_information['registration_code'];
-// get send_mail_setting (auth)from table
+// Get send_mail_setting (auth)from table
 $values['email_alert_to_teacher_on_new_user_in_course'] = api_get_course_setting('email_alert_to_teacher_on_new_user_in_course');
-// get send_mail_setting (work)from table
+// Get send_mail_setting (work)from table
 $values['email_alert_manager_on_new_doc'] = api_get_course_setting('email_alert_manager_on_new_doc');
-// get send_mail_setting (dropbox) from table
+// Get send_mail_setting (dropbox) from table
 $values['email_alert_on_new_doc_dropbox'] = api_get_course_setting('email_alert_on_new_doc_dropbox');
-// get send_mail_setting (work)from table
+// Get send_mail_setting (work)from table
 $values['email_alert_manager_on_new_quiz'] = api_get_course_setting('email_alert_manager_on_new_quiz');
-// get allow_user_edit_agenda from table
+// Get allow_user_edit_agenda from table
 $values['allow_user_edit_agenda'] = api_get_course_setting('allow_user_edit_agenda');
-// get allow_user_edit_announcement from table
+// Get allow_user_edit_announcement from table
 $values['allow_user_edit_announcement'] = api_get_course_setting('allow_user_edit_announcement');
-// get allow_user_image_forum from table
+// Get allow_user_image_forum from table
 $values['allow_user_image_forum'] = api_get_course_setting('allow_user_image_forum');
-// get allow_open_chat_window from table
+// Get allow_open_chat_window from table
 $values['allow_open_chat_window'] = api_get_course_setting('allow_open_chat_window');
-// get course_theme from table
+// Get course_theme from table
 $values['course_theme'] = api_get_course_setting('course_theme');
-// get allow_learning_path_theme from table
+// Get allow_learning_path_theme from table
 $values['allow_learning_path_theme'] = api_get_course_setting('allow_learning_path_theme');
-//get allow show user list 
+//Get allow show user list
 $values['allow_user_view_user_list'] = api_get_course_setting('allow_user_view_user_list');
-//get allow show user list 
+//Get allow show user list
 $values['display_info_advance_inside_homecourse'] = api_get_course_setting('display_info_advance_inside_homecourse');
 
 
@@ -289,7 +288,7 @@ $form->setDefaults($values);
 // Validate form
 if ($form->validate() && is_settings_editable()) {
 	$update_values = $form->exportValues();
-	foreach ($update_values as $index => $value) {
+	foreach ($update_values as $index => & $value) {
 		$update_values[$index] = Database::escape_string($value);
 	}
 	$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
@@ -308,99 +307,94 @@ if ($form->validate() && is_settings_editable()) {
 			WHERE code = '".$course_code."'";
 	Database::query($sql);
 
-	//update course_settings table - this assumes those records exist, otherwise triggers an error
+	// Update course_settings table - this assumes those records exist, otherwise triggers an error
 	$table_course_setting = Database::get_course_table(TABLE_COURSE_SETTING);
-	if($update_values['email_alert_to_teacher_on_new_user_in_course'] != $values['email_alert_to_teacher_on_new_user_in_course']){
+	if ($update_values['email_alert_to_teacher_on_new_user_in_course'] != $values['email_alert_to_teacher_on_new_user_in_course']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['email_alert_to_teacher_on_new_user_in_course']." WHERE variable = 'email_alert_to_teacher_on_new_user_in_course' ";
 		Database::query($sql);
 	}
-	if($update_values['email_alert_manager_on_new_doc'] != $values['email_alert_manager_on_new_doc']){
+	if ($update_values['email_alert_manager_on_new_doc'] != $values['email_alert_manager_on_new_doc']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['email_alert_manager_on_new_doc']." WHERE variable = 'email_alert_manager_on_new_doc' ";
 		Database::query($sql);
 	}
-	if($update_values['email_alert_on_new_doc_dropbox'] != $values['email_alert_on_new_doc_dropbox']){
+	if ($update_values['email_alert_on_new_doc_dropbox'] != $values['email_alert_on_new_doc_dropbox']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['email_alert_on_new_doc_dropbox']." WHERE variable = 'email_alert_on_new_doc_dropbox' ";
 		Database::query($sql);
 	}
-	if($update_values['email_alert_manager_on_new_quiz'] != $values['email_alert_manager_on_new_quiz']){
+	if ($update_values['email_alert_manager_on_new_quiz'] != $values['email_alert_manager_on_new_quiz']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['email_alert_manager_on_new_quiz']." WHERE variable = 'email_alert_manager_on_new_quiz' ";
 		Database::query($sql);
 	}
-	if($update_values['allow_user_edit_agenda'] != $values['allow_user_edit_agenda']){
+	if ($update_values['allow_user_edit_agenda'] != $values['allow_user_edit_agenda']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_user_edit_agenda']." WHERE variable = 'allow_user_edit_agenda' ";
 		Database::query($sql);
 	}
-	if($update_values['allow_user_edit_announcement'] != $values['allow_user_edit_announcement']){
+	if ($update_values['allow_user_edit_announcement'] != $values['allow_user_edit_announcement']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_user_edit_announcement']." WHERE variable = 'allow_user_edit_announcement' ";
 		Database::query($sql);
 	}
-	if($update_values['allow_user_image_forum'] != $values['allow_user_image_forum']){
+	if ($update_values['allow_user_image_forum'] != $values['allow_user_image_forum']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_user_image_forum']." WHERE variable = 'allow_user_image_forum' ";
 		Database::query($sql);
 	}
-	if($update_values['allow_open_chat_window'] != $values['allow_open_chat_window']){
+	if ($update_values['allow_open_chat_window'] != $values['allow_open_chat_window']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_open_chat_window']." WHERE variable = 'allow_open_chat_window' ";
 		Database::query($sql);
 	}
-	if($update_values['course_theme'] != $values['course_theme']){
+	if ($update_values['course_theme'] != $values['course_theme']) {
 		$sql = "UPDATE $table_course_setting SET value = '".$update_values['course_theme']."' WHERE variable = 'course_theme' ";
 		Database::query($sql);
 	}
-	if($update_values['allow_learningpath_theme'] != $values['allow_learning_path_theme']){
+	if ($update_values['allow_learningpath_theme'] != $values['allow_learning_path_theme']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_learning_path_theme']." WHERE variable = 'allow_learning_path_theme' ";
 		Database::query($sql);
 	}
-	
-	if($update_values['allow_user_view_user_list'] != $values['allow_user_view_user_list']){
+
+	if ($update_values['allow_user_view_user_list'] != $values['allow_user_view_user_list']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['allow_user_view_user_list']." WHERE variable = 'allow_user_view_user_list' ";
 		Database::query($sql);
 	}
-	
-	if($update_values['display_info_advance_inside_homecourse'] != $values['display_info_advance_inside_homecourse']){
+
+	if ($update_values['display_info_advance_inside_homecourse'] != $values['display_info_advance_inside_homecourse']) {
 		$sql = "UPDATE $table_course_setting SET value = ".(int)$update_values['display_info_advance_inside_homecourse']." WHERE variable = 'display_info_advance_inside_homecourse' ";
 		Database::query($sql);
 	}
 
 	$cidReset = true;
 	$cidReq = $course_code;
-	include ('../inc/local.inc.php');
+	require '../inc/local.inc.php';
 	header('Location: infocours.php?action=show_message&amp;cidReq='.$course_code);
 	exit;
 }
-/*
------------------------------------------------------------
-	Header
------------------------------------------------------------
-*/
+
+/*	Header */
 
 Display :: display_header($nameTools, MODULE_HELP_NAME);
 
 //api_display_tool_title($nameTools);
-if (isset ($_GET['action']) && $_GET['action'] == 'show_message')
-	{
+if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
 	Display :: display_normal_message(get_lang('ModifDone'));
-	}
+}
 
 // actions bar
 echo '<div class="actions">';
-echo '<a href="#coursesettings">'.Display::return_icon('settings.gif',get_lang('CourseSettings')).' '.get_lang('CourseSettings').'</a>';
-echo '<a href="#coursesaccess">'.Display::return_icon('course.gif',get_lang('CourseAccess')).' '.get_lang('CourseAccess').'</a>';
-echo '<a href="#emailnotifications">'.Display::return_icon('mail.png',get_lang('EmailNotifications')).' '.get_lang('EmailNotifications').'</a>';
-echo '<a href="#userrights">'.Display::return_icon('members.gif',get_lang('UserRights')).' '.get_lang('UserRights').'</a>';
-echo '<a href="#chatsettings">'.Display::return_icon('chat.gif',get_lang('ConfigChat')).' '.get_lang('ConfigChat').'</a>';
-if (api_get_setting('allow_course_theme') == 'true')
-{
-	echo '<a href="#theme">'.Display::return_icon('theme.gif',get_lang('Theming')).' '.get_lang('Theming').'</a>';
+echo '<a href="#coursesettings">'.Display::return_icon('settings.gif', get_lang('CourseSettings')).' '.get_lang('CourseSettings').'</a>';
+echo '<a href="#coursesaccess">'.Display::return_icon('course.gif', get_lang('CourseAccess')).' '.get_lang('CourseAccess').'</a>';
+echo '<a href="#emailnotifications">'.Display::return_icon('mail.png', get_lang('EmailNotifications')).' '.get_lang('EmailNotifications').'</a>';
+echo '<a href="#userrights">'.Display::return_icon('members.gif', get_lang('UserRights')).' '.get_lang('UserRights').'</a>';
+echo '<a href="#chatsettings">'.Display::return_icon('chat.gif', get_lang('ConfigChat')).' '.get_lang('ConfigChat').'</a>';
+if (api_get_setting('allow_course_theme') == 'true') {
+	echo '<a href="#theme">'.Display::return_icon('theme.gif', get_lang('Theming')).' '.get_lang('Theming').'</a>';
 }
 echo '</div>';
 
 // Display the form
 $form->display();
 
-//@todo this code is out dated should 
+// @todo this code is out dated should
+
+if ($showDiskQuota && $currentCourseDiskQuota != '') {
 
-	if ($showDiskQuota && $currentCourseDiskQuota != "") {
-		
 ?>
 <table>
 	<tr>
@@ -483,8 +477,7 @@ $form->display();
 </table>
 <?php
 
-	}
+}
 
 /*		FOOTER	*/
 Display::display_footer();
-?>

+ 17 - 17
main/course_info/maintenance.php

@@ -1,43 +1,43 @@
-<?php // $Id: infocours.php 14956 2008-04-20 14:21:32Z yannoo $
+<?php
 /* For licensing terms, see /license.txt */
 
 /*
  * Created on 18 October 2006 by Elixir Interactive http://www.elixir-interactive.com
  */
-// name of the language file that needs to be included
-$language_file = array ('admin','create_course', 'course_info', 'coursebackup');
+
+// Language files that need to be included
+$language_file = array('admin','create_course', 'course_info', 'coursebackup');
 
 require_once '../inc/global.inc.php';
 $this_section = SECTION_COURSES;
-$nameTools= get_lang('Maintenance');
+$nameTools = get_lang('Maintenance');
 api_block_anonymous_users();
 Display :: display_header($nameTools);
 api_display_tool_title($nameTools);
 
 ?>
 
-<div class="sectiontitle"><?php Display::display_icon('save_import.gif', get_lang("backup")); ?>&nbsp;&nbsp;<a href="../coursecopy/backup.php?<?php echo api_get_cidreq();?>"><?php echo get_lang("backup");?></a></div>
+<div class="sectiontitle"><?php Display::display_icon('save_import.gif', get_lang('backup')); ?>&nbsp;&nbsp;<a href="../coursecopy/backup.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('backup'); ?></a></div>
 <div class="sectioncomment">
 		<ul>
-		    <li><a href="../coursecopy/create_backup.php?<?php echo api_get_cidreq();?>"><?php echo get_lang('CreateBackup')  ?></a><br/>
-		    <?php echo get_lang('CreateBackupInfo') ?>
+		    <li><a href="../coursecopy/create_backup.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('CreateBackup'); ?></a><br/>
+		    <?php echo get_lang('CreateBackupInfo'); ?>
 		    </li>
-		    <li><a href="../coursecopy/import_backup.php?<?php echo api_get_cidreq();?>"><?php echo get_lang('ImportBackup')  ?></a><br/>
-		    <?php echo get_lang('ImportBackupInfo') ?>
+		    <li><a href="../coursecopy/import_backup.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('ImportBackup'); ?></a><br/>
+		    <?php echo get_lang('ImportBackupInfo'); ?>
 		    </li>
 	    </ul>
 </div>
 
-<div class="sectiontitle"><?php Display::display_icon('copy.gif', get_lang("CopyCourse")); ?>&nbsp;&nbsp;<a href="../coursecopy/copy_course.php?<?php echo api_get_cidreq();?>"><?php echo get_lang("CopyCourse");?></a></div>
-<div class="sectioncomment"><?php echo get_lang("DescriptionCopyCourse"); ?></div>
+<div class="sectiontitle"><?php Display::display_icon('copy.gif', get_lang('CopyCourse')); ?>&nbsp;&nbsp;<a href="../coursecopy/copy_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('CopyCourse'); ?></a></div>
+<div class="sectioncomment"><?php echo get_lang('DescriptionCopyCourse'); ?></div>
 
-<div class="sectiontitle"><?php Display::display_icon('tool_delete.gif', get_lang("recycle_course")); ?>&nbsp;&nbsp;<a href="../coursecopy/recycle_course.php?<?php echo api_get_cidreq();?>"><?php echo get_lang("recycle_course");?></a></div>
-<div class="sectioncomment"><?php echo get_lang("DescriptionRecycleCourse");?></div>
+<div class="sectiontitle"><?php Display::display_icon('tool_delete.gif', get_lang('recycle_course')); ?>&nbsp;&nbsp;<a href="../coursecopy/recycle_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('recycle_course'); ?></a></div>
+<div class="sectioncomment"><?php echo get_lang('DescriptionRecycleCourse'); ?></div>
 
-<div class="sectiontitle"><?php Display::display_icon('delete.gif',get_lang("DelCourse")); ?>&nbsp;&nbsp;<a href="../course_info/delete_course.php?<?php echo api_get_cidreq();?>"><?php echo get_lang("DelCourse");?></a></div>
-<div class="sectioncomment"><?php echo get_lang("DescriptionDeleteCourse");	?></div>
+<div class="sectiontitle"><?php Display::display_icon('delete.gif', get_lang('DelCourse')); ?>&nbsp;&nbsp;<a href="../course_info/delete_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('DelCourse'); ?></a></div>
+<div class="sectioncomment"><?php echo get_lang('DescriptionDeleteCourse');	?></div>
 
 <?php
-// footer
+// Footer
 Display::display_footer();
-?>

+ 40 - 64
main/course_info/postpone.php

@@ -1,55 +1,31 @@
-<?php  // $Id: postpone.php 10204 2006-11-26 20:46:53Z pcool $
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004 Dokeos S.A.
-	Copyright (c) 2003 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-
-	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.
+<?php
+/* For licensing terms, see /license.txt */
 
-	See the GNU General Public License for more details.
+// TODO: Is this file needed anymore?
 
-	Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
 /**
-==============================================================================
-* MODIFY COURSE INFO                                          |
-* Modify course settings like:										 |
-* 1. Course title													 |
-* 2. Department													 |
-* 3. Course description URL in the university web					 |
-* Course code cannot be modified, because it gives the name for the	 |
-* course database and course web directory. Professor cannot be 		 |
-* changed either as it determines who is allowed to modify the course. |
-*
-*
-*	@author Thomas Depraetere
-*	@author Hugues Peeters
-*	@author Christophe Gesche
-*
-*	@package dokeos.course_info
-==============================================================================
-*/
-
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
-
-// name of the language file that needs to be included
-$language_file = "postpone";
-//$interbreadcrumb[]= array ("url"=>"index.php", "name"=> get_lang('Admin'));
+ * MODIFY COURSE INFO
+ * Modify course settings like:
+ * 1. Course title
+ * 2. Department
+ * 3. Course description URL in the university web
+ * Course code cannot be modified, because it gives the name for the
+ * course database and course web directory. Professor cannot be
+ * changed either as it determines who is allowed to modify the course.
+ *
+ * @author Thomas Depraetere
+ * @author Hugues Peeters
+ * @author Christophe Gesche
+ *
+ * @package chamilo.course_info
+ */
+
+/*	INIT SECTION */
+
+// Language file that needs to be included
+$language_file = 'postpone';
+
+//$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Admin'));
 $htmlHeadXtra[] = "
 <style type=\"text/css\">
 <!--
@@ -60,28 +36,29 @@ $htmlHeadXtra[] = "
 <STYLE media=\"print\" type=\"text/css\">
 TD {border-bottom: thin dashed Gray;}
 </STYLE>";
-include('../inc/global.inc.php');
-$this_section=SECTION_COURSES;
 
-include(api_get_path(LIBRARY_PATH).'debug.lib.inc.php');
-Display::display_header($nameTools,"Settings");
+require '../inc/global.inc.php';
+$this_section = SECTION_COURSES;
+
+@include api_get_path(LIBRARY_PATH).'debug.lib.inc.php';
+Display::display_header($nameTools, 'Settings');
 
-//include(api_get_path(CONFIGURATION_PATH)."postpone.conf.php");
+//include api_get_path(CONFIGURATION_PATH).'postpone.conf.php';
 
-$nameTools = get_lang('Postpone');
-$TABLECOURSE	= Database::get_main_table(TABLE_MAIN_COURSE);
-$is_allowedToEdit 			= $is_courseAdmin;
-$currentCourseID 			= $_course['sysCode'];
-$currentCourseRepository 	= $_course["path"];
+$nameTools					= get_lang('Postpone');
+$TABLECOURSE				= Database::get_main_table(TABLE_MAIN_COURSE);
+$is_allowedToEdit			= $is_courseAdmin;
+$currentCourseID			= $_course['sysCode'];
+$currentCourseRepository	= $_course['path'];
 
 
 $sqlCourseExtention 			= "SELECT last_visit, last_edit, creation_date, expiration_date FROM ".$TABLECOURSE." WHERE code = '".$_cid."'";
 $resultCourseExtention 			= Database::query($sqlCourseExtention);
 $currentCourseExtentionData 	= Database::fetch_array($resultCourseExtention);
-$currentCourseLastVisit 		= $currentCourseExtentionData["last_visit"];
-$currentCourseLastEdit			= $currentCourseExtentionData["last_edit"];
-$currentCourseCreationDate 		= $currentCourseExtentionData["creation_date"];
-$currentCourseExpirationDate	= $currentCourseExtentionData["expiration_date"];
+$currentCourseLastVisit 		= $currentCourseExtentionData['last_visit'];
+$currentCourseLastEdit			= $currentCourseExtentionData['last_edit'];
+$currentCourseCreationDate 		= $currentCourseExtentionData['creation_date'];
+$currentCourseExpirationDate	= $currentCourseExtentionData['expiration_date'];
 // HERE YOU CAN EDIT YOUR RULES TO EXTEND THE LIFE OF COURSE
 
 // $newCourseExpirationDate	= now() + $extendDelay
@@ -103,4 +80,3 @@ to give more time to a course before expiration.
 
 <?php
 Display::display_footer();
-?>

+ 5 - 5
main/gradebook/lib/fe/exportgradebook.php

@@ -11,10 +11,10 @@ function print_table ($data_array,$header_names,$view,$coursename) {
 	$printdata= '<!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.api_get_language_isocode().'" lang="'.api_get_language_isocode().'">
 <head>
 <title>'.get_lang('Print').'</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="Content-Type" content="text/html; charset='.api_get_system_encoding().'" />
 
 
 <style type="text/css">
@@ -58,8 +58,8 @@ a:active {text-decoration: none; font-weight : bold;  color : black;}
 }
 </style>
 </head>
-<body><div id="main">';
-	
+<body dir="'.api_get_text_direction().'"><div id="main">';
+
 	$printdata .= '<h2>'.$view.' : '.$coursename.'</h2>';
 	//@todo not necessary here
 	//$printdata .= '<h3>'.get_lang('Date').' : '.api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).'</h3>';
@@ -67,7 +67,7 @@ a:active {text-decoration: none; font-weight : bold;  color : black;}
 	foreach ($header_names as $header) {
 		$printdata .= '<th>'.$header.'</th>';
 	}
-	
+
 	foreach ($data_array as $data) {
 		$printdata .= '<tr>';
 		foreach ($data as $rowdata) {

+ 30 - 51
main/help/allowed_html_tags.php

@@ -1,90 +1,69 @@
 <?php
-/*
-==============================================================================
-	Dokeos - elearning and course management software
+/* For licensing terms, see /license.txt */
 
-	Copyright (c) 2004-2005 Dokeos S.A.
-	Copyright (c) Bart Mollet, Hogeschool Gent
-
-	For a full list of contributors, see "credits.txt".
-	The full license can be read in "license.txt".
+/**
+ *	This	 script displays a help window with an overview of the allowed HTML-
+ *   tags  and their attributes.
+ *
+ *	@package chamilo.help
+ */
 
-	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.
+// Language file that needs to be included
+$language_file = 'help';
 
-	See the GNU General Public License for more details.
+require '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/Rule/HTML.php';
 
-	Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
-/**
-==============================================================================
-*	This	 script displays a help window with an overview of the allowed HTML-
-*   tags  and their attributes.
-*
-*	@package dokeos.help
-==============================================================================
-*/
-// name of the language file that needs to be included
-$language_file = 'help';
-include ('../inc/global.inc.php');
-require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
-require_once (api_get_path(LIBRARY_PATH).'formvalidator/Rule/HTML.php');
-$language_code = api_get_language_isocode($language_interface);
-header('Content-Type: text/html; charset='.$charset);
+header('Content-Type: text/html; charset='.api_get_system_encoding());
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language_code; ?>" lang="<?php echo $language_code; ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo api_get_language_isocode(); ?>" lang="<?php echo api_get_language_isocode(); ?>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
 <title>
 <?php echo get_lang('AllowedHTMLTags'); ?>
 </title>
 <style type="text/css" media="screen, projection">
 /*<![CDATA[*/
-@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/public_admin/default.css";
+@import "<?php echo api_get_path(WEB_CSS_PATH); ?>chamilo/default.css";
 /*]]>*/
 </style>
 <?php
-if(api_get_setting('stylesheets')<>'')
-{
-	?>
+if (api_get_setting('stylesheets') != '') {
+?>
 	<style type="text/css" media="screen, projection">
 	/*<![CDATA[*/
-	@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets');?>/default.css";
+	@import "<?php echo api_get_path(WEB_CSS_PATH), api_get_setting('stylesheets'); ?>/default.css";
 	/*]]>*/
 	</style>
-	<?php
+<?php
 }
 ?>
 </head>
-<body>
+<body dir="<?php echo api_get_text_direction(); ?>">
 <div style="margin:10px;">
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 <h4>
 <?php echo get_lang('AllowedHTMLTags'); ?>
 </h4>
 <?php
 $html_type = $_SESSION['status'] == COURSEMANAGER ? TEACHER_HTML : STUDENT_HTML;
 
-$fullpage = intval($_GET['fullpage']) == '0' ? false : true;
-$tags = HTML_QuickForm_Rule_HTML :: get_allowed_tags($html_type,$fullpage);
+$fullpage = intval($_GET['fullpage']) != 0;
+$tags = HTML_QuickForm_Rule_HTML :: get_allowed_tags($html_type, $fullpage);
 $table_header = array();
-$table_header[]= array('tag',true);
-$table_header[]= array('attributes',false);
-foreach ($tags as $tag => $attributes)
-{
+$table_header[] = array('tag', true);
+$table_header[] = array('attributes', false);
+foreach ($tags as $tag => & $attributes) {
 	$row = array();
 	$row[] = '<kbd>'.$tag.'</kbd>';
-	$row[] = '<kbd>&nbsp;'.implode(', ',array_keys($attributes)).'</kbd>';
+	$row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
 	$table_data[] = $row;
 }
-Display::display_sortable_table($table_header,$table_data,array(),array(),array('fullpage'=>intval($_GET['fullpage'])));
+Display::display_sortable_table($table_header, $table_data, array(), array(), array('fullpage' => intval($_GET['fullpage'])));
 ?>
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 </div>
 </body>
 </html>

+ 39 - 68
main/help/faq.php

@@ -1,117 +1,88 @@
 <?php
-/*
-==============================================================================
-	Dokeos - elearning and course management software
+/* For licensing terms, see /license.txt */
 
-	Copyright (c) 2004-2008 Dokeos SPRL
-	Copyright (c) 2003-2005 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-
-	Copyright (c) Sally "Example" Programmer (sally@somewhere.net)
+/**
+ *	This script displays a help window.
+ *
+ *	@package chamilo.help
+ */
 
-	For a full list of contributors, see "credits.txt".
-	The full license can be read in "license.txt".
+// Language file that needs to be included
+$language_file = 'help';
 
-	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.
+require '../inc/global.inc.php';
+include_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
 
-	See the GNU General Public License for more details.
+$help_name = Security::remove_XSS($_GET['open']);
 
-	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
-/**
-==============================================================================
-*	This script displays a help window.
-*
-*	@package dokeos.help
-==============================================================================
-*/
-// name of the language file that needs to be included
-$language_file='help';
-$helpName=$_GET['open'];
-include('../inc/global.inc.php');
-include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
-$language_code = api_get_language_isocode($language_interface);
-header('Content-Type: text/html; charset='. $charset);
+header('Content-Type: text/html; charset='. api_get_system_encoding());
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language_code; ?>" lang="<?php echo $language_code; ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo api_get_language_isocode(); ?>" lang="<?php echo api_get_language_isocode(); ?>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
 <title>
-<?php echo get_lang('H'.$helpName); ?>
+<?php echo get_lang('H'.$help_name); ?>
 </title>
 <style type="text/css" media="screen, projection">
 /*<![CDATA[*/
-@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/public_admin/default.css";
+@import "<?php echo api_get_path(WEB_CSS_PATH); ?>chamilo/default.css";
 /*]]>*/
 </style>
 <?php
-if(api_get_setting('stylesheets')<>'')
-{
-	?>
+if (api_get_setting('stylesheets') != '') {
+?>
 	<style type="text/css" media="screen, projection">
 	/*<![CDATA[*/
-	@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets');?>/default.css";
+	@import "<?php echo api_get_path(WEB_CSS_PATH), api_get_setting('stylesheets'); ?>/default.css";
 	/*]]>*/
 	</style>
-	<?php
+<?php
 }
 ?>
 </head>
-<body>
+<body dir="<?php echo api_get_text_direction(); ?>">
 <div style="margin:10px;">
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 <h4>
 <?php
 echo get_lang('Faq');
 
-
-if(api_is_platform_admin())
-{
+if (api_is_platform_admin()) {
 	echo '&nbsp;<a href="faq.php?edit=true"><img src="'.api_get_path(WEB_IMG_PATH).'edit.gif" /></a>';
 }
 ?>
 </h4>
 <?php
 $faq_file = 'faq.html';
-if(!empty($_GET['edit']) && $_GET['edit']=='true' && api_is_platform_admin())
-{
-	$form = new FormValidator('set_faq','post','faq.php?edit=true');
+if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin()) {
+	$form = new FormValidator('set_faq', 'post', 'faq.php?edit=true');
 	$form -> add_html_editor('faq_content', null, false, false, array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300'));
-	$form -> addElement('submit','faq_submit', get_lang('Ok'));
-	$form -> setDefaults(array('faq_content'=>file_get_contents(api_get_path(SYS_PATH).'home/faq.html')));
-	if($form -> validate())
-	{
+	$form -> addElement('submit', 'faq_submit', get_lang('Ok'));
+	$faq_content = @(string)file_get_contents(api_get_path(SYS_PATH).'home/faq.html');
+	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
+	$form -> setDefaults(array('faq_content' => $faq_content));
+	if ($form -> validate()) {
 		$content = $form -> getSubmitValue('faq_content');
 		$fpath = api_get_path(SYS_PATH).'home/'.$faq_file;
-		if(is_file($fpath) && is_writeable($fpath))
-		{
-			$fp = fopen(api_get_path(SYS_PATH).'home/'.$faq_file,'w');
+		if (is_file($fpath) && is_writeable($fpath)) {
+			$fp = fopen(api_get_path(SYS_PATH).'home/'.$faq_file, 'w');
 			fwrite($fp, $content);
 			fclose($fp);
-		}
-		else
-		{
+		} else {
 			echo get_lang('WarningFaqFileNonWriteable').'<br />';
 		}
 		echo $content;
-	}
-	else
-	{
+	} else {
 		$form -> display();
 	}
-}
-else
-{
-	echo file_get_contents(api_get_path(SYS_PATH).'home/'.$faq_file);
+} else {
+	$faq_content = @(string)file_get_contents(api_get_path(SYS_PATH).'home/'.$faq_file);
+	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
+	echo $faq_content;
 }
 ?>
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 </div>
 </body>
 </html>

+ 42 - 74
main/help/help.php

@@ -1,127 +1,95 @@
 <?php
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004-2005 Dokeos S.A.
-	Copyright (c) 2003-2005 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-
-	Copyright (c) Sally "Example" Programmer (sally@somewhere.net)
+/* For licensing terms, see /license.txt */
 
-	For a full list of contributors, see "credits.txt".
-	The full license can be read in "license.txt".
+/**
+ *	This script displays a help window.
+ *
+ *	@package dokeos.help
+ */
 
-	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.
+// Language file that needs to be included
+$language_file = 'help';
 
-	See the GNU General Public License for more details.
+require '../inc/global.inc.php';
 
-	Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
-/**
-==============================================================================
-*	This script displays a help window.
-*
-*	@package dokeos.help
-==============================================================================
-*/
-// name of the language file that needs to be included
-$language_file='help';
-$helpName=$_GET['open'];
-include('../inc/global.inc.php');
-$language_code = api_get_language_isocode($language_interface);
-header('Content-Type: text/html; charset='. $charset);
+$help_name = Security::remove_XSS($_GET['open']);
 
+header('Content-Type: text/html; charset='. api_get_system_encoding());
 
 /*
  * Choose CSS style platform's, user's, course's, or Learning path CSS
  */
 
 $platform_theme = api_get_setting('stylesheets'); 	// plataform's css
-$my_style=$platform_theme;
-if(api_get_setting('user_selected_theme') == 'true')
-{
+$my_style = $platform_theme;
+if (api_get_setting('user_selected_theme') == 'true') {
 	$useri = api_get_user_info();
 	$user_theme = $useri['theme'];
-	if(!empty($user_theme) && $user_theme != $my_style)
-	{
+	if (!empty($user_theme) && $user_theme != $my_style) {
 		$my_style = $user_theme;					// user's css
 	}
 }
 $mycourseid = api_get_course_id();
-if (!empty($mycourseid) && $mycourseid != -1)
-{
-	if (api_get_setting('allow_course_theme') == 'true')
-	{
-		$mycoursetheme=api_get_course_setting('course_theme');
-		if (!empty($mycoursetheme) && $mycoursetheme!=-1)
-		{
-			if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
-			{
-				$my_style = $mycoursetheme;		// course's css
+if (!empty($mycourseid) && $mycourseid != -1) {
+	if (api_get_setting('allow_course_theme') == 'true') {
+		$mycoursetheme = api_get_course_setting('course_theme');
+		if (!empty($mycoursetheme) && $mycoursetheme != -1) {
+			if(!empty($mycoursetheme) && $mycoursetheme != $my_style) {
+				$my_style = $mycoursetheme;			// course's css
 			}
 		}
 
-		$mycourselptheme=api_get_course_setting('allow_learning_path_theme');
-		if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1)
-		{
+		$mycourselptheme = api_get_course_setting('allow_learning_path_theme');
+		if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
 			global $lp_theme_css; //  it comes from the lp_controller.php
 			global $lp_theme_config; // it comes from the lp_controller.php
 
-			if (!empty($lp_theme_css))
-				{
-					$theme=$lp_theme_css;
-					if(!empty($theme) && $theme != $my_style)
-					{
-						$my_style = $theme;	 // LP's css
-					}
+			if (!empty($lp_theme_css)) {
+				$theme = $lp_theme_css;
+				if (!empty($theme) && $theme != $my_style) {
+					$my_style = $theme;	 // LP's css
 				}
+			}
 
 		}
 	}
 }
 
-if ($lp_theme_log){
-	$my_style=$platform_theme;
+if ($lp_theme_log) {
+	$my_style = $platform_theme;
 }
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language_code; ?>" lang="<?php echo $language_code; ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo api_get_language_isocode(); ?>" lang="<?php echo api_get_language_isocode(); ?>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
 <title>
-<?php echo get_lang('H'.$helpName); ?>
+<?php echo get_lang('H'.$help_name); ?>
 </title>
 <?php
-if(api_get_setting('stylesheets')<>'')
-{
-	?>
+if (api_get_setting('stylesheets') != '') {
+?>
 	<style type="text/css" media="screen, projection">
 	/*<![CDATA[*/
-	@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo $my_style;?>/default.css";
+	@import "<?php echo api_get_path(WEB_CSS_PATH), $my_style;?>/default.css";
 	/*]]>*/
 	</style>
-	<?php
+<?php
 }
 ?>
 </head>
-<body>
+<body dir="<?php echo api_get_text_direction(); ?>">
 <div style="margin:10px;">
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 <a href="faq.php"><?php echo get_lang('AccessToFaq') ?></a>
 <h4>
-<?php echo get_lang('H'.$helpName); ?>
+<?php echo get_lang('H'.$help_name); ?>
 </h4>
-<?php echo get_lang($helpName.'Content'); ?>
+<?php echo get_lang($help_name.'Content'); ?>
 <br /><br />
-<a href="faq.php"><?php echo get_lang('AccessToFaq') ?></a>
-<div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close'); ?></a></div>
+<a href="faq.php"><?php echo get_lang('AccessToFaq'); ?></a>
+<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
 </div>
 </body>
 </html>

+ 38 - 30
main/inc/lib/course_home.lib.php

@@ -55,14 +55,8 @@ class CourseHome {
 		$result = Database::query($sql);
 
 		// Grabbing all the tools from $course_tool_table
-		while ($row = Database::fetch_array($result)) {
-			if ($row['img'] != 'file_html.gif' && $row['img'] != 'file_html_na.gif'
-					&& $row['img'] != 'scormbuilder.gif' && $row['img'] != 'scormbuilder_na.gif'
-					&& $row['img'] != 'blog.gif' && $row['img'] != 'blog_na.gif'
-					&& $row['img'] != 'external.gif' && $row['img'] != 'external_na.gif') {
-				$row['name_translated'] = get_lang(ucfirst($row['name']));
-			}
-			$all_tools[] = $row;
+		while ($tool = Database::fetch_array($result)) {
+			$all_tools[] = $tool;
 		}
 
 		// Grabbing all the links that have the property on_homepage set to 1
@@ -102,12 +96,12 @@ class CourseHome {
 
 		foreach ($all_tools as & $tool) {
 			if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) {
-					continue;
+				continue;
 			}
 
 			$cell_content = '';
 			// The name of the tool
-			$tool_name = !empty($tool['name_translated']) ? $tool['name_translated'] : @htmlspecialchars($tool['name'], ENT_QUOTES, $charset); // RH: added htmlspecialchars
+			$tool_name = self::translate_tool_name($tool);
 
 			$link_annex = '';
 			// The url of the tool
@@ -309,21 +303,14 @@ class CourseHome {
 				echo '<td width="50%" height="30">';
 
 				if (strpos($tool['name'], 'visio_') !== false) {
-					echo '<a  '.$class.' href="javascript: void(0);" onclick="javascript: window.open(\'' . htmlspecialchars($tool['link']).(($tool['image']=="external.gif" || $tool['image']=="external_na.gif") ? '' : $qm_or_amp.api_get_cidreq()) . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $tool['target'] . '">';
+					echo '<a  '.$class.' href="javascript: void(0);" onclick="javascript: window.open(\'' . htmlspecialchars($tool['link']).(($tool['image'] == 'external.gif' || $tool['image'] == 'external_na.gif') ? '' : $qm_or_amp.api_get_cidreq()) . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $tool['target'] . '">';
 				} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
 					echo '<a href="javascript: void(0);" onclick="javascript: window.open(\'' . htmlspecialchars($tool['link']).$qm_or_amp.api_get_cidreq() . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $tool['target'] . '"'.$class.'>';
 				} else {
 					echo '<a href="'. htmlspecialchars($tool['link']).(($tool['image'] == 'external.gif' || $tool['image'] == 'external_na.gif') ? '' : $qm_or_amp.api_get_cidreq()).'" target="' , $tool['target'], '" '.$class.'>';
 				}
 
-				if ($tool['image'] == 'file_html.gif' || $tool['image'] == 'file_html_na.gif'
-						|| $tool['image'] == 'scormbuilder.gif' || $tool['image'] == 'scormbuilder_na.gif'
-						|| $tool['image'] == 'blog.gif' || $tool['image'] == 'blog_na.gif'
-						|| $tool['image'] == 'external.gif' || $tool['image'] == 'external_na.gif') {
-					$tool_name = @htmlspecialchars($tool['name'], ENT_QUOTES, $charset);
-				} else {
-					$tool_name = get_lang(ucfirst($tool['name']));
-				}
+				$tool_name = self::translate_tool_name($tool);
 				echo Display::return_icon($tool['image'], $tool_name),'&nbsp;', $tool_name,'</a>';
 
 				// This part displays the links to hide or remove a tool.
@@ -373,7 +360,7 @@ class CourseHome {
 					}
 				}
 				if (is_array($lnk)) {
-					foreach($lnk as $this_link) {
+					foreach ($lnk as & $this_link) {
 						if (!$tool['adminlink']) {
 							echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$tool['id'].'&amp;'.$this_link['cmd'].'">'.$this_link['name'].'</a>';
 						}
@@ -572,6 +559,7 @@ class CourseHome {
 		$course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
 		$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
 		$is_platform_admin = api_is_platform_admin();
+
 		$i = 0;
 		if (isset($all_tools_list)) {
 			$lnk = '';
@@ -669,16 +657,7 @@ class CourseHome {
 				}
 				echo $toollink;
 
-				if ($tool['image'] == 'file_html.gif' || $tool['image'] == 'file_html_na.gif'
-						|| $tool['image'] == 'scormbuilder.gif' || $tool['image'] == 'scormbuilder_na.gif'
-						|| $tool['image'] == 'blog.gif' || $tool['image'] == 'blog_na.gif'
-						|| $tool['image'] == 'external.gif' || $tool['image'] == 'external_na.gif') {
-					$tool_name = stripslashes($tool['name']);
-				} else {
-					$list = explode('_', $tool['name']);
-					foreach ($list as & $item) { $item = ucfirst($item); }
-					$tool_name = get_lang('Tool'.implode($list));
-				}
+				$tool_name = self::translate_tool_name($tool);
 				Display::display_icon($tool['image'], $tool_name, array('class' => 'tool-icon', 'id' => 'toolimage_'.$tool['id']));
 
 				// Validacion when belongs to a session
@@ -754,4 +733,33 @@ class CourseHome {
 		return $output;
 	}
 
+	/**
+	 * Retrieves the name-field within a tool-record and translates it on necessity.
+	 * @param array $tool		The input record.
+	 * @return string			Returns the name of the corresponding tool.
+	 */
+	public static function translate_tool_name(& $tool) {
+		static $already_translated_icons = array(
+			'file_html.gif', 'file_html_na.gif',
+			'scormbuilder.gif', 'scormbuilder_na.gif',
+			'blog.gif', 'blog_na.gif',
+			'external.gif', 'external_na.gif'
+		);
+
+		if (in_array($tool['image'], $already_translated_icons)) {
+			$tool_name = Security::remove_XSS(stripslashes($tool['name']));
+		} else {
+			$variable = 'Tool'.api_underscore_to_camel_case($tool['name']); // The newly opened language variables.
+			$variable_old = ucfirst($tool['name']);         // The old language variables as a second chance exist.
+			if (api_is_translated($variable)) {
+				$tool_name = get_lang($variable);
+			} elseif (api_is_translated($variable_old)) {
+				$tool_name = get_lang($variable_old);
+			} else {
+				$tool_name = get_lang($variable);
+			}
+		}
+
+		return $tool_name;
+	}
 }

+ 2 - 11
main/inc/lib/fckeditor/fckeditor.php

@@ -381,7 +381,7 @@ class FCKeditor
 			$toolbar_config[$this->ToolbarSet] = array();
 			if (preg_match('/[a-zA-Z_]+/', $toolbar_dir) && preg_match('/[a-zA-Z_]+/', $this->ToolbarSet)) { // A security check.
 				// Seeking the toolbar.
-				@include api_get_path(LIBRARY_PATH).'fckeditor/toolbars/'.$toolbar_dir.'/'.self::camel_case_to_underscore($this->ToolbarSet).'.php';
+				@include api_get_path(LIBRARY_PATH).'fckeditor/toolbars/'.$toolbar_dir.'/'.api_camel_case_to_underscore($this->ToolbarSet).'.php';
 				if (!isset($config['ToolbarSets']['Normal'])) {
 					// No toolbar has been found yet.
 					if ($toolbar_dir == 'default') {
@@ -389,7 +389,7 @@ class FCKeditor
 						$this->ToolbarSet = 'Default';
 					} else {
 						// The custom toolbar does not exist, then trying to load the default one.
-						@include api_get_path(LIBRARY_PATH).'fckeditor/toolbars/default/'.self::camel_case_to_underscore($this->ToolbarSet).'.php';
+						@include api_get_path(LIBRARY_PATH).'fckeditor/toolbars/default/'.api_camel_case_to_underscore($this->ToolbarSet).'.php';
 						if (!isset($config['ToolbarSets']['Normal'])) {
 							// It does not exist in default toolbar definitions, giving up.
 							$this->ToolbarSet = 'Default';
@@ -664,13 +664,4 @@ class FCKeditor
 		@fclose($fp);
 		return $file_exists;
 	}
-
-	/*
-	 * Convers a string from camel case to underscore.
-	 * @param string $string
-	 * @return string
-	 */
-	private function camel_case_to_underscore($string) {
-		return strtolower(preg_replace('/([a-z])([A-Z])/', "$1_$2", $string));
-	}
 }

+ 101 - 81
main/inc/lib/internationalization.lib.php

@@ -16,6 +16,10 @@
  * Constants
  */
 
+// Special tags for marking untranslated variables.
+define('SPECIAL_OPENING_TAG', '[=');
+define('SPECIAL_CLOSING_TAG', '=]');
+
 // Predefined date formats in Chamilo provided by the language sub-system.
 // To be used as a parameter for the function api_format_date().
 define('TIME_NO_SEC_FORMAT', 0);	// 15:23
@@ -84,54 +88,57 @@ function api_set_internationalization_default_encoding($encoding) {
  * Language support
  */
 
+// These variables are for internal purposes only, they serve the function api_is_translated().
+$_api_is_translated = false;
+$_api_is_translated_call = false;
+
 /**
  * Returns a translated (localized) string, called by its identificator.
- * @param string $variable		This is the identificator (name) of the translated string to be retrieved.
- * @param string $notrans		This parameter directs whether a link to DLTT to be shown for untranslated strings
- * 								($notrans = 'DLTT' means "yes", any other value means "no").
+ * @param string $variable				This is the identificator (name) of the translated string to be retrieved.
+ * @param string $reserved				This parameter has been reserved for future use.
  * @param string $language (optional)	Language indentificator. If it is omited, the current interface language is assumed.
- * @return string				Returns the requested string in the correspondent language.
+ * @return string						Returns the requested string in the correspondent language.
  *
  * @author Roan Embrechts
  * @author Patrick Cool
- * @author Ivan Tcholakov, April-September 2009 (caching functionality, additional parameter $language).
+ * @author Ivan Tcholakov, 2009-2010 (caching functionality, additional parameter $language, other adaptations).
  *
  * Notes:
  * 1. If the name of a given language variable has the prefix "lang" it may be omited, i.e. get_lang('langYes') == get_lang('Yes').
- * 2. When server type in Chamilo config settings is set as test (development) server and $notrans = 'DLTT', untranslated variables
- * are shown as links to DLTT where translations may be proposed.
- * 3. Additionally, untranslated variables might be indicated by special opening and closing tags  -  [=  =]
- * They do not show up in these two cases (for both production and test server modes):
- * - when the special setting 'hide_dltt_markup' is set so;
- * - when showing the DLTT link (on untranslated variable) is intentionaly suppressed by a developer, using the input parameter
- * $notrans, i.e. when the function is called in this way: get_lang('MyText', '')
- * 4. Translations are created by using a special tool: Chamilo Translation Application.
+ * 2. Untranslated variables might be indicated by special opening and closing tags  -  [=  =]
+ * The special tags do not show up in these two cases:
+ * - when the system has been switched to "production server mode";
+ * - when a special platform setting 'hide_dltt_markup' is set to "true" (the name of this setting comes from history);
+ * 3. Translations are created many contributors through using a special tool: Chamilo Translation Application.
  * @link http://translate.chamilo.org/
- * 5. DLTT means Dokeos Language Translation Tool - it was previously used.
- * @link http://www.dokeos.com/DLTT/
  */
-function get_lang($variable, $notrans = 'DLTT', $language = null) {
-
-	// We introduced the possibility to request specific language by the aditional parameter $language to this function.
-
-	// By manipulating this global variable the translation may be done in different languages too (not the elegant way).
-	global $language_interface;
+function get_lang($variable, $reserved = null, $language = null) {
 
-	// Because of possibility for manipulations of the global variable $language_interface, we need its initial value.
-	global $language_interface_initial_value;
+	global
+		// For serving some old hacks:
+		// By manipulating this global variable the translation may be done in different languages too (not the elegant way).
+		$language_interface,
+		// Because of possibility for manipulations of the global variable $language_interface, we need its initial value.
+		$language_interface_initial_value,
+		// For serving the function is_translated()
+		$_api_is_translated, $_api_is_translated_call;
 
 	// Caching results from some API functions, for speed.
-	static $langpath;
+	static $encoding, $is_utf8_encoding, $langpath, $test_server_mode, $show_special_markup;
+	if (!isset($is_utf8_encoding)) {
+		$encoding = api_get_system_encoding();
+	}
+	if (!isset($is_utf8_encoding)) {
+		$is_utf8_encoding = api_is_utf8($encoding);
+	}
 	if (!isset($langpath)) {
 		$langpath = api_get_path(SYS_LANG_PATH);
 	}
-	static $test_server_mode;
 	if (!isset($test_server_mode)) {
 		$test_server_mode = api_get_setting('server_type') == 'test';
 	}
-	static $hide_dltt_markup;
-	if (!isset($hide_dltt_markup)) {
-		$hide_dltt_markup = api_get_setting('hide_dltt_markup') == 'true';
+	if (!isset($show_special_markup)) {
+		$show_special_markup = api_get_setting('hide_dltt_markup') != 'true' || $test_server_mode;
 	}
 
 	// Combining both ways for requesting specific language.
@@ -140,22 +147,21 @@ function get_lang($variable, $notrans = 'DLTT', $language = null) {
 	}
 	$is_interface_language = $language == $language_interface_initial_value;
 
-	// This is a flag for showing the link to the DLTT when the requested variable has no translation within the language files.
-	$dltt = $notrans == 'DLTT' && $is_interface_language;
-
 	// This is a cache for already translated language variables. By using it, we avoid repetitive translations, gaining speed.
 	static $cache;
 
 	// Looking up into the cache for existing translation.
-	if (isset($cache[$language][$dltt][$variable])) {
+	if (isset($cache[$language][$variable]) && !$_api_is_translated_call) {
 		// There is a previously saved translation, returning it.
-		return $cache[$language][$dltt][$variable];
+		return $cache[$language][$variable];
 	}
 
+	$_api_is_translated = false;
+
 	// There is no cached translation, we have to retrieve it:
 	// - from a global variable (the faster way) - on production server mode;
 	// - from a local variable after reloading the language files - on test server mode or when requested language is different than the genuine interface language.
-	$read_global_variables = $is_interface_language && !$test_server_mode;
+	$read_global_variables = $is_interface_language && !$test_server_mode && !$_api_is_translated_call;
 
 	// Reloading the language files when it is necessary.
 	if (!$read_global_variables) {
@@ -171,52 +177,66 @@ function get_lang($variable, $notrans = 'DLTT', $language = null) {
 		}
 	}
 
-	// Opening and closing tags for missing variables.
-	if ($hide_dltt_markup || !$dltt) {
-		$ot = ''; $ct = '';
-	} else {
-		$ot = '[='; $ct = '=]';
-	}
-
 	// Translation mode for production servers.
 	if (!$test_server_mode) {
 		if ($read_global_variables) {
-			$langvar = isset($GLOBALS[$variable]) ? $GLOBALS[$variable] : (isset($GLOBALS["lang$variable"]) ? $GLOBALS["lang$variable"] : $ot.$variable.$ct);
+			if (isset($GLOBALS[$variable])) {
+				$langvar = $GLOBALS[$variable];
+				$_api_is_translated = true;
+			} elseif (isset($GLOBALS["lang$variable"])) {
+				$langvar = $GLOBALS["lang$variable"];
+				$_api_is_translated = true;
+			} else {
+				$langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable;
+			}
 		} else {
-			/*
-			@eval("\$langvar=\$$variable;"); // Note (RH): $$var doesn't work with arrays, see PHP doc
-			if (!isset($langvar)) {
-				@eval("\$langvar=\$lang$variable;");
-				if (!isset($langvar)) {
-					$langvar = $ot.$variable.$ct;
-				}
+			if (isset($$variable)) {
+				$langvar = $$variable;
+				$_api_is_translated = true;
+			} elseif (isset(${"lang$variable"})) {
+				$langvar = ${"lang$variable"};
+				$_api_is_translated = true;
+			} else {
+				$langvar = $show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable;
 			}
-			*/
-			$langvar = isset($$variable) ? $$variable : (isset(${"lang$variable"}) ? ${"lang$variable"} : $ot.$variable.$ct);
 		}
-		return $cache[$language][$dltt][$variable] = is_string($langvar) ? _get_lang_purifier(str_replace("\\'", "'", $langvar), $language) : $langvar;
+		if (empty($langvar) || !is_string($langvar)) {
+			$_api_is_translated = false;
+		}
+		return $cache[$language][$variable] = $_api_is_translated ? ($is_utf8_encoding ? $langvar : api_utf8_decode($langvar, $encoding)) : $langvar;
 	}
 
 	// Translation mode for test/development servers.
 	if (!is_string($variable)) {
-		return $cache[$language][$dltt][$variable] = $ot.'get_lang(?)'.$ct;
+		return $cache[$language][$variable] = SPECIAL_OPENING_TAG.'get_lang(?)'.SPECIAL_CLOSING_TAG;
+	}
+	if (isset($$variable)) {
+		$langvar = $$variable;
+		$_api_is_translated = true;
+	} elseif (isset(${"lang$variable"})) {
+		$langvar = ${"lang$variable"};
+		$_api_is_translated = true;
 	}
-	/*
-	@eval("\$langvar=\$$variable;"); // Note (RH): $$var doesn't work with arrays, see PHP doc
-	if (!isset($langvar)) {
-		@eval("\$langvar=\$lang$variable;");
+	if (empty($langvar) || !is_string($langvar)) {
+		$_api_is_translated = false;
 	}
-	*/
-	$langvar = isset($$variable) ? $$variable : ${"lang$variable"};
-	// TODO: Ivan, 12-FEB-2010: These generated links (translation suggestions) to the Dokeos' site have to be corrected, I don't know how.
-	return $cache[$language][$dltt][$variable] =
-		isset($langvar) && is_string($langvar) && !empty($langvar)
-			? _get_lang_purifier(str_replace("\\'", "'", $langvar), $language)
-			: (!$dltt
-				? $ot.$variable.$ct
-				: $ot.$variable.$ct."<a href=\"http://www.dokeos.com/DLTT/suggestion.php?file=".
-					(!is_array($language_files) ? $language_files : implode('.inc.php', $language_files)).".inc.php&amp;variable=$".
-					$variable."&amp;language=".$language."\" target=\"_blank\" style=\"color:#FF0000\"><strong>#</strong></a>");
+	return $cache[$language][$variable] =
+		$_api_is_translated ? ($is_utf8_encoding ? $langvar : api_utf8_decode($langvar, $encoding)) : ($show_special_markup ? SPECIAL_OPENING_TAG.$variable.SPECIAL_CLOSING_TAG : $variable);
+}
+
+/**
+ * Checks whether exists a translated (localized) string.
+ * @param string $variable				This is the identificator (name) of the translated string to be checked.
+ * @param string $language (optional)	Language indentificator. If it is omited, the current interface language is assumed.
+ * @return bool							Returns TRUE if translation exists, FALSE otherwise.
+ * @author Ivan Tcholakov, 2010.
+ */
+function api_is_translated($variable, $language = null) {
+	global $_api_is_translated, $_api_is_translated_call;
+	$_api_is_translated_call = true;
+	get_lang($variable, $language);
+	$_api_is_translated_call = false;
+	return $_api_is_translated;
 }
 
 /**
@@ -495,11 +515,11 @@ function api_get_local_time($time = null, $to_timezone=null, $from_timezone=null
 
 /**
  * Converts a string into a timestamp safely (handling timezones), using strtotime
- * 
+ *
  * @param string String to be converted
  * @param string Timezone (if null, the timezone will be determined based on user preference, or timezone chosen by the admin for the platform)
  * @return int Timestamp
- * 
+ *
  * @author Guillaume Viguier <guillaume.viguier@beeznest.com>
  */
 function api_strtotime($time, $timezone = null) {
@@ -513,33 +533,33 @@ function api_strtotime($time, $timezone = null) {
 /**
  * Returns formated date/time, correspondent to a given language.
  * The given date should be in the timezone chosen by the administrator and/or user. Use api_get_local_time to get it.
- * 
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  * @author Christophe Gesche<gesche@ipm.ucl.ac.be>
  *         originally inspired from from PhpMyAdmin
  * @author Ivan Tcholakov, 2009, code refactoring, adding support for predefined date/time formats.
  * @author Guillaume Viguier <guillaume.viguier@beeznest.com>
- * 
+ *
  * @param mixed Timestamp or datetime string
  * @param mixed Date format (string or int; see date formats in the Chamilo system: TIME_NO_SEC_FORMAT, DATE_FORMAT_SHORT, DATE_FORMAT_LONG, DATE_TIME_FORMAT_LONG)
  * @param string $language (optional)		Language indentificator. If it is omited, the current interface language is assumed.
  * @return string							Returns the formatted date.
- * 
+ *
  * @link http://php.net/manual/en/function.strftime.php
  */
 function api_format_date($time, $format = null, $language = null) {
-	
+
 	$system_timezone = date_default_timezone_get();
 	date_default_timezone_set(_api_get_timezone());
-	
+
 	if (is_string($time)) {
 		$time = strtotime($time);
 	}
-	
+
 	if (is_null($format)) {
 		$format = DATE_TIME_FORMAT_LONG;
 	}
-	
+
 	$datetype = null;
 	$timetype = null;
 	if(is_int($format)) {
@@ -580,7 +600,7 @@ function api_format_date($time, $format = null, $language = null) {
 				}
 		}
 	}
-	
+
 	if (IS_PHP_53 && INTL_INSTALLED && $datetype !== null && $timetype !== null) {
 		// Use ICU
 		if (is_null($language)) {
@@ -621,7 +641,7 @@ function date_to_str_ago($date) {
 	static $min_decade, $min_year, $min_month, $min_week, $min_day, $min_hour, $min_minute;
 	static $min_decades, $min_years, $min_months, $min_weeks, $min_days, $min_hours, $min_minutes;
 	static $sec_time_time, $sec_time_sing, $sec_time_plu;
-	
+
 	$system_timezone = date_default_timezone_get();
 	date_default_timezone_set(_api_get_timezone());
 
@@ -726,7 +746,7 @@ function date_to_str_ago($date) {
 	} else {
 		$str = $str_result[0];
 	}
-	
+
 	date_default_timezone_set($system_timezone);
 	return $str;
 }
@@ -737,7 +757,7 @@ function date_to_str_ago($date) {
  * @param mixed Format to be used
  * @param string Timezone to be converted from. If null, UTC will be assumed.
  * @return string Converted and localized date
- * 
+ *
  * @author Guillaume Viguier <guillaume.viguier@beeznest.com>
  */
 function api_convert_and_format_date($time = null, $format = null, $from_timezone = null) {

+ 0 - 26
main/inc/lib/internationalization_internal.lib.php

@@ -37,32 +37,6 @@ $_api_collator = null;
  * Appendix to "Language support"
  */
 
-/**
- * Upgrades the function get_lang() with the following logic:
- * 1. Checks whether the retrieved human language string is UTF-8 valid or not.
- * 2. If the system encoding is UTF-8 and the string is not UTF-8, the function
- * performs conversion from supposed non UTF-8 encodeng.
- * 3. If the system encoding is non UTF-8 but the string is valid UTF-8, then
- * conversion from UTF-8 is performed.
- * 4. At the end the string is purified from HTML entities.
- * @param string $string	This is the retrieved human language string.
- * @param string $language	A language identiticator.
- * @return string			Returns the human language string, checked for proper encoding and purified.
- */
-function & _get_lang_purifier(& $string, & $language) {
-	$system_encoding = api_get_system_encoding();
-	if (api_is_utf8($system_encoding)) {
-		if (!api_is_valid_utf8($string)) {
-			$string = api_utf8_encode($string, api_get_non_utf8_encoding($language));
-		}
-	} else {
-		if (api_is_valid_utf8($string)) {
-			$string = api_utf8_decode($string, $system_encoding);
-		}
-	}
-	return api_html_entity_decode($string, ENT_QUOTES, $system_encoding);
-}
-
 /**
  * This function returns an array of those languages that can use Latin 1 encoding.
  * @return array	The array of languages that can use Latin 1 encoding (ISO-8859-15, ISO-8859-1, WINDOWS-1252, ...).

+ 33 - 3
main/inc/lib/text.lib.php

@@ -2,14 +2,44 @@
 /* For licensing terms, see /license.txt */
 
 /**
- *	This is the text library for Chamilo.
- *	Include/require it in your code to use its functionality.
+ * This is the text library for Chamilo.
+ * It is loaded during the global initialization,
+ * so the functions below are available everywhere.
  *
- *	@package chamilo.library
+ * @package chamilo.library
  */
 
 /*	FUNCTIONS */
 
+/**
+ * Convers a string from camel case into underscore.
+ * Works correctly with ASCII strings only, implementation for human-language strings is not necessary.
+ * @param string $string							The input string (ASCII)
+ * @return string									The converted result string
+ */
+function api_camel_case_to_underscore($string) {
+	return strtolower(preg_replace('/([a-z])([A-Z])/', "$1_$2", $string));
+}
+
+/**
+ * Converts a string with underscores into camel case.
+ * Works correctly with ASCII strings only, implementation for human-language strings is not necessary.
+ * @param string $string							The input string (ASCII)
+ * @param bool $capitalise_first_char (optional)	If true (default), the function capitalises the first char in the result string.
+ * @return string									The converted result string
+ */
+function api_underscore_to_camel_case($string, $capitalise_first_char = true) {
+	if ($capitalise_first_char) {
+		$string = ucfirst($string);
+	}
+	return preg_replace_callback('/_([a-z])/', '_api_camelize', $string);
+}
+
+// A function for internal use, only for this library.
+function _api_camelize($match) {
+	return strtoupper($match[1]);
+}
+
 /**
  * Truncates a string.
  *

+ 4 - 14
main/inc/tool_navigation_menu.inc.php

@@ -6,6 +6,7 @@
  *
  *	@package dokeos.include
  */
+require_once api_get_path(LIBRARY_PATH).'course_home.lib.php'; // For using the method CourseHome::translate_tool_name();
 
 define('SHORTCUTS_HORIZONTAL', 0);
 define('SHORTCUTS_VERTICAL', 1);
@@ -30,7 +31,7 @@ function get_navigation_items($include_admin_tools = false) {
 
 		$user_id = api_get_user_id();
 
-		$course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST,$database);
+		$course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST, $database);
 
 		/*	Link to the Course homepage */
 
@@ -44,17 +45,9 @@ function get_navigation_items($include_admin_tools = false) {
 		$sql_result = Database::query($sql_menu_query);
 		while ($row = Database::fetch_array($sql_result)) {
 			$navigation_items[$row['id']] = $row;
-			/*
-			if (!stristr($row['link'], 'http://'))
-			*/
 			if (stripos($row['link'], 'http://') === false && stripos($row['link'], 'https://') === false) {
 				$navigation_items[$row['id']]['link'] = api_get_path(REL_CODE_PATH).$row['link'];
-				/*
-				$navigation_items[$row['id']]['name'] = $row['image'] == 'scormbuilder.gif' ? $navigation_items[$row['id']]['name'] : get_lang(ucfirst($navigation_items[$row['id']]['name']));
-				*/
-				if ($row['image'] != 'scormbuilder.gif' && $row['image'] != 'blog.gif') {
-					$navigation_items[$row['id']]['name'] = get_lang(ucfirst($navigation_items[$row['id']]['name']));
-				}
+				$navigation_items[$row['id']]['name'] = CourseHome::translate_tool_name($row);
 			}
 		}
 
@@ -67,7 +60,7 @@ function get_navigation_items($include_admin_tools = false) {
 									WHERE link='course_info/infocours.php'";
 			$sql_result = Database::query($course_settings_sql);
 			$course_setting_info = Database::fetch_array($sql_result);
-			$course_setting_visual_name = get_lang(api_ucfirst($course_setting_info['name']));
+			$course_setting_visual_name = CourseHome::translate_tool_name($course_setting_info);
 			if (api_get_session_id() == 0) {
 				// course settings item
 				$navigation_items['course_settings']['image'] = $course_setting_info['image'];
@@ -212,9 +205,6 @@ function show_navigation_tool_shortcuts($orientation = SHORTCUTS_HORIZONTAL) {
 	$navigation_items = get_navigation_items(false);
 	foreach ($navigation_items as $key => $navigation_item) {
 		if (strpos($navigation_item['link'],'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
-	    	/*
-		  	echo '<a href="#" onclick="window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"';
-		  	*/
 		  	echo '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"';
 	    } else {
 		  	echo '<a href="'.$navigation_item['link'].'"';

+ 3 - 0
main/lang/bulgarian/course_info.inc.php

@@ -113,4 +113,7 @@ $NewUserEmailAlert = "Известяване на инструктора по e-
 $NewUserEmailAlertEnable = "Да се уведомява с e-mail преподавателя, когато потребител се регистрира самостоятелно в курса";
 $NewUserEmailAlertToTeacharAndTutor = "Да се уведомяват с e-mail преподавателите и инструкторите, когато потребител се регистрира самостоятелно в курса";
 $NewUserEmailAlertDisable = "Изключване на уведомяването с e-mail на новозаписаните курсисти";
+$AllowUserViewUserList = "Разрешанаве на курситите да виждат списъка с потребителите";
+$AllowUserViewUserListActivate = "Разрешаване";
+$AllowUserViewUserListDeactivate = "Забрана";
 ?>

+ 15 - 0
main/lang/bulgarian/exercice.inc.php

@@ -348,5 +348,20 @@ $QuestionTypeDoesNotBelongToFeedbackTypeInExercise = "Типът въпрос н
 $SessionIsReadOnly = "Сесията е само за четене.";
 $EnableTimerControl = "Включване на таймер";
 $ExerciseTotalDurationInMinutes = "Продължителност на целия тест в минути";
+$ToContinueUseMenu = "За продължение използвайте страничното меню.";
 $RandomAnswers = "Случаен ред на предложените отговори";
+$NotMarkActivity = "Тази дейност не може да бъде оценена.";
+$YouHaveToCreateAtLeastOneAnswer = "Трябва да създадете поне един отговор.";
+$ExerciseAttempted = "Тестът е пробван.";
+$MultipleSelectCombination = "Същата избрана комбинация";
+$MultipleAnswerCombination = "Същата комбинация от отговори";
+$ExerciceExpiredTimeMessage = "Времевият лимит на теста е надхвърлен.";
+$EditingExerciseCauseProblemsInLP = "Редактирането на теста може да доведе до проблеми в пътеката за обучение.";
+$AreYouSureToCopy = "Сигурни ли сте, че искате да копирате";
+$ExerciseCopied = "Тестът е копиран.";
+$AreYouSureToDeleteResults = "Сигурни ли сте, че искате да изтриете резултатите?";
+$XResultsCleaned = "%d резултата са изтрити.";
+$CopyExercise = "Копиране на теста в нов";
+$CleanStudentResults = "Изтриване на всички резултати на курсистите за теста";
+$ImportQtiQuiz = "Qti2 импорт на тестове.";
 ?>

+ 78 - 2
main/lang/bulgarian/trad4all.inc.php

@@ -6,7 +6,7 @@ $Title = "Заглавие";
 $By = "От";
 $UsersOnline = "Посетители";
 $Remove = "Премахване";
-$langEnter = "<< Обратно към списъка с курсовете";
+$langEnter = "Обратно към списъка с курсовете";
 $Description = "Описание";
 $Links = "Връзки";
 $langWorks = "Задачи";
@@ -38,6 +38,7 @@ $langUniqueSelect = "Само един верен отговор";
 $CreateCategory = "Създаване на категория";
 $SendFile = "Качване на документа";
 $SaveChanges = "Запис на промените";
+$SearchTerm = "Израз за търсене";
 $langCourseCreate = "Създаване на нов курс";
 $langTodo = "Предложения";
 $UserName = "Потребителско име";
@@ -82,6 +83,7 @@ $AddNewQuestionType = "Добавяне на нов тип въпрос";
 $Numbered = "Номериран";
 $iso639_2_code = "bg";
 $iso639_1_code = "bg";
+$charset = "windows-1251";
 $text_dir = "ltr";
 $left_font_family = "verdana, helvetica, arial, geneva, sans-serif";
 $right_font_family = "helvetica, arial, geneva, sans-serif";
@@ -143,6 +145,26 @@ $AddedResources = "Прикрепени ресурси";
 $lang_modify_resource = "Промяна/добавяне на ресурс";
 $lang_resource = "Ресурс";
 $lang_resources = "Ресурси";
+$langNameOfLang['arabic'] = "арабски";
+$langNameOfLang['brazilian'] = "бразилски португалски";
+$langNameOfLang['bulgarian'] = "български";
+$langNameOfLang['catalan'] = "каталонски";
+$langNameOfLang['croatian'] = "хърватски";
+$langNameOfLang['danish'] = "датски";
+$langNameOfLang['dutch'] = "холандски";
+$langNameOfLang['english'] = "английски";
+$langNameOfLang['finnish'] = "финландски";
+$langNameOfLang['french'] = "френски";
+$langNameOfLang['galician'] = "галицийски";
+$langNameOfLang['german'] = "немски";
+$langNameOfLang['greek'] = "гръцки";
+$langNameOfLang['italian'] = "италиански";
+$langNameOfLang['japanese'] = "японски";
+$langNameOfLang['polish'] = "полски";
+$langNameOfLang['portuguese'] = "португалски";
+$langNameOfLang['russian'] = "руски";
+$langNameOfLang['simpl_chinese'] = "китайски";
+$langNameOfLang['spanish'] = "испански";
 $Close = "Затваряне";
 $langPlatform = "Система";
 $localLangName = "български";
@@ -165,6 +187,14 @@ $WithSelected = "С маркираните";
 $langOnLine = "Посетители";
 $langUsers = "Потребители";
 $langPlatformAdmin = "Администриране";
+$langNameOfLang['hungarian'] = "унгарски";
+$langNameOfLang['indonesian'] = "индонезийски";
+$langNameOfLang['malay'] = "малайски";
+$langNameOfLang['slovenian'] = "словенски";
+$langNameOfLang['swedish'] = "шведски";
+$langNameOfLang['thai'] = "тайландски";
+$langNameOfLang['turkce'] = "турски";
+$langNameOfLang['vietnamese'] = "виетнамски";
 $UserInfo = "потребителска информация";
 $langModifyQuestion = "Промяна на въпроса";
 $langNameOfLang = "Наименование на езика";
@@ -177,7 +207,7 @@ $PlataformAdmin = "Администратор на системата";
 $Groups = "Групи";
 $GroupManagement = "Управление на групите";
 $All = "Всички";
-$None = "Никои";
+$None = "Няма";
 $langSorry = "Първо изберете курс.";
 $langDenied = "Това действие е позволено само за преподаватели.";
 $Today = "днес";
@@ -592,7 +622,9 @@ $SessionNameAndCourseTitle = "Име на сесия и име на курс";
 $CreationDate = "Дата на създаване";
 $LastUpdateDate = "Последна промяна";
 $ViewHistoryChange = "Преглед на историята на промените";
+$langNameOfLang['asturian'] = "астурийски";
 $SearchGoToLearningPath = "Към пътеката за обучение";
+$SearchLectureLibrary = "Библиотека с материали";
 $SearchImagePreview = "Изображение за преглед";
 $SearchAdvancedOptions = "Опции за разширено търсене";
 $SearchResetKeywords = "Изчистване на ключовите думи";
@@ -608,6 +640,7 @@ $OrderBy = "Сортиране по";
 $Notebook = "Бележки";
 $FieldRequired = "Задължителни полета";
 $BookingSystem = "Система за резервации";
+$Any = "Всеки";
 $SpecificSearchFields = "Допълнително поле за търсене";
 $AddSpecificSearchField = "Добавяне на допълнително поле за търсене";
 $SaveSettings = "Запис на настройките";
@@ -666,19 +699,62 @@ $GraphicNotAvailable = "Няма изображение";
 $BackTo = "Обратно към";
 $HistoryTrainingSessions = "История на обучителните сесии";
 $ConversionFailled = "Конвертирането не е успешно.";
+$AlreadyExists = "Вече съществува.";
 $TheNewWordHasBeenAdded = "Новата дума е добавена.";
 $EventType = "Вид на събитието";
 $DataType = "Тип на данните";
 $Value = "Сойност";
 $System = "Система";
 $ImportantActivities = "Важни дейности";
+$Parent = "Родител";
 $SurveyAdded = "Добавена е анкета.";
 $WikiAdded = "Добавено е Wiki.";
 $ReadOnly = "Само за четене";
+$Unacceptable = "Не се приема";
 $HistoryTrainingSession = "История на обучителната сесия";
 $FirstPage = "Първа страница";
 $LastPage = "Последна страница";
 $Coachs = "Инструктори";
+$langNameOfLang['bosnian'] = "босненски";
+$langNameOfLang['czech'] = "чешки";
+$langNameOfLang['dari'] = "дари";
+$langNameOfLang['friulian'] = "фурлан";
+$langNameOfLang['georgian'] = "грузински";
+$langNameOfLang['korean'] = "корейски";
+$langNameOfLang['latvian'] = "латвийски";
+$langNameOfLang['lithuanian'] = "литовски";
+$langNameOfLang['macedonian'] = "македонски";
+$langNameOfLang['norwegian'] = "норвежки";
+$langNameOfLang['pashto'] = "пущунски";
+$langNameOfLang['persian'] = "фарси";
+$langNameOfLang['quechua_cusco'] = "кечуа";
+$langNameOfLang['romanian'] = "румънски";
+$langNameOfLang['serbian'] = "сръбски";
+$langNameOfLang['slovak'] = "словашки";
+$langNameOfLang['swahili'] = "суахили";
+$langNameOfLang['trad_chinese'] = "традиционен китайски";
+$ChamiloInstallation = "Инсталиране на Chamilo";
+$langNameOfLang['ukrainian'] = "украински";
+$langNameOfLang['yoruba'] = "йоруба";
+$New = "Нов";
+$YouMustToInstallTheExtensionLDAP = "Разширението LDAP трябва да бъде инсталирано.";
+$InvitationDenied = "Поканата е отказана.";
+$UserAdded = "Добавен е потребител.";
+$Metadata = "Метаданни";
+$langAddMetadata = "Преглед / редактиране на метаданните";
+$SendMessage = "Изпращане на съобщение";
+$NoDataAvailable = "Няма данни.";
+$EditMyProfile = "Редактиране на профила";
+$Announcements = "Обяви";
+$Password = "Парола";
+$DescriptionGroup = "Описание на групата";
+$Installation = "Инсталиране";
+$ReadTheInstallationGuide = "Прочетете ръководството за инсталиране.";
+$InstallChamilo = "Инсталиране на Chamilo";
 $TitleColumnGradebook = "Име на колоната в отчета за оценяване";
 $QualifyWeight = "Тегло на оценката";
+$EditProfile = "Редактиране на профила";
+$Timezone = "Времева зона";
+$LoginEnter = "Добре (Ok)";
+$AditionalNotes = "Бележки";
 ?>

+ 10 - 0
main/lang/english/trad4all.inc.php

@@ -845,4 +845,14 @@ $ToolCourseMaintenance = "Backup";
 $AreYouSureToDeleteAllDates = "Are you sure you want to delete all dates?";
 $AddADateTime = "Add a date time";
 $DeleteAllAttendances = "Delete all created attendances";
+$ThematicControl = "Thematic control";
+$ThematicDetails = "Thematic view with details";
+$ThematicList = "Thematic view as list";
+$Thematic = "Thematic";
+$ThematicPlan = "Thematic plan";
+$EditThematicPlan = "Edit tematic advance";
+$ThereIsNoStillAthematicSection = "There is not still a thematic section";
+$NewThematicSection = "New thematic section";
+$DeleteAllThematics = "Delete all thematics";
+$EditTematicAdvance = "Edit tematic advance";
 ?>

+ 0 - 1
main/lang/french/tracking.inc.php

@@ -250,7 +250,6 @@ $DashboardList = "Liste du panneau de contrôle";
 $YouHaveNotEnabledBlocks = "Vous n'avez activé aucun bloc";
 $BlocksHaveBeenUpdatedSuccessfully = "Les blocs ont été mis à jour";
 $AssignSessionsTo = "Assigner des sessions à %s";
-$DeleteAllAttendances = "Supprimer toutes les assistances créées";
 $AttendanceSheetDescription = "Les répertoires de présences vous permettent de réunir les feuilles de présences par groupe. Par exemple, vous pourriez vouloir prendre les présence pour les cours théoriques séparément des cours pratiques.
 Chaque élément montrera tous les apprenants comme présents par défaut. C'est à vous de noter leur absence en décochant les cases correspondantes.";
 $AttendanceSheetReport = "Rapport de présences";

+ 12 - 0
main/lang/galician/admin.inc.php

@@ -1168,4 +1168,16 @@ $Section = "Sección";
 $Expected = "Esperado";
 $Setting = "Parámetro";
 $Current = "Actual";
+$SessionGCMaxLifetimeInfo = "O tempo máximo de vida do recolector de lixo é o tempo máximo que se da entre dúas execucións do recolector de lixo";
+$PHPVersionInfo = "Versión PHP";
+$FileUploadsInfo = "A carga de arquivos indica se a subida de arquivos está autorizada";
+$UploadMaxFilesizeInfo = "Tamaño máximo dun arquivo cando se sube. Este axuste debe, na maioría dos casos, ir acompañado da variable post_max_size";
+$MagicQuotesRuntimeInfo = "Esta é unha característica non recomendada que convirte os valores devoltos por todas as funcións que devolven valores externos en valores con barras de escape. Esta funcionalidade *non* debería activarse";
+$PostMaxSizeInfo = "Este é o tamaño máximo dos envíos realizados ao través de formularios utilizando o método POST (é dicir, a forma típica de carga de arquivos mediante formularios)";
+$SafeModeInfo = "Modo seguro é unha característica obsoleta de PHP que limita (mal) o acceso dos scripts PHP a outros recursos. Recoméndase deixalo desactivado";
+$DisplayErrorsInfo = "Amosa os erros na pantalla. Activalo en servidores de desenvolvemento e desactivalo en servidores de produción";
+$MaxInputTimeInfo = "O tempo máximo permitido para que un formulario sexa procesado polo servidor. Se se sobrepasa, o proceso abandoase e devolve unha páxina en branco";
+$DefaultCharsetInfo = "Xogo de caracteres predeterminado que será enviado cando se devolvan as páxinas";
+$RegisterGlobalsInfo = "Permite seleccionar, ou non, o uso de variables globais. O uso desta funcionalidade representa un risco de seguridade";
+$ShortOpenTagInfo = "Permite utilizar etiquetas abreviadas ou non. Esta funcionalidade non se debería usar";
 ?>

+ 11 - 11
main/lang/slovenian/tracking.inc.php

@@ -5,14 +5,14 @@ for more information: see languages.txt in the lang folder.
 $langToolName = "Uvoz tečajev Blackboard";
 $TrackingDisabled = "Sledenje je onemogočil administrator.";
 $InactivesStudents = "Neaktivni tečajniki";
-$AverageTimeSpentOnThePlatform = "Povprečen čas porabljen na platformi";
-$AverageCoursePerStudent = "Povprečno število tečajev na uporabnika";
-$AverageProgressInLearnpath = "Povprečen napredek v učnih poteh";
-$AverageResultsToTheExercices = "Povprečen rezultat vaj in testov";
+$AverageTimeSpentOnThePlatform = "Čas porabljen na platformi";
+$AverageCoursePerStudent = "Število tečajev na uporabnika";
+$AverageProgressInLearnpath = "Napredek v tečajih";
+$AverageResultsToTheExercices = "Rezultati vaj/testov";
 $SeeStudentList = "Poglej seznam uporabnikov";
 $NbActiveSessions = "Aktivne seje";
 $NbPastSessions = "Pretekle seje";
-$NbFutureSessions = "Prihodnje seje";
+$NbFutureSessions = "Prihajajoče seje";
 $NbStudentPerSession = "Število uporabnikov na sejo";
 $NbCoursesPerSession = "Št. tečajev na sejo";
 $SeeSessionList = "Poglej seznam sej";
@@ -22,12 +22,12 @@ $langToolsAccess = "Dostop do orodij";
 $langCourseAccess = "Dostop do tečaja";
 $langLinksAccess = "Povezave";
 $langDocumentsAccess = "Dokumenti";
-$langScormAccess = "Učna pot";
-$langLinksDetails = "Povezave, ki jih je uporabil tečajnik";
-$langWorksDetails = "Izdelki, ki jih je objavil (uploaded) tečajnik v imenu 'Avtorjev'";
+$langScormAccess = "Tečaji";
+$langLinksDetails = "Uporabljene povezave";
+$langWorksDetails = "Oddani (naloženi) izdelki";
 $langLoginsDetails = "Klikni na ime meseca za dodatne podrobnosti";
-$langDocumentsDetails = "Dokumenti, ki si jih je tečajnik prepisal (downloaded)";
-$langExercicesDetails = "Rezultat opravljenih vaj";
+$langDocumentsDetails = "Prenešeni dokumenti";
+$langExercicesDetails = "Rezultati vaj/testov";
 $langBackToList = "Povratek na seznam uporabnikov";
 $langDetails = "Podrobnosti";
 $langStatsOfCourse = "Statistika tečaja";
@@ -40,7 +40,7 @@ $langLoginsTitleCountColumn = "Število vstopov";
 $langToolTitleToolnameColumn = "Ime orodja";
 $langToolTitleUsersColumn = "Kliki uporabnikov";
 $langToolTitleCountColumn = "Celotno število klikov";
-$langLinksTitleLinkColumn = "Povezave";
+$langLinksTitleLinkColumn = "Povezava";
 $langLinksTitleUsersColumn = "Kliki uporabnikov";
 $langLinksTitleCountColumn = "Celotno število klikov";
 $langExercicesTitleExerciceColumn = "Vaja";

+ 54 - 54
main/lang/slovenian/trad4all.inc.php

@@ -6,7 +6,7 @@ $Title = "Naslov";
 $By = "(Od)";
 $UsersOnline = "Aktivnih uporabnikov";
 $Remove = "Odstrani";
-$langEnter = "Povratek na seznam mojih tečajev";
+$langEnter = "Nazaj na seznam tečajev";
 $Description = "Opis";
 $Links = "Povezave";
 $langWorks = "Objave tečajnikov";
@@ -20,11 +20,11 @@ $langNewDir = "Ime nove mape";
 $langDirCr = "Mapa je narejena";
 $Download = "Prenos";
 $langGroup = "Skupine";
-$langEdit = "uredi";
+$langEdit = "Uredi";
 $langGroupForum = "Forum skupine";
 $Language = "Jezik";
 $LoginName = "Uporabniško ime";
-$AutostartMp3 = "Kliknite OK, če želite, da bo avdio datoteka predvajana avtomatično";
+$AutostartMp3 = "Želite, da se avdio datoteka predvaja avtomatično?";
 $Assignments = "Zadolžitve";
 $Forum = "Forumi";
 $langDelImage = "Odstrani sliko";
@@ -33,32 +33,32 @@ $langUp = "Gor";
 $Down = "dol";
 $Up = "gor";
 $Theme = "Tema";
-$TheListIsEmpty = "Seznam je prazen.";
-$langUniqueSelect = "Večkratna izbira (En odgovor)";
+$TheListIsEmpty = "Prazno";
+$langUniqueSelect = "Večkratna izbira";
 $CreateCategory = "Ustvari kategorijo";
 $SendFile = "Pošlji datoteko";
 $SaveChanges = "Shrani spremembe";
 $SearchTerm = "Iskani izraz";
 $TooShort = "Prekratko";
-$langCourseCreate = "Tvori spletno stran tečaja";
+$langCourseCreate = "Tvori tečaj";
 $langTodo = "Predlogi";
 $UserName = "Uporabniško ime";
 $lang_show_hide = "Prikaži / skrij";
-$langCategoryMod = "Spremeni kategorijo";
+$langCategoryMod = "Uredi kategorijo";
 $Hide = "Skrij";
 $langDear = "Spoštovani";
 $langArchive = "arhiv";
-$langCourseCode = "Koda tečaja";
+$langCourseCode = "Koda";
 $langNoDescription = "Brez opisa";
-$langOfficialCode = "Uradna koda";
+$langOfficialCode = "Koda";
 $FirstName = "Ime";
 $LastName = "Priimek";
-$Status = "Status";
+$Status = "Profil";
 $langEmail = "E-pošta";
 $SlideshowConversion = "Pretvorba prosojnic";
 $UploadFile = "Naloži datoteko";
 $AvailableFrom = "Dostopen od";
-$AvailableTill = "Dostopen do";
+$AvailableTill = "do";
 $Preview = "Predogled";
 $Type = "Vrsta";
 $EmailAddress = "E-poštni naslov";
@@ -69,11 +69,11 @@ $Update = "Ažuriraj";
 $SelectQuestionType = "Izberi tip vprašanja";
 $CurrentCourse = "Trenuten tečaj";
 $Back = "Nazaj";
-$Info = "informacije";
+$Info = "Informacije";
 $Search = "Išči";
 $AdvancedSearch = "Napredno iskanje";
 $Open = "Prost odgovor";
-$Import = "Uvozi";
+$Import = "Uveljavi";
 $AddAnother = "Dodaj naslednjega";
 $Author = "Avtor";
 $TrueFalse = "Pravilno / Nepravilno";
@@ -81,7 +81,7 @@ $QuestionType = "Tip vprašanja";
 $NoSearchResults = "Iskanje se je zaključilo brez rezultatov";
 $SelectQuestion = "Izberi vprašanje";
 $AddNewQuestionType = "Dodaj nov tip vprašanja";
-$Numbered = "Oštevilčen";
+$Numbered = "Oštevilčeno";
 $iso639_2_code = "sl";
 $iso639_1_code = "slv";
 $charset = "utf-8";
@@ -101,13 +101,13 @@ $langAllowed = "Dovoljeno";
 $langBackHome = "Povratek na domačo stran";
 $langPropositions = "Predlogi izboljšav";
 $langMaj = "Ažuriraj";
-$langModify = "spremeni";
+$langModify = "Uredi";
 $langDelete = "odstrani";
-$langInvisible = "Skrij";
-$langSave = "Shrani";
+$langInvisible = "nevidno";
+$langSave = "Pošlji sporočilo";
 $langMove = "Premakni";
 $Help = "Pomoč";
-$langOk = "OK";
+$langOk = "Uveljavi";
 $langAdd = "Dodaj";
 $langAddIntro = "Dodaj uvodno besedilo";
 $langBackList = "Vrni se na seznam";
@@ -116,11 +116,11 @@ $langEmpty = "Nekaj polj si pustil praznih.<br />V brkljalniku se <b>vrni</b>  n
 $langConfirmYourChoice = "Potrdi izbiro";
 $langAnd = "in";
 $langChoice = "Tvoja izbira";
-$langFinish = "Končaj";
+$langFinish = "Zaključi test";
 $langCancel = "Prekliči";
 $langNotAllowed = "Ni dovoljeno";
 $langNotLogged = "Nisi prijavljen v tečaj";
-$langManager = "upravitelj";
+$langManager = "Upravitelj";
 $langOptional = "Opcija";
 $NextPage = "Naslednja stran";
 $PreviousPage = "Predhodna stran";
@@ -134,16 +134,16 @@ $langDate = "Datum";
 $langAmong = "izmed";
 $langShow = "Prikaži";
 $langMyCourses = "Moji tečaji";
-$langModifyProfile = "Moj profil";
-$langMyStats = "Vpogled v mojo statistiko";
+$langModifyProfile = "Profil";
+$langMyStats = "Poglej moje napredovanje";
 $langLogout = "Odjava";
-$langMyAgenda = "Moja agenda";
+$langMyAgenda = "Osebna agenda";
 $langCourseHomepage = "Domača stran tečaja";
 $langCourseManagerview = "Učiteljev pogled";
 $langStudentView = "Uporabnikov pogled";
 $AddResource = "Dodaj";
 $AddedResources = "Priponke";
-$lang_modify_resource = "Spremeni / Dodaj resurse";
+$lang_modify_resource = "Uredi / Dodaj resurse";
 $lang_resource = "Resurs";
 $lang_resources = "Resursi";
 $langNameOfLang['arabic'] = "arabic";
@@ -169,24 +169,24 @@ $langNameOfLang['russian'] = "russian";
 $langNameOfLang['simpl_chinese'] = "simpl_chinese";
 $langNameOfLang['spanish'] = "spanish";
 $Close = "zapri";
-$langPlatform = "Platforma";
+$langPlatform = "Portal";
 $localLangName = "jezik";
 $email = "e-pošta";
 $langCourseCodeAlreadyExists = "Oprostite, koda tečaja že obstaja. Izberite drugo kodo.";
 $Statistics = "Statistika";
-$langGrouplist = "seznam skupine";
+$langGrouplist = "Seznam skupine";
 $langPrevious = "prejšnji";
 $DestDirectoryDoesntExist = "Ciljna mapa ne obstaja";
 $Courses = "tečaji";
 $In = "v";
 $langShowAll = "Prikaži vse";
-$langPage = "stran";
+$langPage = "Stran";
 $englishLangName = "English";
 $Home = "Domov";
 $langAreYouSureToDelete = "Ali resnično želiš brisanje";
 $SelectAll = "Izberi vse";
-$UnSelectAll = "izberi nobenega";
-$WithSelected = "z izbranimi";
+$UnSelectAll = "Izberi nobenega";
+$WithSelected = "Z izbranimi";
 $langOnLine = "Aktiven";
 $langUsers = "Uporabniki";
 $langPlatformAdmin = "Administracija platforme";
@@ -200,18 +200,18 @@ $langNameOfLang['thai'] = "thai";
 $langNameOfLang['turkce'] = "turkish";
 $langNameOfLang['vietnamese'] = "vietnamese";
 $UserInfo = "informacije o uporabniku";
-$langModifyQuestion = "Uredi vprašanje";
-$langNameOfLang = "yme jezika";
+$langModifyQuestion = "Shrani vprašanje";
+$langNameOfLang = "Ime jezika";
 $langCheckAll = "Izberi vse";
 $langNbAnnoucement = "Obvestilo";
 $lang_no_access_here = "Tu ni dostopa";
 $langOtherCourses = "ostali tečaji";
-$Doc = "dokument";
-$PlataformAdmin = "Admin platforme";
+$Doc = "Tečaj";
+$PlataformAdmin = "Admin portala";
 $Groups = "Skupine";
 $GroupManagement = "Upravljanje skupin";
-$All = "vsi";
-$None = "Brez";
+$All = "Vsi";
+$None = "noben";
 $langSorry = "Najprej izberite tečaj";
 $langDenied = "Ta funkcija je dostopna le administratorjem tečaja";
 $Today = "danes";
@@ -285,30 +285,30 @@ $PleaseTryAgain = "Prosim, poskusite znova!";
 $UplNoFileUploaded = "Nobena datoteke ni bila naložena.";
 $UplSelectFileFirst = "Izberite datoteko predenj pritisnete na gumb Naloži.";
 $UplNotAZip = "Datoteka, ki ste jo izbrali, ni ZIP datoteka.";
-$UplUploadSucceeded = "Prepis je bil uspešen!";
+$UplUploadSucceeded = "Nalaganje je bilo uspešno!";
 $ExportAsCSV = "Izvozi kot CSV datoteko";
-$ExportAsXLS = "Izvozi kot XLS datoteko";
+$ExportAsXLS = "Izvozi kot Excel datoteko";
 $langOpenarea = "Osebna interesna področja";
 $Done = "Končano";
 $Documents = "Dokumenti";
 $DocumentAdded = "Dokument dodan";
 $DocumentUpdated = "Dokument ažuriran";
 $DocumentInFolderUpdated = "Dokument ažuriran v mapi";
-$Course_description = "Opis tečaja";
+$Course_description = "Opis";
 $Calendar_event = "Agenda";
 $Document = "Dokument";
-$Learnpath = "Učna pot";
-$Link = "Povezava";
+$Learnpath = "Tečaji";
+$Link = "Povezave";
 $Announcement = "Obvestila";
 $Dropbox = "Nabiralnik";
-$Quiz = "Vaje";
-$langChat = "Klepetalnica";
+$Quiz = "Testi";
+$langChat = "Klepet";
 $Conference = "Konference";
 $Student_publication = "Izdelki tečajnikov";
 $Tracking = "Sledenje";
 $langhomepage_link = "Dodaj povezavo na to stran";
-$Course_setting = "Nastavitve tečaja";
-$langbackup = "Arhiviranje tečaja";
+$Course_setting = "Nastavitve";
+$langbackup = "Arhiviranje in uvoz";
 $langcopy_course_content = "Kopiranje vsebin tečaja";
 $langrecycle_course = "Recikliranje tečaja";
 $StartDate = "Začetni datum";
@@ -318,7 +318,7 @@ $EndTime = "Končni čas";
 $langYouWereCalled = "Pozvan si na klepet z";
 $langDoYouAccept = "Ali ga sprejmeš ?";
 $Everybody = "Vsi";
-$SentTo = "Prejemniki";
+$SentTo = "Vidno za";
 $Export = "Izvozi";
 $Tools = "Orodja";
 $Everyone = "Vsi";
@@ -327,13 +327,13 @@ $Student = "Tečajnik";
 $Teacher = "Učitelj";
 $Send2All = "Niste izbrali uporabnika / skupine. Element je viden vsem uporabnikom";
 $Wiki = "Wiki skupine";
-$Complete = "popolno";
+$Complete = "Popolno";
 $Incomplete = "Nepopolno";
-$reservation = "rezervacija";
+$reservation = "Rezerviraj resurs";
 $StartTimeWindow = "Začetek";
 $EndTimeWindow = "Konec";
 $AccessNotAllowed = "Dostop do te strani ni dovoljen / not allowed";
-$InThisCourse = "V tem tečaju";
+$InThisCourse = "v tem tečaju";
 $ThisFieldIsRequired = "zahtevano polje";
 $AllowedHTMLTags = "Dovoli HTML oznake";
 $FormHasErrorsPleaseComplete = "Obrazec vsebuje nepopolne ali nepravilne podatke. Preveri jih ponovno.";
@@ -348,8 +348,8 @@ $ViewRight = "Poglej";
 $EditRight = "Uredi";
 $DeleteRight = "Odstrani";
 $OverviewCourseRights = "Pregled vlog in pravic";
-$SeeAllRightsAllLocationsForSpecificRole = "Glede na vloge";
-$SeeAllRolesAllLocationsForSpecificRight = "Poglej vse vloge in lokacije za specifično pravico";
+$SeeAllRightsAllLocationsForSpecificRole = "Glede na vlogo";
+$SeeAllRolesAllLocationsForSpecificRight = "Glede na pravico";
 $langAdvanced = "Zgradi";
 $RightValueModified = "Vrednost je bila spremenjena.";
 $course_rights = "Pregled vlog in pravic";
@@ -365,7 +365,7 @@ $Anonymous = "Anonimno";
 $h = "ur";
 $CreateNewGlobalRole = "Ustvari novo globalno vlogo";
 $CreateNewLocalRole = "Ustvari novo lokalno vlogo";
-$Actions = "Akcija";
+$Actions = "Podrobno";
 $Inbox = "Prejeto";
 $ComposeMessage = "Sestavi sporočilo";
 $Other = "Ostalo";
@@ -374,7 +374,7 @@ $CampusHomepage = "Domača stran portala";
 $YouHaveNewMessage = "Imaš novo sporočilo !";
 $myActiveSessions = "Moje aktivne seje";
 $myInactiveSessions = "Moje neaktivne seje";
-$FileUpload = "Prenos datoteke";
+$FileUpload = "Nalaganje datoteke";
 $langMyActiveSessions = "Moje aktivne seje";
 $langMyInActiveSessions = "Moje neaktivne seje";
 $langMySpace = "Poročila";
@@ -405,10 +405,10 @@ $NoTel = "Ni tel";
 $SendMail = "Pošlji e-pošto";
 $RdvAgenda = "Zapis agende";
 $VideoConf = "Video konferenca";
-$MyProgress = "Moj napredek";
+$MyProgress = "Napredek";
 $NoOnlineStudents = "Ni aktivnih tečajnikov";
 $InCourse = "v tečaju";
-$UserOnlineListSession = "Seznam trenutno aktivnih tečajnikov - Seja";
+$UserOnlineListSession = "Aktivni tečajni - v mojih učnih sejah";
 $From = "Od";
 $To = "Za";
 $Content = "Vsebina";

+ 1 - 1
main/lang/spanish/announcements.inc.php

@@ -18,7 +18,7 @@ $langOn = "Hay";
 $langRegUser = "usuarios inscritos en el curso";
 $langUnvalid = "tienen una dirección de correo inválida o una dirección de correo sin especificar";
 $langModifAnn = "Modificar este anuncio";
-$langModify = "modificar";
+$langModify = "Modificar";
 $langDelete = "Eliminar";
 $langTitle = "Título";
 $langHelp = "ayuda";

+ 33 - 1
main/lang/spanish/trad4all.inc.php

@@ -845,4 +845,36 @@ $ToolCourseMaintenance = "Mantenimiento del curso";
 $AreYouSureToDeleteAllDates = "¿Confirma que desea borrar todas las fechas?";
 $AddADateTime = "Añadir fecha";
 $DeleteAllAttendances = "Eliminar todas las asistencias creadas";
-?>
+$ThematicControl = "Control tematico";
+$ThematicDetails = "Vista temática con detalles";
+$ThematicList = "Vista temática como lista";
+$Thematic = "Temática";
+$ThematicPlan = "Plan temático";
+$EditThematicPlan = "Editar plan temático";
+$EditThematicAdvance = "Editar avance temático";
+$ThereIsNoStillAthematicSection = "Todavía no hay una sección temática";
+$NewThematicSection = "Nueva sección temática";
+$DeleteAllThematics = "Borrar todas las temáticas";
+$ThematicDetailsDescription = "Se detalla las temáticas con sus respectivos planes y avances, para asignar un avance como terminado se debe seleccionar la fecha de acuerdo al orden y el sistema determinará las anteriores fechas como terminadas";
+$SkillToAcquireQuestions = "¿Qué habilidades se adquieren al término de esta sección temática?";
+$SkillToAcquire = "Habilidad a adquirir";
+$InfrastructureQuestions = "¿Qué infraestructura es necesaria para llevar a cabo con normalidad esta sección temática?";
+$Infrastructure = "Infraestructura";
+$AditionalNotesQuestions = "¿Qué otras cosas se requiere?";
+$DurationInHours = "Duración en horas";
+$ThereAreNoAttendancesInsideCourse = "No hay asistencias dentro del curso";
+$YouMustSelectAtleastAStartDate = "Debes seleccionar al menos una fecha de inicio";
+$EditTematicAdvance = "Editar avance temático";
+$AditionalNotes = "Notas adicionales";
+$StartDateFromAnAttendance = "Fecha de inicio a partir de una asistencia";
+$StartDateCustom = "Fecha de inicio personalizado";
+$StartDateOptions = "Opciones de fecha de inicio";
+$ThematicAdvanceConfiguration = "Configuración para el avance temático";
+$InfoAboutAdvanceInsideHomeCourse = "Información sobre el avance temático en la página principal del curso";
+$DisplayAboutLastDoneAdvance = "Mostrar información sobre el último avance temático hecho";
+$DisplayAboutNextAdvanceNotDone = "Mostrar información sobre el siguiente avance temático que no esta hecho";
+$InfoAboutLastDoneAdvance = "Información sobre el último avance temático realizado";
+$InfoAboutNextAdvanceNotDone = "Información sobre el siguiente avance temático que aún no se ha realizado";
+$ThereIsNoAThematicAdvance = "No existe un avance temático";
+$StillDoNotHaveAThematicPlan = "Aún no tiene un plan temático";
+?>

+ 12 - 11
tests/main/inc/lib/internationalization.lib.test.php

@@ -1,12 +1,12 @@
 <?php
+/* For licensing terms, see /license.txt */
 
 /**
  * This is a test of internationalization.lib.php which is
  * a common purpose library for supporting internationalization
  * related functions. Only the public API is tested here.
  * @author Ricardo Rodriguez Salazar, 2009.
- * @author Ivan Tcholakov, September 2009.
- * For licensing terms, see /dokeos_license.txt
+ * @author Ivan Tcholakov, 2009-2010.
  *
  * Notes:
  * 1. While saving this file, please, preserve its UTF-8 encoding.
@@ -521,9 +521,10 @@ class TestInternationalization extends UnitTestCase {
 	public function test_api_ereg() {
 		$pattern = 'scorm/showinframes.php([^"\'&]*)(&|&amp;)file=([^"\'&]*)$';
 		$string = 'http://localhost/dokeos/main/scorm/showinframes.php?id=5&amp;file=test.php';
-		$res = api_ereg($pattern, $string);
+		$regs = array();
+		$res = api_ereg($pattern, $string, $regs);
 		$this->assertTrue(is_numeric($res));
-		$this->assertTrue($res == 45);
+		//var_dump($regs);
 		//var_dump($res);
 	}
 
@@ -538,13 +539,13 @@ class TestInternationalization extends UnitTestCase {
 		//var_dump($res);
 	}
 
-	public function testapi_eregi() {
+	public function test_api_eregi() {
 		$pattern = 'scorm/showinframes.php([^"\'&]*)(&|&amp;)file=([^"\'&]*)$';
 		$string = 'http://localhost/dokeos/main/scorm/showinframes.php?id=5&amp;file=test.php';
-		$regs = '';
+		$regs = array();
 		$res = api_eregi($pattern, $string, $regs);
 		$this->assertTrue(is_numeric($res));
-		$this->assertTrue($res == 45);
+		//var_dump($regs);
 		//var_dump($res);
 	}
 
@@ -1385,13 +1386,13 @@ class TestInternationalization extends UnitTestCase {
 		}
 		//var_dump('<pre>'.$res.'</pre>');
 	}
-	
+
 	public function test_api_get_local_time_with_datetime() {
 		$datetime_not_converted = '2010-03-13 16:24:02';
 		$datetime_gmtplus1 = api_get_local_time($datetime_not_converted, 'Europe/Paris', 'America/Lima');
 		$this->assertEqual($datetime_gmtplus1, '2010-03-13 22:24:02');
 	}
-	
+
 	public function test_api_get_local_time_with_timestamp() {
 		$current_timestamp = time();
 		$datetime = api_get_local_time($current_timestamp, 'Europe/Paris');
@@ -1400,7 +1401,7 @@ class TestInternationalization extends UnitTestCase {
 		$this->assertEqual($datetime, date('Y-m-d H:i:s', $current_timestamp));
 		date_default_timezone_set($system_timezone);
 	}
-	
+
 	public function test_api_get_utc_datetime_with_string() {
 		$timestamp = time();
 		$timezone = _api_get_timezone();
@@ -1411,7 +1412,7 @@ class TestInternationalization extends UnitTestCase {
 		$this->assertEqual($datetime_utc, gmdate('Y-m-d H:i:s', $timestamp));
 		date_default_timezone_set($system_timezone);
 	}
-	
+
 	public function test_api_get_utc_datetime_with_timestamp() {
 		$timestamp = time();
 		$this->assertEqual(api_get_utc_datetime($timestamp), gmdate("Y-m-d H:i:s", $timestamp));

+ 22 - 0
tests/main/inc/lib/text.lib.test.php

@@ -3,6 +3,28 @@ require_once(api_get_path(LIBRARY_PATH).'text.lib.php');
 
 class TestText extends UnitTestCase {
 
+	public function test_api_camel_case_to_underscore() {
+		$input_strings    = array('myDocuments', 'MyProfile', 'CreateNewCourse', 'Create_New_course');
+		$expected_results = array('my_documents', 'my_profile', 'create_new_course', 'create_new_course');
+		$results = array_map('api_camel_case_to_underscore', $input_strings);
+		$this->assertTrue($results == $expected_results);
+		//var_dump($results);
+	}
+
+	function test_api_underscore_to_camel_case() {
+		$input_strings     = array('my_documents', 'My_profile', 'create_new_course');
+		$expected_results1 = array('MyDocuments', 'MyProfile', 'CreateNewCourse');
+		$expected_results2 = array('myDocuments', 'MyProfile', 'createNewCourse');
+		$func = create_function('$param', 'return api_underscore_to_camel_case($param, false);');
+		$results1 = array('MyDocuments', 'MyProfile', 'CreateNewCourse');
+		$results2 = array('myDocuments', 'MyProfile', 'createNewCourse');
+		$results1 = array_map('api_underscore_to_camel_case', $input_strings);
+		$results2 = array_map($func, $input_strings);
+		$this->assertTrue($results1 == $expected_results1 && $results2 == $expected_results2);
+		//var_dump($results1);
+		//var_dump($results2);
+	}
+
 	function test_text_parse_glossary() {
 		$input='';
 		$res=_text_parse_glossary($input);