Browse Source

Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x

Francis Gonzales 11 years ago
parent
commit
a18e166c8b
100 changed files with 3868 additions and 776 deletions
  1. 5 5
      main/admin/configure_plugin.php
  2. 5 4
      main/admin/settings.lib.php
  3. 52 34
      main/course_info/infocours.php
  4. 11 5
      main/coursecopy/classes/CourseRestorer.class.php
  5. 10 4
      main/coursecopy/copy_course.php
  6. 16 12
      main/coursecopy/create_backup.php
  7. 19 9
      main/coursecopy/import_backup.php
  8. 6 2
      main/coursecopy/recycle_course.php
  9. 5 0
      main/css/academica/dataTable.css
  10. 5 0
      main/css/baby_orange/dataTable.css
  11. 5 0
      main/css/blue_lagoon/dataTable.css
  12. 5 0
      main/css/chamilo/dataTable.css
  13. 5 0
      main/css/chamilo_electric_blue/dataTable.css
  14. 5 0
      main/css/chamilo_green/dataTable.css
  15. 5 0
      main/css/chamilo_orange/dataTable.css
  16. 5 0
      main/css/chamilo_red/dataTable.css
  17. 5 0
      main/css/chamilo_sport_red/dataTable.css
  18. 5 0
      main/css/cool_blue/dataTable.css
  19. 5 0
      main/css/corporate/dataTable.css
  20. 5 0
      main/css/cosmic_campus/dataTable.css
  21. 5 0
      main/css/delicious_bordeaux/dataTable.css
  22. 5 0
      main/css/dokeos_blue/dataTable.css
  23. 5 0
      main/css/dokeos_classic/dataTable.css
  24. 5 0
      main/css/dokeos_classic_2D/dataTable.css
  25. 5 0
      main/css/empire_green/dataTable.css
  26. 5 0
      main/css/fruity_orange/dataTable.css
  27. 5 0
      main/css/kiddy/dataTable.css
  28. 5 0
      main/css/medical/dataTable.css
  29. 5 0
      main/css/public_admin/dataTable.css
  30. 5 0
      main/css/royal_purple/dataTable.css
  31. 5 0
      main/css/silver_line/dataTable.css
  32. 5 0
      main/css/sober_brown/dataTable.css
  33. 5 0
      main/css/steel_grey/dataTable.css
  34. 5 0
      main/css/tasty_olive/dataTable.css
  35. 3 2
      main/document/create_document.php
  36. 16 11
      main/document/document.inc.php
  37. 253 198
      main/document/document.php
  38. 2 2
      main/document/upload.php
  39. 3 3
      main/exercice/admin.php
  40. 45 21
      main/exercice/exercise.class.php
  41. 12 14
      main/exercice/matching.class.php
  42. 11 14
      main/exercice/multiple_answer.class.php
  43. 25 27
      main/exercice/multiple_answer_combination.class.php
  44. 5 6
      main/exercice/multiple_answer_combination_true_false.class.php
  45. 83 85
      main/exercice/multiple_answer_true_false.class.php
  46. 4 6
      main/exercice/oral_expression.class.php
  47. 91 79
      main/exercice/unique_answer.class.php
  48. 76 81
      main/exercice/unique_answer_no_option.class.php
  49. 115 64
      main/exercice/upload_exercise.php
  50. 12 2
      main/forum/forumfunction.inc.php
  51. 22 5
      main/inc/lib/course.lib.php
  52. 1 1
      main/inc/lib/course_home.lib.php
  53. 131 69
      main/inc/lib/document.lib.php
  54. 1 1
      main/inc/lib/formvalidator/FormValidator.class.php
  55. 8 10
      main/inc/lib/groupmanager.lib.php
  56. 1646 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery-ui-i18n.js
  57. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-af.js
  58. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ar-DZ.js
  59. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ar.js
  60. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-az.js
  61. 24 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-bg.js
  62. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-bs.js
  63. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ca.js
  64. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-cs.js
  65. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-cy-GB.js
  66. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-da.js
  67. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-de.js
  68. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-el.js
  69. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-AU.js
  70. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js
  71. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-NZ.js
  72. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-eo.js
  73. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-es.js
  74. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-et.js
  75. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-eu.js
  76. 59 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fa.js
  77. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fi.js
  78. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fo.js
  79. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fr-CH.js
  80. 25 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fr.js
  81. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-gl.js
  82. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-he.js
  83. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hi.js
  84. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hr.js
  85. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hu.js
  86. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hy.js
  87. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-id.js
  88. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-is.js
  89. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-it.js
  90. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ja.js
  91. 21 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ka.js
  92. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-kk.js
  93. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-km.js
  94. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ko.js
  95. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lb.js
  96. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lt.js
  97. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lv.js
  98. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-mk.js
  99. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ml.js
  100. 23 0
      main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ms.js

+ 5 - 5
main/admin/configure_plugin.php

@@ -16,7 +16,7 @@ api_protect_admin_script();
 $plugin_name = $_GET['name'];
 
 $plugin_obj = new AppPlugin();
-$plugin_info = $plugin_obj->get_plugin_info($plugin_name, true);
+$plugin_info = $plugin_obj->getPluginInfo($plugin_name, true);
 
 if (empty($plugin_info)) {
     api_not_allowed();
@@ -33,7 +33,7 @@ global $_configuration;
 $content = null;
 
 if (isset($plugin_info['settings_form'])) {
-    $form = $plugin_info['settings_form'];    
+    $form = $plugin_info['settings_form'];
     if (isset($form)) {
         //We override the form attributes
         $attributes = array('action'=>api_get_self().'?name='.$plugin_name, 'method'=>'POST');
@@ -48,7 +48,7 @@ if (isset($plugin_info['settings_form'])) {
 if (isset($form)) {
     if ($form->validate()) {
         $values = $form->exportValues();
-        
+
         //api_delete_category_settings_by_subkey($plugin_name);
         $access_url_id = api_get_current_access_url_id();
         api_delete_settings_params(array('category = ? AND access_url = ? AND subkey = ? AND type = ? and variable <> ?' =>
@@ -56,7 +56,7 @@ if (isset($form)) {
         foreach ($values as $key => $value) {
             $key = Database::escape_string($plugin_name.'_'.$key);
             api_add_setting($value, $key, $plugin_name, 'setting', 'Plugins', $plugin_name, null, null, null, $_configuration['access_url'], 1);
-            
+
         }
         $message = Display::return_message(get_lang('Updated'), 'success');
     }
@@ -65,4 +65,4 @@ $tpl = new Template($tool_name, true, true, false, true, false);
 $tpl->assign('actions', $actions);
 $tpl->assign('message', $message);
 $tpl->assign('content', $content);
-$tpl->display_one_col_template();
+$tpl->display_one_col_template();

+ 5 - 4
main/admin/settings.lib.php

@@ -497,16 +497,16 @@ function store_regions()
 */
 function store_plugins()
 {
-    $plugin_obj = new AppPlugin();
+    $appPlugin = new AppPlugin();
 
     // Get a list of all current 'Plugins' settings
-    $plugin_list = $plugin_obj->read_plugins_from_path();
+    $plugin_list = $appPlugin->read_plugins_from_path();
 
     $installed_plugins = array();
 
     foreach ($plugin_list as $plugin) {
         if (isset($_POST['plugin_'.$plugin])) {
-            $plugin_obj->install($plugin);
+            $appPlugin->install($plugin);
             $installed_plugins[] = $plugin;
         }
     }
@@ -516,8 +516,9 @@ function store_plugins()
     } else {
         $remove_plugins = $plugin_list;
     }
+
     foreach ($remove_plugins as $plugin) {
-        $plugin_obj->uninstall($plugin);
+        $appPlugin->uninstall($plugin);
     }
 }
 

+ 52 - 34
main/course_info/infocours.php

@@ -128,7 +128,6 @@ if (file_exists($course_path.'/course-pic85x85.png')) {
 }
 $form->addElement('html', $image_html);
 
-
 $form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6'));
 $form->applyFilter('title', 'html_filter');
 $form->applyFilter('title', 'trim');
@@ -344,7 +343,6 @@ $form->addGroup($group, '', array(get_lang("ShowSystemFolders")), '');
 $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');
 $form->addElement('html', '</div></div>');
 
-
 // Certificate settings
 if (api_get_setting('allow_public_certificates')=='true') {
     $form->addElement('html', '<div><h3>'.Display::return_icon('certificate.png', Security::remove_XSS(get_lang('Certificates')),'',ICON_SIZE_SMALL).' '.Security::remove_XSS(get_lang('Certificates')).'</h3><div>');
@@ -359,11 +357,11 @@ if (api_get_setting('allow_public_certificates')=='true') {
 
 // Plugin course settings
 
-$app_plugin = new AppPlugin();
-$app_plugin->add_course_settings_form($form);
+$appPlugin = new AppPlugin();
+$appPlugin->add_course_settings_form($form);
 
 // Get all the course information
-$all_course_information =  CourseManager::get_course_information($_course['sysCode']);
+$all_course_information = CourseManager::get_course_information($_course['sysCode']);
 
 // Set the default values of the form
 $values = array();
@@ -382,58 +380,78 @@ $values['course_registration_password'] = $all_course_information['registration_
 $values['legal']                        = $all_course_information['legal'];
 $values['activate_legal']               = $all_course_information['activate_legal'];
 
-$courseSettings = CourseManager::getCourseSettingVariables();
+$courseSettings = CourseManager::getCourseSettingVariables($appPlugin);
 foreach ($courseSettings as $setting) {
-    $values[$setting] = api_get_course_setting($setting);
+    $result = api_get_course_setting($setting);
+    if ($result != '-1') {
+        $values[$setting] = $result;
+    }
 }
 
-$app_plugin->set_course_settings_defaults($values);
-
 $form->setDefaults($values);
 
 // Validate form
 if ($form->validate() && is_settings_editable()) {
-    $update_values = $form->exportValues();
+    $updateValues = $form->exportValues();
 
-    $pdf_export_watermark_path = $_FILES['pdf_export_watermark_path'];
+    $pdf_export_watermark_path = isset($_FILES['pdf_export_watermark_path']) ? $_FILES['pdf_export_watermark_path'] : null;
 
     if (!empty($pdf_export_watermark_path['name'])) {
-        $pdf_export_watermark_path_result = PDF::upload_watermark($pdf_export_watermark_path['name'], $pdf_export_watermark_path['tmp_name'], $course_code);
-        unset($update_values['pdf_export_watermark_path']);
+        $pdf_export_watermark_path_result = PDF::upload_watermark(
+            $pdf_export_watermark_path['name'],
+            $pdf_export_watermark_path['tmp_name'],
+            $course_code
+        );
+        unset($updateValues['pdf_export_watermark_path']);
     }
 
     //Variables that will be saved in the TABLE_MAIN_COURSE table
-    $update_in_course_table = array('title', 'course_language','category_code','department_name', 'department_url','visibility',
-    								'subscribe', 'unsubscribe','tutor_name','course_registration_password', 'legal', 'activate_legal');
-
-    foreach ($update_values as $index =>$value) {
-        $update_values[$index] = Database::escape_string($value);
+    $update_in_course_table = array(
+        'title',
+        'course_language',
+        'category_code',
+        'department_name',
+        'department_url',
+        'visibility',
+        'subscribe',
+        'unsubscribe',
+        'tutor_name',
+        'course_registration_password',
+        'legal',
+        'activate_legal'
+    );
+    foreach ($updateValues as $index =>$value) {
+        $updateValues[$index] = Database::escape_string($value);
     }
-    unset($value);
+
     $table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
     $sql = "UPDATE $table_course SET
-        title 				    = '".$update_values['title']."',
-        course_language 	    = '".$update_values['course_language']."',
-        category_code 		    = '".$update_values['category_code']."',
-        department_name  	    = '".$update_values['department_name']."',
-        department_url  	    = '".$update_values['department_url']."',
-        visibility  		    = '".$update_values['visibility']."',
-        subscribe  			    = '".$update_values['subscribe']."',
-        unsubscribe  		    = '".$update_values['unsubscribe']."',
-        legal                   = '".$update_values['legal']."',
-        activate_legal          = '".$update_values['activate_legal']."',
-        registration_code 	    = '".$update_values['course_registration_password']."'
+        title 				    = '".$updateValues['title']."',
+        course_language 	    = '".$updateValues['course_language']."',
+        category_code 		    = '".$updateValues['category_code']."',
+        department_name  	    = '".$updateValues['department_name']."',
+        department_url  	    = '".$updateValues['department_url']."',
+        visibility  		    = '".$updateValues['visibility']."',
+        subscribe  			    = '".$updateValues['subscribe']."',
+        unsubscribe  		    = '".$updateValues['unsubscribe']."',
+        legal                   = '".$updateValues['legal']."',
+        activate_legal          = '".$updateValues['activate_legal']."',
+        registration_code 	    = '".$updateValues['course_registration_password']."'
         WHERE code = '".$course_code."'";
     Database::query($sql);
 
     // Insert/Updates course_settings table
     foreach ($courseSettings as $setting) {
-        if (isset($update_values[$setting])) {
-            CourseManager::saveCourseConfigurationSetting($setting, $update_values[$setting], api_get_course_int_id());
-        }
+        $value = isset($updateValues[$setting]) ? $updateValues[$setting] : null;
+        CourseManager::saveCourseConfigurationSetting(
+            $appPlugin,
+            $setting,
+            $value,
+            api_get_course_int_id()
+        );
     }
 
-    $app_plugin->save_course_settings($update_values);
+    $appPlugin->saveCourseSettingsHook($update_values);
     $cidReset = true;
     $cidReq = $course_code;
     require '../inc/local.inc.php';

+ 11 - 5
main/coursecopy/classes/CourseRestorer.class.php

@@ -1368,11 +1368,17 @@ class CourseRestorer
         // question source_id => category source_id
         if ($this->course->has_resources(RESOURCE_QUIZQUESTION)) {
             // check the category number of each question restored
-            foreach ($resources[RESOURCE_QUIZQUESTION] as $id => $CourseCopyQuestion) {
-                $new_quiz_question_id = $resources[RESOURCE_QUIZQUESTION][$id]->destination_id;
-                $question_category = $CourseCopyQuestion->question_category;
-                if ($question_category > 0) {
-                    Testcategory::add_category_for_question_id($tab_test_category_id_old_new[$question_category], $new_quiz_question_id, $course_id);
+            if (!empty($resources[RESOURCE_QUIZQUESTION])) {
+                foreach ($resources[RESOURCE_QUIZQUESTION] as $id => $CourseCopyQuestion) {
+                    $new_quiz_question_id = $resources[RESOURCE_QUIZQUESTION][$id]->destination_id;
+                    $question_category = $CourseCopyQuestion->question_category;
+                    if ($question_category > 0) {
+                        Testcategory::add_category_for_question_id(
+                            $tab_test_category_id_old_new[$question_category],
+                            $new_quiz_question_id,
+                            $course_id
+                        );
+                    }
                 }
             }
         }

+ 10 - 4
main/coursecopy/copy_course.php

@@ -68,11 +68,17 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
     $table_cu = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
     $user_info = api_get_user_info();
     $course_info = api_get_course_info();
-    $sql = 'SELECT * FROM '.$table_c.' c, '.$table_cu.' cu WHERE cu.course_code = c.code';
+    $sql = 'SELECT *
+            FROM '.$table_c.' c, '.$table_cu.' cu
+            WHERE cu.course_code = c.code';
     if (!api_is_platform_admin()) {
         $sql .= ' AND cu.status=1 ';
     }
-    $sql .= ' AND target_course_code IS NULL AND cu.user_id = '.$user_info['user_id'].' AND c.code != '."'".$course_info['sysCode']."'".' ORDER BY title ASC';
+    $sql .= ' AND
+        target_course_code IS NULL AND
+        cu.user_id = '.$user_info['user_id'].' AND
+        c.code != '."'".$course_info['sysCode']."'".'
+    ORDER BY title ASC';
     $res = Database::query($sql);
     if (Database::num_rows($res) == 0) {
         Display::display_normal_message(get_lang('NoDestinationCoursesAvailable'));
@@ -83,7 +89,6 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
         }
 
         $form = new FormValidator('copy_course', 'post', 'copy_course.php?'.api_get_cidreq());
-        $form->addElement('header', '');
         $form->addElement('select', 'destination_course', get_lang('SelectDestinationCourse'), $options);
 
         $group = array();
@@ -96,10 +101,11 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
         $group[] = $form->createElement('radio', 'same_file_name_option', null, get_lang('SameFilenameRename'), FILE_RENAME);
         $group[] = $form->createElement('radio', 'same_file_name_option', null, get_lang('SameFilenameOverwrite'), FILE_OVERWRITE);
         $form->addGroup($group, '', get_lang('SameFilename'));
+        $form->add_progress_bar();
         $form->addElement('style_submit_button', 'submit', get_lang('CopyCourse'), 'class="save"');
         $form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE));
         $form->display();
 	}
 }
 
-Display::display_footer();
+Display::display_footer();

+ 16 - 12
main/coursecopy/create_backup.php

@@ -53,14 +53,18 @@ echo Display::page_header($nameTools);
 
 /*	MAIN CODE */
 
-if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (isset($_POST['backup_option']) && $_POST['backup_option'] == 'full_backup')) {
+if ((isset($_POST['action']) &&
+    $_POST['action'] == 'course_select_form') ||
+    (isset($_POST['backup_option']) &&
+    $_POST['backup_option'] == 'full_backup')
+) {
 	if (isset ($_POST['action']) && $_POST['action'] == 'course_select_form') {
-		$course = CourseSelectForm::get_posted_course();        
+		$course = CourseSelectForm::get_posted_course();
 	} else {
 		$cb = new CourseBuilder();
 		$course = $cb->build();
 	}
-	$zip_file = CourseArchiver::write_course($course); 
+	$zip_file = CourseArchiver::write_course($course);
 	Display::display_confirmation_message(get_lang('BackupCreated'));
 	echo '<br /><a class="btn btn-primary btn-large" href="../course_info/download.php?archive='.$zip_file.'">'.get_lang('Download').'</a>';
 
@@ -73,25 +77,25 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
 	$course = $cb->build();
 	if (!$course->has_resources()) {
 		echo get_lang('NoResourcesToBackup');
-	} else {		
-		
-		$form = new FormValidator('create_backup_form', 'post');
+	} else {
+		$form = new FormValidator('create_backup_form', 'post', api_get_self().'?'.api_get_cidreq());
 		$form->addElement('header',get_lang('SelectOptionForBackup'));
-		
 		$form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup');
 		$form->addElement('radio', 'backup_option', '',  get_lang('LetMeSelectItems'), 'select_items');
-		
 		$form->addElement('style_submit_button', null, get_lang('CreateBackup'), 'class="save"');
-
 		$form->add_progress_bar();
 		// When progress bar appears we have to hide the title "Please select a backup-option".
-		$form->updateAttributes(array('onsubmit' => str_replace('javascript: ', 'javascript: page_title = getElementById(\'page_title\'); if (page_title) { setTimeout(\'page_title.style.display = \\\'none\\\';\', 2000); } ', $form->getAttribute('onsubmit'))));
-
+		$form->updateAttributes(
+            array('onsubmit' => str_replace(
+                'javascript: ',
+                'javascript: page_title = getElementById(\'page_title\'); if (page_title) { setTimeout(\'page_title.style.display = \\\'none\\\';\', 2000); } ',
+                $form->getAttribute('onsubmit')
+            ))
+        );
 		$values['backup_option'] = 'full_backup';
 		$form->setDefaults($values);
 		$form->display();
 	}
 }
 
-/*	FOOTER */
 Display::display_footer();

+ 19 - 9
main/coursecopy/import_backup.php

@@ -52,12 +52,16 @@ echo Display::page_header($nameTools);
 
 /*	MAIN CODE */
 
-if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (isset($_POST['import_option']) && $_POST['import_option'] == 'full_backup' )) {
+if ((isset($_POST['action']) &&
+    $_POST['action'] == 'course_select_form') ||
+    (isset($_POST['import_option']) &&
+    $_POST['import_option'] == 'full_backup')
+) {
 	$error = false;
 	if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
 		// Partial backup here we recover the documents posted
 		$course = CourseSelectForm::get_posted_course();
-        
+
 	} else {
 		if ($_POST['backup_type'] == 'server') {
 			$filename = $_POST['backup_server'];
@@ -74,7 +78,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
 				$error = true;
 			}
 		}
-    
+
         if (!$error) {
 		  // Full backup
 		  $course = CourseArchiver::read_course($filename, $delete_file);
@@ -96,7 +100,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
             echo '<a class="btn" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
         } else {
             if ($filename == '') {
-               Display::display_error_message(get_lang('SelectBackupFile')); 
+               Display::display_error_message(get_lang('SelectBackupFile'));
                echo '<a class="btn" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
             } else {
     			Display::display_error_message(get_lang('UploadError'));
@@ -105,6 +109,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
 		}
 	}
 	CourseArchiver::clean_backup_dir();
+
 } elseif (isset($_POST['import_option']) && $_POST['import_option'] == 'select_items') {
 	if ($_POST['backup_type'] == 'server') {
 		$filename = $_POST['backup_server'];
@@ -114,7 +119,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
 		$delete_file = true;
 	}
 	$course = CourseArchiver::read_course($filename, $delete_file);
-  
+
 	if ($course->has_resources() && ($filename !== false)) {
 		CourseSelectForm::display_form($course, array('same_file_name_option' => $_POST['same_file_name_option']));
 	} elseif ($filename === false) {
@@ -129,7 +134,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
 	$backups = CourseArchiver::get_available_backups($is_platformAdmin ?null:$user['user_id']);
 	$backups_available = count($backups) > 0;
 
-	$form = new FormValidator('import_backup_form', 'post', 'import_backup.php', '', 'multipart/form-data');
+	$form = new FormValidator('import_backup_form', 'post', api_get_path(WEB_CODE_PATH).'coursecopy/import_backup.php?'.api_get_cidreq(), '', 'multipart/form-data');
     $form->addElement('header', get_lang('SelectBackupFile'));
 	$renderer = $form->defaultRenderer();
 	$renderer->setElementTemplate('<div>{element}</div> ');
@@ -175,10 +180,15 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form' ) || (i
 
 	$form->add_progress_bar();
 	// When progress bar appears we have to hide the title "Select backup file".
-	$form->updateAttributes(array('onsubmit' => str_replace('javascript: ', 'javascript: page_title = getElementById(\'page_title\'); if (page_title) { setTimeout(\'page_title.style.display = \\\'none\\\';\', 2000); } ', $form->getAttribute('onsubmit'))));
+	$form->updateAttributes(array(
+        'onsubmit' => str_replace(
+            'javascript: ',
+            'javascript: page_title = getElementById(\'page_title\'); if (page_title) { setTimeout(\'page_title.style.display = \\\'none\\\';\', 2000); } ',
+            $form->getAttribute('onsubmit')
+        )
+    ));
 
 	$form->display();
 }
 
-/*	FOOTER */
-Display::display_footer();
+Display::display_footer();

+ 6 - 2
main/coursecopy/recycle_course.php

@@ -46,7 +46,11 @@ echo Display::page_header($nameTools);
 
 /*		MAIN CODE	*/
 
-if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (isset($_POST['recycle_option']) && $_POST['recycle_option'] == 'full_backup')) {
+if ((isset($_POST['action']) &&
+    $_POST['action'] == 'course_select_form') ||
+    (isset($_POST['recycle_option']) &&
+    $_POST['recycle_option'] == 'full_backup')
+) {
 	if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
 		$course = CourseSelectForm::get_posted_course();
 	} else {
@@ -74,7 +78,7 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
 		echo get_lang('NoResourcesToRecycle');
 	} else {
 		Display::display_warning_message(get_lang('RecycleWarning'), false);
-        $form = new FormValidator('recycle_course', 'post', 'recycle_course.php?'.api_get_cidreq());
+        $form = new FormValidator('recycle_course', 'post', api_get_self().'?'.api_get_cidreq());
 		$form->addElement('header', get_lang('SelectOptionForBackup'));
 		$form->addElement('radio', 'recycle_option', null, get_lang('FullRecycle'), 'full_backup');
         $form->addElement('radio', 'recycle_option', null, get_lang('LetMeSelectItems'), 'select_items');

+ 5 - 0
main/css/academica/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/baby_orange/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/blue_lagoon/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo_electric_blue/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo_green/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo_orange/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo_red/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/chamilo_sport_red/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/cool_blue/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/corporate/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/cosmic_campus/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/delicious_bordeaux/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/dokeos_blue/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/dokeos_classic/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/dokeos_classic_2D/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/empire_green/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/fruity_orange/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/kiddy/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/medical/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/public_admin/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/royal_purple/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/silver_line/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/sober_brown/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/steel_grey/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 5 - 0
main/css/tasty_olive/dataTable.css

@@ -9,6 +9,11 @@
  *  Project:      DataTables
  *
  *  Copyright 2009 Allan Jardine. All Rights Reserved.
+ *  Note: dataTable.css was later released as part of the jquery.dataTables
+ *  plugin, released itself as GPLv2. As such, we believe this copyright is no
+ *  longer an issue and will try to upgrade to a later version of dataTables
+ *  in the near future. -- Yannick Warnier, Chamilo project leader, 2014-04
+ *  See https://support.chamilo.org/issues/7043
  *
  * ***************************************************************************
  * DESCRIPTION

+ 3 - 2
main/document/create_document.php

@@ -301,7 +301,7 @@ if (isset($group_properties)) {
 }
 
 $select_cat = isset($_GET['selectcat']) ? intval($_GET['selectcat']) : null;
-
+$curDirPath = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
 // Create a new form
 $form = new FormValidator(
     'create_document',
@@ -569,8 +569,9 @@ if ($form->validate()) {
                 if (!isset($df)) {
                     DocumentManager::attach_gradebook_certificate ($_course['code'],$document_id);
 				}
-				$certificate_condition = '&certificate=true';
+				$certificate_condition = '&certificate=true&curdirpath=/certificates';
 			}
+
 			header('Location: document.php?'.api_get_cidreq().'&id='.$folder_id.$selectcat.$certificate_condition);
 			exit();
 		} else {

+ 16 - 11
main/document/document.inc.php

@@ -476,9 +476,7 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
         $req_gid = '';
     }
     $document_id = $document_data['id'];
-
     $type = $document_data['filetype'];
-
     $is_read_only = $document_data['readonly'];
     $path = $document_data['path'];
     $parent_id = DocumentManager::get_document_id(api_get_course_info(), dirname($path));
@@ -582,7 +580,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
                 } else {
                     $tip_visibility = get_lang('Hide');
                 }
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . $req_gid . '&amp;' . $sort_params . '">' . Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
+                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . $req_gid . '&amp;' . $sort_params . '">' .
+                    Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
             }
         }
 
@@ -591,19 +590,23 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
             $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
         } else {
             if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' && DocumentManager::get_default_certificate_id(api_get_course_id()) == $id) {
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;deleteid=' . $document_id . $req_gid . '&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
+                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.$req_gid.'&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . basename($path) . '\');">' .
+                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
             } else {
                 if ($is_certificate_mode) {
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;deleteid=' . $document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
+                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' .
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
                 } else {
                     if (api_get_session_id()) {
                         if ($document_data['session_id'] == api_get_session_id()) {
-                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;deleteid=' . $document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
+                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">'.
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
                         } else {
                             $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
                         }
                     } else {
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;deleteid=' . $document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
+                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . $req_gid . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . basename($path) . '\');">' .
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
                     }
                 }
             }
@@ -613,7 +616,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
     if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
         if ($is_template == 0) {
             if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id . $req_gid . '&amp;' . $sort_params . '">' . Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
+                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id . $req_gid . '&amp;' . $sort_params . '">' .
+                    Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
             }
             if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
                 $visibility_icon_certificate = 'nocertificate';
@@ -627,7 +631,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
                     $certificate = get_lang('NoDefaultCertificate');
                 }
                 if (isset($_GET['selectcat'])) {
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&amp;set_certificate=' . $id . $req_gid . '&amp;' . $sort_params . '"><img src="../img/' . $visibility_icon_certificate . '.png" border="0" title="' . $certificate . '" alt="" /></a>';
+                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&amp;set_certificate=' . $id . $req_gid . '&amp;' . $sort_params . '">
+                    <img src="../img/' . $visibility_icon_certificate . '.png" border="0" title="' . $certificate . '" alt="" /></a>';
                     if ($is_preview) {
                         $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . $req_gid . '&amp;' . $sort_params . '" >' .
                                 Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
@@ -638,7 +643,8 @@ function build_edit_icons($document_data, $id, $is_template, $is_read_only = 0,
             $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id . $req_gid . '&amp;' . $sort_params . '">' .
                     Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
         }
-        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' . Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
+        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
+            Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
     }
     return $modify_icons;
 }
@@ -771,7 +777,6 @@ function display_user_link_document($user_id, $name) {
  */
 function create_dir_form($current_dir_id) {
     global $document_id;
-
     $form = new FormValidator('create_dir_form', 'post', api_get_self().'?'.api_get_cidreq(), '', null, false);
     $form->addElement('hidden', 'create_dir', 1);
     $form->addElement('hidden', 'dir_id', intval($document_id));

+ 253 - 198
main/document/document.php

@@ -28,6 +28,7 @@
 /**
  * Code
  */
+use \ChamiloSession as Session;
 // Language files that need to be included
 $language_file = array('document', 'slideshow', 'gradebook', 'create_course');
 require_once '../inc/global.inc.php';
@@ -35,6 +36,7 @@ $current_course_tool = TOOL_DOCUMENT;
 $this_section = SECTION_COURSES;
 $to_user_id = null;
 $parent_id = null;
+$message = null;
 
 require_once 'document.inc.php';
 $lib_path = api_get_path(LIBRARY_PATH);
@@ -93,7 +95,8 @@ if (empty($courseInfo)) {
     api_not_allowed(true);
 }
 
-$dbl_click_id = 0; // Used for avoiding double-click
+// Used for avoiding double-click.
+$dbl_click_id = 0;
 
 $selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : null;
 $moveTo = isset($_POST['move_to']) ? Security::remove_XSS($_POST['move_to']) : null;
@@ -164,13 +167,77 @@ if (!empty($groupId)) {
 
 $document_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null;
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
-$message = '';
+
+$currentUrl = api_get_self().'?'.api_get_cidreq().'&id='.$document_id;
 
 if (Portfolio::controller()->accept()) {
     Portfolio::controller()->run();
 }
 
 switch ($action) {
+    case 'delete_item':
+        if ($is_allowed_to_edit ||
+            $group_member_with_upload_rights ||
+            is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id) ||
+            is_my_shared_folder(api_get_user_id(), $moveTo, $session_id)
+        ) {
+            if (isset($_GET['deleteid'])) {
+                if (!$is_allowed_to_edit) {
+                    if (api_is_coach()) {
+                        if (!DocumentManager::is_visible_by_id(
+                            $_GET['deleteid'],
+                            $courseInfo,
+                            $session_id,
+                            api_get_user_id())
+                        ) {
+                            api_not_allowed();
+                        }
+                    }
+
+                    if (DocumentManager::check_readonly(
+                        $courseInfo,
+                        api_get_user_id(),
+                        '',
+                        $_GET['deleteid'],
+                        true)
+                    ) {
+                        api_not_allowed();
+                    }
+                }
+
+                $documentInfo = DocumentManager::get_document_data_by_id(
+                    $_GET['deleteid'],
+                    $courseInfo['code'],
+                    false,
+                    $session_id
+                );
+
+                // Check whether the document is in the database.
+                if (!empty($documentInfo)) {
+                    $deleteDocument = DocumentManager::delete_document(
+                        $courseInfo,
+                        null,
+                        $base_work_dir,
+                        api_get_session_id(),
+                        $_GET['deleteid'],
+                        $groupId
+                    );
+
+                    if ($deleteDocument) {
+                        $certificateId = isset($_GET['delete_certificate_id']) ? $_GET['delete_certificate_id'] : null;
+                        DocumentManager::remove_attach_certificate(api_get_course_id(), $certificateId);
+                        $message = Display::return_message(get_lang('DocDeleted').': '.$documentInfo['path'], 'success');
+                    } else {
+                        $message = Display::return_message(get_lang('DocDeleteError'), 'warning');
+                    }
+                } else {
+                    $message = Display::return_message(get_lang('FileNotFound'), 'warning');
+                }
+                Session::write('message', $message);
+                header("Location: $currentUrl");
+                exit;
+            }
+        }
     case 'download':
         // Get the document data from the ID
         $document_data = DocumentManager::get_document_data_by_id(
@@ -230,7 +297,7 @@ switch ($action) {
                 );
             }
 
-            //filter when I am into shared folder, I can donwload only my shared folder
+            //filter when I am into shared folder, I can download only my shared folder
             if (is_any_user_shared_folder($document_data['path'], $session_id)) {
                 if (is_my_shared_folder(api_get_user_id(), $document_data['path'], $session_id)
                     || api_is_allowed_to_edit()
@@ -338,6 +405,7 @@ switch ($action) {
                     $message = Display::return_message(get_lang('CopyMade').' '.$file_link, 'confirmation', false);
                 }
             }
+            Session::write('message', $message);
         }
         break;
 }
@@ -712,7 +780,9 @@ if (!empty($documentAndFolders)) {
                     $session_id
                 );
                 if ($session_id != 0 && !$document_data) {
-                    // If there is a session defined and asking for the document *from the session* didn't work, try it from the course (out of a session context)
+                    /* If there is a session defined and asking for the document
+                     * from the session* didn't work, try it from the
+                     course (out of a session context) */
                     $document_data = DocumentManager::get_document_data_by_id(
                         $file['id'],
                         api_get_course_id(),
@@ -743,7 +813,7 @@ $(document).ready( function() {
 });
 </script>';
 
-Display::display_header('', 'Doc');
+
 
 // Lib for event log, stats & tracking & record of the access
 event_access_tool(TOOL_DOCUMENT);
@@ -753,15 +823,7 @@ if ($groupId != 0) { // Add group name after for group documents
     $add_group_to_title = ' ('.$group_properties['name'].')';
 }
 
-/* Introduction section (editable by course admins) */
-
-if (!empty($_SESSION['_gid'])) {
-    Display::display_introduction_section(TOOL_DOCUMENT.$_SESSION['_gid']);
-} else {
-    Display::display_introduction_section(TOOL_DOCUMENT);
-}
-
-// ACTION MENU
+$moveForm = null;
 
 /* 	MOVE FILE OR DIRECTORY */
 //Only teacher and all users into their group and each user into his/her shared folder
@@ -770,19 +832,18 @@ if ($is_allowed_to_edit ||
     is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id) ||
     is_my_shared_folder(api_get_user_id(), $moveTo, $session_id)
 ) {
-
     if (isset($_GET['move']) && $_GET['move'] != '') {
         $my_get_move = intval($_REQUEST['move']);
 
         if (api_is_coach()) {
             if (!DocumentManager::is_visible_by_id($my_get_move, $courseInfo, $session_id, api_get_user_id())) {
-                api_not_allowed();
+                api_not_allowed(true);
             }
         }
 
         if (!$is_allowed_to_edit) {
             if (DocumentManager::check_readonly($courseInfo, api_get_user_id(), $my_get_move)) {
-                api_not_allowed();
+                api_not_allowed(true);
             }
         }
         // Get the document data from the ID
@@ -812,17 +873,16 @@ if ($is_allowed_to_edit ||
                         $user_shared_folders[] = $fold;
                     }
                 }
-                echo '<legend>'.get_lang('Move').'</legend>';
-                echo build_move_to_selector(
+                $moveForm .= '<legend>'.get_lang('Move').'</legend>';
+                $moveForm .= build_move_to_selector(
                     $user_shared_folders,
                     $move_path,
                     $my_get_move,
                     $group_properties['directory']
                 );
             } else {
-
-                echo '<legend>'.get_lang('Move').'</legend>';
-                echo build_move_to_selector($folders, $move_path, $my_get_move, $group_properties['directory']);
+                $moveForm .= '<legend>'.get_lang('Move').'</legend>';
+                $moveForm .= build_move_to_selector($folders, $move_path, $my_get_move, $group_properties['directory']);
             }
         }
     }
@@ -831,15 +891,16 @@ if ($is_allowed_to_edit ||
 
         if (!$is_allowed_to_edit) {
             if (DocumentManager::check_readonly($courseInfo, api_get_user_id(), $_POST['move_file'])) {
-                api_not_allowed();
+                api_not_allowed(true);
             }
         }
 
         if (api_is_coach()) {
             if (!DocumentManager::is_visible_by_id($_POST['move_file'], $courseInfo, $session_id, api_get_user_id())) {
-                api_not_allowed();
+                api_not_allowed(true);
             }
         }
+
         // Get the document data from the ID
         $document_to_move = DocumentManager::get_document_data_by_id(
             $_POST['move_file'],
@@ -875,7 +936,7 @@ if ($is_allowed_to_edit ||
                         null,
                         $session_id
                     );
-                    Display::display_confirmation_message(get_lang('DirMv'));
+                    $message = Display::return_message(get_lang('DirMv'), 'confirmation');
                 } elseif (is_file($real_path_target)) {
                     api_item_property_update(
                         $courseInfo,
@@ -889,7 +950,7 @@ if ($is_allowed_to_edit ||
                         null,
                         $session_id
                     );
-                    Display::display_confirmation_message(get_lang('DocMv'));
+                    $message = Display::return_message(get_lang('DocMv'), 'confirmation');
                 }
 
                 // Set the current path
@@ -898,17 +959,18 @@ if ($is_allowed_to_edit ||
             } else {
                 if ($fileExist) {
                     if (is_dir($real_path_target)) {
-                        Display::display_error_message(get_lang('DirExists'));
+                        $message = Display::return_message(get_lang('DirExists'), 'error');
                     } elseif (is_file($real_path_target)) {
-                        Display::display_error_message(get_lang('FileExists'));
+                        $message = Display::return_message(get_lang('FileExists'), 'v');
                     }
                 } else {
-                    Display::display_error_message(get_lang('Impossible'));
+                    $message = Display::return_message(get_lang('Impossible'), 'error');
                 }
             }
         } else {
-            Display::display_error_message(get_lang('Impossible'));
+            $message = Display::return_message(get_lang('Impossible'), 'error');
         }
+        Session::write('message', $message);
     }
 }
 
@@ -918,60 +980,10 @@ if ($is_allowed_to_edit ||
     $group_member_with_upload_rights ||
     is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id)
 ) {
-    if (isset($_GET['deleteid'])) {
-        if (!$is_allowed_to_edit) {
-            if (api_is_coach()) {
-                if (!DocumentManager::is_visible_by_id(
-                    $_GET['deleteid'],
-                    $courseInfo,
-                    $session_id,
-                    api_get_user_id())
-                ) {
-                    api_not_allowed();
-                }
-            }
-
-            if (DocumentManager::check_readonly(
-                $courseInfo,
-                api_get_user_id(),
-                '',
-                $_GET['deleteid'],
-                true)
-            ) {
-                api_not_allowed();
-            }
-        }
-
-        $documentInfo = DocumentManager::get_document_data_by_id(
-            $_GET['deleteid'],
-            $courseInfo['code'],
-            false,
-            $session_id
-        );
-
-        // Check whether the document is in the database.
-        if (!empty($documentInfo)) {
-            if (DocumentManager::delete_document(
-                $courseInfo,
-                null,
-                $base_work_dir,
-                api_get_session_id(),
-                $_GET['deleteid'])
-            ) {
-                $certificateId = isset($_GET['delete_certificate_id']) ? $_GET['delete_certificate_id'] : null;
-                DocumentManager::remove_attach_certificate(api_get_course_id(), $certificateId);
-                Display::display_confirmation_message(get_lang('DocDeleted'));
-            } else {
-                Display::display_warning_message(get_lang('DocDeleteError'));
-            }
-        } else {
-            Display::display_warning_message(get_lang('FileNotFound'));
-        }
-    }
-
     if (isset($_POST['action']) && isset($_POST['ids'])) {
         $files = $_POST['ids'];
         $readonlyAlreadyChecked = false;
+        $messages = null;
         foreach ($files as $documentId) {
             $items = array('/audio', '/flash', '/images', '/shared_folder', '/video', '/chat_files', '/certificates');
             $data = DocumentManager::get_document_data_by_id($documentId, $courseInfo['code']);
@@ -979,10 +991,6 @@ if ($is_allowed_to_edit ||
                 // exclude system directories (do not allow deletion)
                 continue;
             } else {
-
-                //$documentId = DocumentManager::get_document_id($courseInfo, $path, $session_id);
-                //$data = DocumentManager::get_document_data_by_id($documentId, $courseInfo['code'], false, $session_id);
-
                 switch ($_POST['action']) {
                     case 'set_invisible':
                         $visibilityCommand = 'invisible';
@@ -998,9 +1006,9 @@ if ($is_allowed_to_edit ||
                             null,
                             $session_id
                         )) {
-                            Display::display_confirmation_message(get_lang('VisibilityChanged').': '.$data['path']);
+                            $messages .= Display::return_message(get_lang('VisibilityChanged').': '.$data['path'], 'confirmation');
                         } else {
-                            Display::display_error_message(get_lang('ViModProb'));
+                            $messages .= Display::return_message(get_lang('ViModProb'), 'error');
                         }
                         break;
                     case 'set_visible':
@@ -1017,9 +1025,9 @@ if ($is_allowed_to_edit ||
                             null,
                             $session_id
                         )) {
-                            Display::display_confirmation_message(get_lang('VisibilityChanged').': '.$data['path']);
+                            $messages .= Display::return_message(get_lang('VisibilityChanged').': '.$data['path'], 'confirmation');
                         } else {
-                            Display::display_error_message(get_lang('ViModProb'));
+                            $messages .= Display::return_message(get_lang('ViModProb'), 'error');
                         }
                         break;
                     case 'delete':
@@ -1038,7 +1046,7 @@ if ($is_allowed_to_edit ||
                                         $session_id
                                     )
                                     ) {
-                                        Display::display_error_message(get_lang('CantDeleteReadonlyFiles'));
+                                        $messages .= Display::return_message(get_lang('CantDeleteReadonlyFiles'), 'error');
                                         break 2;
                                     }
                                 }
@@ -1051,19 +1059,24 @@ if ($is_allowed_to_edit ||
                             null,
                             $base_work_dir,
                             $session_id,
-                            $documentId
+                            $documentId,
+                            $groupId
                         );
-
                         if (!empty($deleteDocument)) {
-                            Display::display_confirmation_message(get_lang('DocDeleted').': '.$data['path']);
+                            $messages .= Display::return_message(get_lang('DocDeleted').': '.$data['path'], 'confirmation');
                         }
                         break;
                 }
             }
-        }
+        } // endforeach
+
+        Session::write('message', $messages);
     }
 }
 
+$dirForm = null;
+
+
 /* 	CREATE DIRECTORY */
 //Only teacher and all users into their group and any user into his/her shared folder
 if ($is_allowed_to_edit ||
@@ -1076,7 +1089,7 @@ if ($is_allowed_to_edit ||
         $post_dir_name = $_POST['dirname'];
 
         if ($post_dir_name == '../' || $post_dir_name == '.' || $post_dir_name == '..') {
-            Display::display_error_message(get_lang('CannotCreateDir'));
+            $message = Display::return_message(get_lang('CannotCreateDir'), 'error');
         } else {
             if (!empty($_POST['dir_id'])) {
                 // Get the document data from the ID
@@ -1120,19 +1133,20 @@ if ($is_allowed_to_edit ||
                 );
 
                 if ($created_dir) {
-                    Display::display_confirmation_message('<span title="'.$created_dir.'">'.get_lang('DirCr').'</span>', false);
+                    $message = Display::return_message(get_lang('DirCr').' '.$created_dir, 'confirmation');
                 } else {
-                    Display::display_error_message(get_lang('CannotCreateDir'));
+                    $message = Display::return_message(get_lang('CannotCreateDir'), 'error');
                 }
             } else {
-                Display::display_error_message(get_lang('CannotCreateDir'));
+                $message = Display::return_message(get_lang('CannotCreateDir'), 'error');
             }
         }
+        Session::write('message', $message);
     }
 
     // Show them the form for the directory name
     if (isset($_GET['createdir'])) {
-        echo create_dir_form($document_id);
+        $dirForm = create_dir_form($document_id);
     }
 }
 
@@ -1154,11 +1168,11 @@ if ($is_allowed_to_edit) {
         if (!$is_allowed_to_edit) {
             if (api_is_coach()) {
                 if (!DocumentManager::is_visible_by_id($update_id, $courseInfo, $session_id, api_get_user_id())) {
-                    api_not_allowed();
+                    api_not_allowed(true);
                 }
             }
             if (DocumentManager::check_readonly($courseInfo, api_get_user_id(), '', $update_id)) {
-                api_not_allowed();
+                api_not_allowed(true);
             }
         }
 
@@ -1176,12 +1190,14 @@ if ($is_allowed_to_edit) {
             $session_id)
         ) {
             //don't use ViMod because firt is load ViMdod (Gradebook). VisibilityChanged (trad4all)
-            Display::display_confirmation_message(get_lang('VisibilityChanged'));
+            $message = Display::return_message(get_lang('VisibilityChanged'), 'confirmation');
         } else {
-            Display::display_error_message(get_lang('ViModProb'));
+            $message = Display::return_message(get_lang('ViModProb'), 'error');
         }
+        Session::write('message', $message);
     }
 }
+$templateForm = null;
 
 /* 	TEMPLATE ACTION */
 //Only teacher and all users into their group
@@ -1194,20 +1210,18 @@ if ($is_allowed_to_edit ||
         $document_id_for_template = intval($_GET['add_as_template']);
 
         // Create the form that asks for the directory name
-        $template_text = '<form name="set_document_as_new_template" enctype="multipart/form-data" action="'.api_get_self().'?add_as_template='.$document_id_for_template.'" method="post">';
-        $template_text .= '<input type="hidden" name="curdirpath" value="'.$curdirpath.'" />';
-        $template_text .= '<table><tr><td>';
-        $template_text .= get_lang('TemplateName').' : </td>';
-        $template_text .= '<td><input type="text" name="template_title" /></td></tr>';
-        //$template_text .= '<tr><td>'.get_lang('TemplateDescription').' : </td>';
-        //$template_text .= '<td><textarea name="template_description"></textarea></td></tr>';
-        $template_text .= '<tr><td>'.get_lang('TemplateImage').' : </td>';
-        $template_text .= '<td><input type="file" name="template_image" id="template_image" /></td></tr>';
-        $template_text .= '</table>';
-        $template_text .= '<button type="submit" class="add" name="create_template">'.get_lang('CreateTemplate').'</button>';
-        $template_text .= '</form>';
-        // Show the form
-        Display::display_normal_message($template_text, false);
+        $templateForm .= '<form name="set_document_as_new_template" enctype="multipart/form-data" action="'.api_get_self().'?add_as_template='.$document_id_for_template.'" method="post">';
+        $templateForm .= '<input type="hidden" name="curdirpath" value="'.$curdirpath.'" />';
+        $templateForm .= '<table><tr><td>';
+        $templateForm .= get_lang('TemplateName').' : </td>';
+        $templateForm .= '<td><input type="text" name="template_title" /></td></tr>';
+        //$templateForm .= '<tr><td>'.get_lang('TemplateDescription').' : </td>';
+        //$templateForm .= '<td><textarea name="template_description"></textarea></td></tr>';
+        $templateForm .= '<tr><td>'.get_lang('TemplateImage').' : </td>';
+        $templateForm .= '<td><input type="file" name="template_image" id="template_image" /></td></tr>';
+        $templateForm .= '</table>';
+        $templateForm .= '<button type="submit" class="add" name="create_template">'.get_lang('CreateTemplate').'</button>';
+        $templateForm .= '</form>';
     } elseif (isset($_GET['add_as_template']) && isset($_POST['create_template'])) {
 
         $document_id_for_template = intval(Database::escape_string($_GET['add_as_template']));
@@ -1223,9 +1237,9 @@ if ($is_allowed_to_edit ||
                 api_get_permissions_for_new_directories()
             );
         }
+
         // Upload the file
         if (!empty($_FILES['template_image']['name'])) {
-
             require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
             $upload_ok = process_uploaded_file($_FILES['template_image']);
 
@@ -1265,7 +1279,8 @@ if ($is_allowed_to_edit ||
             $user_id,
             $new_file_name
         );
-        Display::display_confirmation_message(get_lang('DocumentSetAsTemplate'));
+        $message = Display::return_message(get_lang('DocumentSetAsTemplate'), 'confirmation');
+        Session::write('message', $message);
     }
 
     if (isset($_GET['remove_as_template'])) {
@@ -1276,18 +1291,25 @@ if ($is_allowed_to_edit ||
             $course_code,
             $user_id
         );
-        Display::display_confirmation_message(get_lang('DocumentUnsetAsTemplate'));
+        $message = Display::return_message(get_lang('DocumentUnsetAsTemplate'), 'confirmation');
+        Session::write('message', $message);
     }
+
 }
 
 // END ACTION MENU
 // Attach certificate in the gradebook
-if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' && isset($_GET['set_certificate']) && $_GET['set_certificate'] == strval(intval($_GET['set_certificate']))) {
+if (isset($_GET['curdirpath']) &&
+    $_GET['curdirpath'] == '/certificates' &&
+    isset($_GET['set_certificate']) &&
+    $_GET['set_certificate'] == strval(intval($_GET['set_certificate']))
+) {
     if (isset($_GET['cidReq'])) {
         $course_id = Security::remove_XSS($_GET['cidReq']); // course id
         $document_id = Security::remove_XSS($_GET['set_certificate']); // document id
         DocumentManager::attach_gradebook_certificate($course_id, $document_id);
-        Display::display_normal_message(get_lang('IsDefaultCertificate'));
+        $message = Display::return_message(get_lang('IsDefaultCertificate'), 'normal');
+        Session::write('message', $message);
     }
 }
 
@@ -1337,32 +1359,35 @@ if (!isset($folders) || $folders === false) {
     $folders = array();
 }
 
-echo '<div id="appletplace"></div>';
-echo '<div class="actions">';
+//echo '<div id="appletplace"></div>';
+$actions = '<div class="actions">';
 if (!$is_certificate_mode) {
     /* BUILD SEARCH FORM */
-    echo '<span style="display:inline-block;">';
-    $form = new FormValidator('search_document', 'get', '', '', null, false);
+    $actions .= '<span style="display:inline-block;">';
+    $form = new FormValidator('search_document', 'get', api_get_self().'?'.api_get_cidreq());
     $renderer = & $form->defaultRenderer();
     $renderer->setElementTemplate('<span>{element}</span> ');
     $form->add_textfield('keyword', '', false, array('class' => 'span2'));
+    $form->addElement('hidden', 'cidReq', api_get_course_id());
+    $form->addElement('hidden', 'id_session', api_get_session_id());
+    $form->addElement('hidden', 'gidReq', $groupId);
     $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
-    $form->display();
-    echo '</span>';
+    $actions .= $form->return_form();
+    $actions .= '</span>';
 }
 
 /* GO TO PARENT DIRECTORY */
 if ($curdirpath != '/' && $curdirpath != $group_properties['directory'] && !$is_certificate_mode) {
-    echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$parent_id.'">';
-    echo Display::display_icon('folder_up.png', get_lang('Up'), '', ICON_SIZE_MEDIUM);
-    echo '</a>';
+    $actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$parent_id.'">';
+    $actions .= Display::return_icon('folder_up.png', get_lang('Up'), '', ICON_SIZE_MEDIUM);
+    $actions .= '</a>';
 }
 
 if ($is_certificate_mode && $curdirpath != '/certificates') {
-    ?>
-    <a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq(); ?>&amp;curdirpath=<?php echo urlencode((dirname($curdirpath) == '\\') ? '/' : dirname($curdirpath)); ?>">
-    <?php Display::display_icon('folder_up.png', get_lang('Up'), '', ICON_SIZE_MEDIUM); ?></a>
-    <?php
+    $actions .= Display::url(
+        Display::return_icon('folder_up.png', get_lang('Up'), '', ICON_SIZE_MEDIUM),
+        api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath
+    );
 }
 
 $column_show = array();
@@ -1371,86 +1396,90 @@ if ($is_allowed_to_edit ||
     $group_member_with_upload_rights ||
     is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id)
 ) {
-
     // TODO:check enable more options for shared folders
     /* CREATE NEW DOCUMENT OR NEW DIRECTORY / GO TO UPLOAD / DOWNLOAD ZIPPED FOLDER */
 
     // Create new document
 
     if (!$is_certificate_mode) {
-        ?>
-        <a href="create_document.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-        <?php Display::display_icon('new_document.png', get_lang('CreateDoc'), '', ICON_SIZE_MEDIUM); ?></a>
-        <?php
+        $actions .= Display::url(
+            Display::return_icon('new_document.png', get_lang('CreateDoc'), '', ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH).'document/create_document.php?'.api_get_cidreq().'&id='.$document_id
+        );
+
         // Create new draw
         if (api_get_setting('enabled_support_svg') == 'true') {
             if (api_browser_support('svg')) {
-                ?>
-                <a href="create_draw.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-                <?php Display::display_icon('new_draw.png', get_lang('Draw'), '', ICON_SIZE_MEDIUM); ?></a>&nbsp;
-                <?php
+                $actions .= Display::url(
+                    Display::return_icon('new_draw.png', get_lang('Draw'), '', ICON_SIZE_MEDIUM),
+                    api_get_path(WEB_CODE_PATH).'document/create_draw.php?'.api_get_cidreq().'&id='.$document_id
+                );
             } else {
-                Display::display_icon('new_draw_na.png', get_lang('BrowserDontSupportsSVG'), '', ICON_SIZE_MEDIUM);
+                $actions .= Display::return_icon('new_draw_na.png', get_lang('BrowserDontSupportsSVG'), '', ICON_SIZE_MEDIUM);
             }
         }
 
         // Create new paint
         if (api_get_setting('enabled_support_pixlr') == 'true') {
-            ?>
-            <a href="create_paint.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-            <?php Display::display_icon('new_paint.png', get_lang('PhotoRetouching'), '', ICON_SIZE_MEDIUM); ?></a>
-            <?php
+            $actions .= Display::url(
+                Display::return_icon('new_paint.png', get_lang('PhotoRetouching'), '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/create_paint.php?'.api_get_cidreq().'&id='.$document_id
+            );
         }
 
         // Record an image clip from my webcam
         if (api_get_setting('enable_webcam_clip') == 'true') {
-            ?>
-            <a href="webcam_clip.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-            <?php Display::display_icon('webcam.png', get_lang('WebCamClip'), '', ICON_SIZE_MEDIUM); ?></a>
-            <?php
+            $actions .= Display::url(
+                Display::return_icon('webcam.png', get_lang('WebCamClip'), '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/webcam_clip.php?'.api_get_cidreq().'&id='.$document_id
+            );
         }
 
         // Record audio (nanogong)
         if (api_get_setting('enable_nanogong') == 'true') {
-            ?>
-            <a href="record_audio.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-            <?php Display::display_icon('new_recording.png', get_lang('RecordMyVoice'), '', ICON_SIZE_MEDIUM); ?></a>
-            <?php
+            $actions .= Display::url(
+                Display::return_icon('new_recording.png', get_lang('RecordMyVoice'), '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/record_audio.php?'.api_get_cidreq().'&id='.$document_id
+            );
         }
 
         // Record  audio (wami record)
         if (api_get_setting('enable_wami_record') == 'true') {
-            ?>
-            <a href="record_audio_wami.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>">
-            <?php Display::display_icon('new_recording.png', get_lang('RecordMyVoice'), '', ICON_SIZE_MEDIUM); ?></a>
-            <?php
+            $actions .= Display::url(
+                Display::return_icon('new_recording.png', get_lang('RecordMyVoice'), '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/record_audio_wami.php?'.api_get_cidreq().'&id='.$document_id
+            );
         }
 
         // Create new audio from text
         if (api_get_setting('enabled_text2audio') == 'true') {
             $dt2a = 'google';
             $req_dt2a = '&amp;dt2a='.$dt2a;
-            ?>
-            <a href="create_audio.php?<?php echo api_get_cidreq(); ?>&amp;id=<?php echo $document_id.$req_dt2a; ?>">
-            <?php Display::display_icon('new_sound.png', get_lang('CreateAudio'), '', ICON_SIZE_MEDIUM); ?></a>
-            <?php
+            $actions .= Display::url(
+                Display::return_icon('new_sound.png', get_lang('CreateAudio'), '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/create_audio.php?'.api_get_cidreq().'&id='.$document_id.$req_dt2a
+            );
         }
     }
 
     // Create new certificate
     if ($is_certificate_mode) {
-        ?>
-        <a href="create_document.php?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>&certificate=true&selectcat=<?php echo $selectcat; ?>">
-        <?php Display::display_icon('new_certificate.png', get_lang('CreateCertificate'), '', ICON_SIZE_MEDIUM); ?></a>
-        <?php
+        $actions .= Display::url(
+            Display::return_icon('new_certificate.png', get_lang('CreateCertificate'), '', ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH).'document/create_document.php?'.api_get_cidreq().'&id='.$document_id.'&certificate=true&selectcat='.$selectcat
+        );
     }
     // File upload link
     if ($is_certificate_mode) {
-        echo '<a href="upload.php?'.api_get_cidreq().'&id='.$current_folder_id.'">';
-        echo Display::display_icon('upload_certificate.png', get_lang('UploadCertificate'), '', ICON_SIZE_MEDIUM).'</a>';
+        $actions .= Display::url(
+            Display::return_icon('upload_certificate.png', get_lang('UploadCertificate'), '', ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH).'document/upload.php?'.api_get_cidreq().'&id='.$current_folder_id
+        );
     } else {
-        echo '<a href="upload.php?'.api_get_cidreq().'&id='.$current_folder_id.'">';
-        echo Display::display_icon('upload_file.png', get_lang('UplUploadDocument'), '', ICON_SIZE_MEDIUM).'</a>';
+        $actions .= Display::url(
+            Display::return_icon('upload_file.png', get_lang('UplUploadDocument'), '', ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH).'document/upload.php?'.api_get_cidreq().'&id='.$current_folder_id
+        );
     }
 
     /*echo '<a href="#" id="jcapture">';
@@ -1458,10 +1487,10 @@ if ($is_allowed_to_edit ||
 
     // Create directory
     if (!$is_certificate_mode) {
-        ?>
-        <a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq(); ?>&id=<?php echo $document_id; ?>&createdir=1">
-        <?php Display::display_icon('new_folder.png', get_lang('CreateDir'), '', ICON_SIZE_MEDIUM); ?></a>
-        <?php
+        $actions .= Display::url(
+            Display::return_icon('new_folder.png', get_lang('CreateDir'), '', ICON_SIZE_MEDIUM),
+            api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq().'&id='.$document_id.'&createdir=1'
+        );
     }
 }
 
@@ -1574,7 +1603,10 @@ if (isset($documentAndFolders) && is_array($documentAndFolders)) {
                 $countedPaths[$document_data['path']] = true;
             }
 
-            if ((isset($_GET['keyword']) && search_keyword($document_name, $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
+            if ((isset($_GET['keyword']) &&
+                search_keyword($document_name, $_GET['keyword'])) ||
+                !isset($_GET['keyword']) || empty($_GET['keyword'])
+            ) {
                 $sortable_data[] = $row;
             }
         }
@@ -1589,21 +1621,20 @@ if (!is_null($documentAndFolders)) {
     global $total_size;
     if (!$is_certificate_mode && $total_size != 0
         && (api_get_setting('students_download_folders') == 'true'
-            || api_is_allowed_to_edit()
-            || api_is_platform_admin()
+        || api_is_allowed_to_edit()
+        || api_is_platform_admin()
         )
     ) {
-
         //for student does not show icon into other shared folder, and does not show into main path (root)
         if (is_my_shared_folder(api_get_user_id(), $curdirpath, $session_id)
             && $curdirpath != '/'
             || api_is_allowed_to_edit()
             || api_is_platform_admin()
         ) {
-            echo '<a href="'.api_get_self().'?'.api_get_cidreq().
-                '&amp;action=downloadfolder&amp;id='.$document_id.'">'.
-                Display::return_icon('save_pack.png', get_lang('Save').' (ZIP)', '', ICON_SIZE_MEDIUM).
-                '</a>';
+            $actions .= Display::url(
+                Display::return_icon('save_pack.png', get_lang('Save').' (ZIP)', '', ICON_SIZE_MEDIUM),
+                api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq().'&action=downloadfolder&id='.$document_id
+            );
         }
     }
 }
@@ -1611,23 +1642,20 @@ if (!is_null($documentAndFolders)) {
 // Slideshow by Patrick Cool, May 2004
 require 'document_slideshow.inc.php';
 if ($image_present && !isset($_GET['keyword'])) {
-    echo '<a href="slideshow.php?'.
-        api_get_cidreq().
-        '&amp;curdirpath='.$curdirpathurl.'">'.
-        Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM).'</a>';
+    $actions .= Display::url(
+        Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM),
+        api_get_path(WEB_CODE_PATH).'document/slideshow.php?'.api_get_cidreq().'&curdirpath='.$curdirpathurl
+    );
 }
 
 if (api_is_allowed_to_edit(null, true)) {
-    echo '<a href="document_quota.php?'.api_get_cidreq().'">'.
-        Display::return_icon('percentage.png', get_lang('DocumentQuota'), '', ICON_SIZE_MEDIUM).
-        '</a>';
+    $actions .= Display::url(
+        Display::return_icon('percentage.png', get_lang('DocumentQuota'), '', ICON_SIZE_MEDIUM),
+        api_get_path(WEB_CODE_PATH).'document/document_quota.php?'.api_get_cidreq()
+    );
 }
-echo '</div>'; //end actions
-
+$actions .= '</div>';
 
-if (isset($message)) {
-    echo $message;
-}
 if (!empty($moveTo)) {
     $document_id = DocumentManager::get_document_id($courseInfo, $moveTo);
 }
@@ -1636,8 +1664,10 @@ if (isset($_GET['createdir']) && isset($_POST['dirname']) && $_POST['dirname'] !
     $post_dir_name = $_POST['dirname'];
     $document_id = DocumentManager::get_document_id($courseInfo, $_POST['dirname']);
 }
+$selector = null;
+
 if (!$is_certificate_mode) {
-    echo build_directory_selector(
+    $selector = build_directory_selector(
         $folders,
         $document_id,
         (isset($group_properties['directory']) ? $group_properties['directory'] : array()),
@@ -1735,6 +1765,31 @@ if (count($documentAndFolders) > 1) {
         $table->set_form_actions($form_action, 'ids');
     }
 }
+
+Display::display_header('', 'Doc');
+
+/* Introduction section (editable by course admins) */
+
+if (!empty($groupId)) {
+    Display::display_introduction_section(TOOL_DOCUMENT.$groupId);
+} else {
+    Display::display_introduction_section(TOOL_DOCUMENT);
+}
+
+$message = Session::read('message');
+
+if (!empty($message)) {
+    echo $message;
+}
+
+Session::erase('message');
+
+echo $actions;
+echo $templateForm;
+echo $moveForm;
+echo $dirForm;
+echo $selector;
+
 $table->display();
 
 if (count($documentAndFolders) > 1) {

+ 2 - 2
main/document/upload.php

@@ -202,10 +202,10 @@ if (!empty($_FILES)) {
 echo '<div class="actions">';
 // Link back to the documents overview
 if ($is_certificate_mode) {
-    echo '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'">'.
+    echo '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'&'.api_get_cidreq().'">'.
             Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
 } else {
-    echo '<a href="document.php?id='.$document_id.'">'.
+    echo '<a href="document.php?id='.$document_id.'&'.api_get_cidreq().'">'.
             Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
 }
 

+ 3 - 3
main/exercice/admin.php

@@ -451,7 +451,7 @@ $inATest = isset($exerciseId) && $exerciseId > 0;
 if ($inATest) {
     echo '<div class="actions">';
     if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
-        echo '<a href="admin.php?exerciseId='.$exerciseId.'">'.Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
+        echo '<a href="admin.php?exerciseId='.$exerciseId.'&'.api_get_cidReq().'">'.Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
 
     if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) &&  !isset($_GET['editQuestion'])) {
         echo '<a href="exercice.php?'.api_get_cidReq().'">'.Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
@@ -499,11 +499,11 @@ if ($newQuestion || $editQuestion) {
 	// statement management
 	$type = Security::remove_XSS($_REQUEST['answerType']);
 	echo '<input type="hidden" name="Type" value="'.$type.'" />';
-        
+
         if ($newQuestion == 'yes') {
             $objExercise->edit_exercise_in_lp = true;
         }
-        
+
 	require 'question_admin.inc.php';
 }
 

+ 45 - 21
main/exercice/exercise.class.php

@@ -3387,12 +3387,12 @@ class Exercise {
                         </tr>
                     </table>';
         $open_question_list = null;
-        
-        $msg    = str_replace("#email#",       $user_info['email'],$msg);       
+
+        $msg    = str_replace("#email#",       $user_info['email'],$msg);
         $msg1   = str_replace("#exercise#",    $this->exercise, $msg);
         $msg    = str_replace("#firstName#",   $user_info['firstname'],$msg1);
         $msg1   = str_replace("#lastName#",    $user_info['lastname'],$msg);
-        
+
         $msg    = str_replace("#course#",      $courseInfo['name'],$msg1);
 
         if ($origin != 'learnpath') {
@@ -3402,20 +3402,20 @@ class Exercise {
         $msg1 = str_replace("#url#", $url_email, $msg);
         $mail_content = $msg1;
         $subject = get_lang('ExerciseAttempted');
-         
+
         $teachers = array();
         if (api_get_session_id()) {
             $teachers = CourseManager::get_coach_list_from_course_code($coursecode, api_get_session_id());
         } else {
             $teachers = CourseManager::get_teacher_list_from_course_code($coursecode);
         }
-         
+
         if (!empty($teachers)) {
             foreach ($teachers as $user_id => $teacher_data) {
                 MessageManager::send_message_simple($user_id, $subject, $mail_content);
             }
         }
-        
+
     }
 
     /**
@@ -3628,22 +3628,35 @@ class Exercise {
      * @todo this was function was added due the import exercise via CSV
      * @return    int New exercise ID
      */
-    function create_quiz ($title, $expired_time = 0, $type = 2, $random = 0, $active = 1, $results_disabled = 0, $max_attempt = 0, $feedback = 3) {
+    public function createExercise(
+        $title,
+        $expired_time = 0,
+        $type = 2,
+        $random = 0,
+        $active = 1,
+        $results_disabled = 0,
+        $max_attempt = 0,
+        $feedback = 3,
+        $propagateNegative = 0
+    ) {
         $tbl_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
-        $expired_time = filter_var($expired_time,FILTER_SANITIZE_NUMBER_INT);
-        $type = filter_var($type,FILTER_SANITIZE_NUMBER_INT);
-        $random = filter_var($random,FILTER_SANITIZE_NUMBER_INT);
-        $active = filter_var($active,FILTER_SANITIZE_NUMBER_INT);
-        $results_disabled = filter_var($results_disabled,FILTER_SANITIZE_NUMBER_INT);
-        $max_attempt = filter_var($max_attempt,FILTER_SANITIZE_NUMBER_INT);
-        $feedback = filter_var($feedback,FILTER_SANITIZE_NUMBER_INT);
-        $sid = api_get_session_id();
+        $type = intval($type);
+        $random = intval($random);
+        $active = intval($active);
+        $results_disabled = intval($results_disabled);
+        $max_attempt = intval($max_attempt);
+        $feedback = intval($feedback);
+        $expired_time = intval($expired_time);
+        $title = Database::escape_string($title);
+        $propagateNegative = intval($propagateNegative);
+        $sessionId = api_get_session_id();
         $course_id = api_get_course_int_id();
         // Save a new quiz
-        $sql = "INSERT INTO $tbl_quiz (c_id, title,type,random,active,results_disabled, max_attempt,start_time,end_time,feedback_type,expired_time, session_id) ".
-            " VALUES('$course_id', '".Database::escape_string($title)."',$type,$random,$active, $results_disabled,$max_attempt,'','',$feedback,$expired_time,$sid)";
-        $rs = Database::query($sql);
-        $quiz_id = Database::get_last_insert_id();
+        $sql = "INSERT INTO $tbl_quiz (c_id, title, type, random, active, results_disabled, max_attempt, start_time,end_time,feedback_type,expired_time, session_id, propagate_neg) ".
+            " VALUES('$course_id', '".$title."', $type, $random, $active, $results_disabled, $max_attempt,'','', $feedback, $expired_time, $sessionId, $propagateNegative)";
+        Database::query($sql);
+        $quiz_id = Database::insert_id();
+
         return $quiz_id;
     }
 
@@ -3660,15 +3673,26 @@ class Exercise {
     public function get_exercise_result($exe_id) {
         $result = array();
         $track_exercise_info = get_exercise_track_exercise_info($exe_id);
+
         if (!empty($track_exercise_info)) {
+            $totalScore = 0;
             $objExercise = new Exercise();
             $objExercise->read($track_exercise_info['exe_exo_id']);
             if (!empty($track_exercise_info['data_tracking'])) {
                 $question_list = explode(',', $track_exercise_info['data_tracking']);
             }
             foreach ($question_list as $questionId) {
-                $question_result = $objExercise->manage_answer($exe_id, $questionId, '','exercise_show', array(), false, true, false, $objExercise->selectPropagateNeg());
-                $questionScore   = $question_result['score'];
+                $question_result = $objExercise->manage_answer(
+                    $exe_id,
+                    $questionId,
+                    '',
+                    'exercise_show',
+                    array(),
+                    false,
+                    true,
+                    false,
+                    $objExercise->selectPropagateNeg()
+                );
                 $totalScore      += $question_result['score'];
             }
 

+ 12 - 14
main/exercice/matching.class.php

@@ -12,7 +12,6 @@
 /**
  * Code
  */
-if(!class_exists('Matching')):
 /**
  * Matching questions type class
  * @package chamilo.exercise
@@ -101,9 +100,9 @@ class Matching extends Question {
 							'.get_lang('Weighting').'
 						</th>
 					</tr>';
-        
+
 		$form -> addElement ('label', get_lang('MakeCorrespond').'<br /> <img src="../img/fill_field.png">', $html);
-		
+
 		if ($nb_matches < 1) {
 			$nb_matches = 1;
 			Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
@@ -125,13 +124,13 @@ class Matching extends Question {
 
 		$form -> addElement ('html', '</table></div></div>');
 		$group = array();
-		
+
 		if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
 			$group[] = $form->createElement('submit', 'lessMatches', get_lang('DelElem'),'class="btn minus"');
 			$group[] = $form->createElement('submit', 'moreMatches', get_lang('AddElem'),'class="btn plus"');
 		} else {
             $group[] = $form->createElement('style_submit_button', 'moreMatches', get_lang('AddElem'),'class="btn plus"');
-			$group[] = $form->createElement('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="btn minus"');			
+			$group[] = $form->createElement('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="btn minus"');
 		}
 
 		$form -> addGroup($group);
@@ -171,18 +170,18 @@ class Matching extends Question {
 
 		if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
             // setting the save button here and not in the question class.php
-            $group[] = $form->createElement('submit','submitQuestion',$text, 'class="'.$class.'"');            
+            $group[] = $form->createElement('submit','submitQuestion',$text, 'class="'.$class.'"');
             $group[] = $form->createElement('submit', 'lessOptions', get_lang('DelElem'),'class="minus"');
-            $group[] = $form->createElement('submit', 'moreOptions',get_lang('AddElem'),'class="plus"');			
+            $group[] = $form->createElement('submit', 'moreOptions',get_lang('AddElem'),'class="plus"');
 		} else {
-            // setting the save button here and not in the question class.php            
+            // setting the save button here and not in the question class.php
             $group[] = $form->createElement('style_submit_button', 'lessOptions', get_lang('DelElem'),'class="minus"');
             $group[] = $form->createElement('style_submit_button', 'moreOptions',get_lang('AddElem'),' class="plus"');
             $group[] = $form->createElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
 		}
-		
+
 		$form -> addGroup($group);
-		
+
 		if (!empty($this -> id)) {
 			$form -> setDefaults($defaults);
 		} else {
@@ -190,7 +189,7 @@ class Matching extends Question {
 				$form -> setDefaults($defaults);
 			}
 		}
-		
+
 		$form->setConstants(array('nb_matches' => $nb_matches,'nb_options' => $nb_options));
 	}
 
@@ -227,10 +226,10 @@ class Matching extends Question {
 		$objAnswer->save();
 		$this->save();
 	}
-	
+
 	function return_header($feedback_type = null, $counter = null, $score = null) {
 	    $header = parent::return_header($feedback_type, $counter, $score);
-        $header .= '<table class="'.$this->question_table_class .'">';            
+        $header .= '<table class="'.$this->question_table_class .'">';
         $header .= '<tr>
                 <th>'.get_lang('ElementList').'</th>
                 <th>'.get_lang('CorrespondsTo').'</th>
@@ -238,4 +237,3 @@ class Matching extends Question {
         return $header;
 	}
 }
-endif;

+ 11 - 14
main/exercice/multiple_answer.class.php

@@ -8,8 +8,6 @@
 /**
  * Code
  */
-if(!class_exists('MultipleAnswer')):
-
 /**
 	CLASS MultipleAnswer
  *
@@ -103,12 +101,12 @@ class MultipleAnswer extends Question {
 				$defaults['weighting[2]'] = -5;
 			}
 			$renderer = & $form->defaultRenderer();
-			            
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');        
+
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
 
 			$answer_number=$form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
 			$answer_number->freeze();
@@ -137,13 +135,13 @@ class MultipleAnswer extends Question {
 			//ie6 fix
 			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
                 $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
-                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');				
+                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
                 $form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
 			} else {
-                // setting the save button here and not in the question class.php                
+                // setting the save button here and not in the question class.php
                 $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
-                $form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');				
+                $form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
 			}
 		}
 		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
@@ -200,10 +198,10 @@ class MultipleAnswer extends Question {
         $this->updateWeighting($questionWeighting);
         $this->save();
 	}
-	
+
 	function return_header($feedback_type = null, $counter = null, $score = null) {
 	    $header = parent::return_header($feedback_type, $counter, $score);
-	    $header .= '<table class="'.$this->question_table_class .'">			
+	    $header .= '<table class="'.$this->question_table_class .'">
 			<tr>
 				<th>'.get_lang("Choice").'</th>
 				<th>'. get_lang("ExpectedChoice").'</th>
@@ -213,4 +211,3 @@ class MultipleAnswer extends Question {
         return $header;
 	}
 }
-endif;

+ 25 - 27
main/exercice/multiple_answer_combination.class.php

@@ -9,8 +9,6 @@
 /**
  * Code
  */
-if(class_exists('MultipleAnswerCombination')) { return true; }
-
 /**
 	CLASS MultipleAnswer
  *
@@ -54,8 +52,8 @@ class MultipleAnswerCombination extends Question {
 						</th>
 						<th width="50%">
 							'.get_lang('Answer').'
-						</th>';				
-						// show column comment when feedback is enable						
+						</th>';
+						// show column comment when feedback is enable
                         $html .='<th>'.get_lang('Comment').'</th>';
 						$html .= '</tr>';
         $form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
@@ -72,11 +70,11 @@ class MultipleAnswerCombination extends Question {
 
 		$form -> addElement('hidden', 'nb_answers');
 		$boxes_names = array();
-		
+
 		if ($nb_answers < 1) {
 			$nb_answers = 1;
 			Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
-		}		
+		}
 
 		for($i = 1 ; $i <= $nb_answers ; ++$i) {
 			if(is_object($answer)) {
@@ -92,15 +90,15 @@ class MultipleAnswerCombination extends Question {
 
 				$defaults['answer[2]']  = get_lang('DefaultMultipleAnswer1');
 				$defaults['comment[2]'] = get_lang('DefaultMultipleComment1');
-				$defaults['correct[2]'] = false;				
+				$defaults['correct[2]'] = false;
 			}
 			$renderer = & $form->defaultRenderer();
-			
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');  
-                    
+
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
+
 
 			$answer_number=$form->addElement('text', 'counter['.$i.']', null,'value="'.$i.'"');
 			$answer_number->freeze();
@@ -110,38 +108,38 @@ class MultipleAnswerCombination extends Question {
 
 			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
 			$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
-			
+
             $form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
 			//only 1 answer the all deal ...
 			//$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="10"');
-				
+
 			$form -> addElement ('html', '</tr>');
 		}
 		$form -> addElement ('html', '</table>');
 		$form -> addElement ('html', '<br />');
 
-		$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');		
-						
+		$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');
+
 		//only 1 answer the all deal ...
 		$form->addElement('text', 'weighting[1]', get_lang('Score'), array('class' => "span1", 'value' => '10'));
-				
+
 		$navigator_info = api_get_navigator();
 		global $text, $class;
 		//ie6 fix
 		if ($obj_ex->edit_exercise_in_lp == true) {
 			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
-                
+
                 $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
-                $form->addElement('submit', 'submitQuestion', $text, 'class="'.$class.'"');				
+                $form->addElement('submit', 'submitQuestion', $text, 'class="'.$class.'"');
 			} else {
-                
+
                 $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
                 $form->addElement('style_submit_button', 'submitQuestion',$text, 'class="'.$class.'"');
-				
+
 				// setting the save button here and not in the question class.php
-				
+
 			}
 		}
 		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
@@ -172,7 +170,7 @@ class MultipleAnswerCombination extends Question {
 		$objAnswer = new Answer($this->id);
 
 		$nb_answers = $form -> getSubmitValue('nb_answers');
-		
+
 		for($i=1 ; $i <= $nb_answers ; $i++)
         {
         	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
@@ -204,16 +202,16 @@ class MultipleAnswerCombination extends Question {
         $this -> updateWeighting($questionWeighting);
         $this -> save();
 	}
-	
+
 	function return_header($feedback_type = null, $counter = null, $score = null) {
 	    $header = parent::return_header($feedback_type, $counter, $score);
-	    $header .= '<table class="'.$this->question_table_class .'">			
+	    $header .= '<table class="'.$this->question_table_class .'">
 			<tr>
 				<th>'.get_lang("Choice").'</th>
 				<th>'. get_lang("ExpectedChoice").'</th>
 				<th>'. get_lang("Answer").'</i></th>';
         $header .= '<th>'.get_lang("Comment").'</th>';
         $header .= '</tr>';
-        return $header;	  
+        return $header;
 	}
 }

+ 5 - 6
main/exercice/multiple_answer_combination_true_false.class.php

@@ -9,8 +9,6 @@
 /**
  * Code
  */
-if(class_exists('MultipleAnswerCombinationTrueFalse')) { return true; }
-require_once 'multiple_answer_combination.class.php';
 /**
 	CLASS MultipleAnswer
  *
@@ -20,16 +18,17 @@ require_once 'multiple_answer_combination.class.php';
  *	@author Eric Marguin
  *	@package chamilo.exercise
  **/
-class MultipleAnswerCombinationTrueFalse extends MultipleAnswerCombination {
-
+class MultipleAnswerCombinationTrueFalse extends MultipleAnswerCombination
+{
 	static $typePicture = 'mcmaco.gif';
 	static $explanationLangVar = 'MultipleAnswerCombinationTrueFalse';
-    var    $options; 
+    var    $options;
 
 	/**
 	 * Constructor
 	 */
-	function MultipleAnswerCombinationTrueFalse(){
+	function MultipleAnswerCombinationTrueFalse()
+    {
 		parent::question();
 		$this -> type = MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE;
 		$this -> isContent = $this-> getIsContent();

+ 83 - 85
main/exercice/multiple_answer_true_false.class.php

@@ -11,7 +11,6 @@
 /**
  * Code
  */
-if(!class_exists('MultipleAnswerTrueFalse')):
 /**
  * Class
  * @package chamilo.exercise
@@ -40,15 +39,15 @@ class MultipleAnswerTrueFalse extends Question {
 
 		$nb_answers  = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;  // The previous default value was 2. See task #1759.
 		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
-        
+
         $course_id = api_get_course_int_id();
 
 		$obj_ex = $_SESSION['objExercise'];
-                
+
         $renderer = & $form->defaultRenderer();
-               
+
         $defaults = array();
-               
+
 		$html = '<table class="data_table">
 					<tr style="text-align: center;">
 						<th>
@@ -59,7 +58,7 @@ class MultipleAnswerTrueFalse extends Question {
 						</th>
                         <th>
                             '.get_lang('False').'
-                        </th>     
+                        </th>
 						<th>
 							'.get_lang('Answer').'
 						</th>';
@@ -69,16 +68,16 @@ class MultipleAnswerTrueFalse extends Question {
         }
         $html .= '</tr>';
         $form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
-		
+
 		$correct = 0;
 		if (!empty($this -> id)) {
 			$answer = new Answer($this -> id);
-			$answer->read();			
+			$answer->read();
 			if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
 				$nb_answers = $answer->nbrAnswers;
 			}
 		}
-		
+
 		$form -> addElement('hidden', 'nb_answers');
 		$boxes_names = array();
 
@@ -86,51 +85,51 @@ class MultipleAnswerTrueFalse extends Question {
 			$nb_answers = 1;
 			Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
 		}
-		
-        // Can be more options        
+
+        // Can be more options
         $option_data = Question::readQuestionOption($this->id, $course_id);
-          
+
 		for ($i = 1 ; $i <= $nb_answers ; ++$i) {
-            
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']'); 
-            
+
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
+
             $answer_number=$form->addElement('text', 'counter['.$i.']',null,'value="'.$i.'"');
-            $answer_number->freeze();            
-            
-			if (is_object($answer)) {               
+            $answer_number->freeze();
+
+			if (is_object($answer)) {
 				$defaults['answer['.$i.']']     = $answer -> answer[$i];
 				$defaults['comment['.$i.']']    = $answer -> comment[$i];
 				//$defaults['weighting['.$i.']']  = float_format($answer -> weighting[$i], 1);
-      
+
                 $correct = $answer->correct[$i];
-                                
-                $defaults['correct['.$i.']']    = $correct;          
-			
-                $j = 1;             
+
+                $defaults['correct['.$i.']']    = $correct;
+
+                $j = 1;
                 if (!empty($option_data)) {
-                    foreach ($option_data as $id=>$data) {                 
+                    foreach ($option_data as $id=>$data) {
                         $form->addElement('radio', 'correct['.$i.']', null, null, $id);
                         $j++;
                         if ($j == 3) {
                         	break;
                         }
-                       
-                    }            
+
+                    }
                 }
-			} else {                
-                $form->addElement('radio', 'correct['.$i.']', null, null, 1);            
+			} else {
+                $form->addElement('radio', 'correct['.$i.']', null, null, 1);
                 $form->addElement('radio', 'correct['.$i.']', null, null, 2);
-            
+
                 $defaults['answer['.$i.']']     = '';
                 $defaults['comment['.$i.']']    = '';
-                $defaults['correct['.$i.']']    = '';                
-			}          
-            
+                $defaults['correct['.$i.']']    = '';
+			}
+
             //$form->addElement('select', 'correct['.$i.']',null, $this->options, array('id'=>$i,'onchange'=>'multiple_answer_true_false_onchange(this)'));
-            
+
 			$boxes_names[] = 'correct['.$i.']';
 
 			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
@@ -142,38 +141,38 @@ class MultipleAnswerTrueFalse extends Question {
 			}
 			$form->addElement ('html', '</tr>');
 		}
-        
+
 		$form->addElement('html', '</table>');
-		$form->addElement('html', '<br />');  
-        
+		$form->addElement('html', '<br />');
+
         $form->addElement('html', '<table><tr><td></td><td>'.get_lang('Correct').'</td><td>'.get_lang('Wrong').'</td><td>'.get_lang('DoubtScore').'</td></tr>');
-               
+
         $renderer->setElementTemplate('<tr><td><span class="form_required">*</span>'.get_lang('Score').'&nbsp;&nbsp;&nbsp;&nbsp;</td><td>{element} &nbsp;&nbsp; <br /><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --></td>', 'option[1]');
         $renderer->setElementTemplate('<td>{element} &nbsp;&nbsp;<br /><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --></td>', 'option[2]');
         $renderer->setElementTemplate('<td>{element} &nbsp;&nbsp;<br /><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --></td>', 'option[3]');
 
         // 3 scores
         $form->addElement('text', 'option[1]', get_lang('Correct'),   array('class'=>'span1','value'=>'1'));
-        $form->addElement('text', 'option[2]', get_lang('Wrong'),     array('class'=>'span1','value'=>'-0.5'));        
+        $form->addElement('text', 'option[2]', get_lang('Wrong'),     array('class'=>'span1','value'=>'-0.5'));
         $form->addElement('text', 'option[3]', get_lang('DoubtScore'),array('class'=>'span1','value'=>'0'));
-        
+
         $form->addRule('option[1]', get_lang('ThisFieldIsRequired'), 'required');
         $form->addRule('option[2]', get_lang('ThisFieldIsRequired'), 'required');
-        $form->addRule('option[3]', get_lang('ThisFieldIsRequired'), 'required');                
-        
+        $form->addRule('option[3]', get_lang('ThisFieldIsRequired'), 'required');
+
         $form -> addElement ('html', '</tr><table>');
-        $form -> addElement('hidden', 'options_count', 3);                    
-        $form -> addElement ('html', '</table><br /><br />');        
-        
+        $form -> addElement('hidden', 'options_count', 3);
+        $form -> addElement ('html', '</table><br /><br />');
+
         //Extra values True, false,  Dont known
         if (!empty($this->extra)) {
-            $scores = explode(':',$this->extra);        
+            $scores = explode(':',$this->extra);
             if (!empty($scores)) {
                 for ($i = 1; $i <=3; $i++) {
-                    $defaults['option['.$i.']']	= $scores[$i-1];                
-                }        
-            }        
-        }        
+                    $defaults['option['.$i.']']	= $scores[$i-1];
+                }
+            }
+        }
 
 		//$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');
 
@@ -183,16 +182,16 @@ class MultipleAnswerTrueFalse extends Question {
 		if ($obj_ex->edit_exercise_in_lp == true) {
 			//ie6 fix
 			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
-                
+
                 $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
-                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');				
+                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
                 $form->addElement('submit', 'submitQuestion',$text, 'class="'.$class.'"');
 			} else {
                 // setting the save button here and not in the question class.php
-                
+
                 $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
-                $form->addElement('style_submit_button', 'submitQuestion',$text, 'class="'.$class.'"');	
+                $form->addElement('style_submit_button', 'submitQuestion',$text, 'class="'.$class.'"');
 			}
 		}
 		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
@@ -223,75 +222,74 @@ class MultipleAnswerTrueFalse extends Question {
 		$nb_answers       = $form->getSubmitValue('nb_answers');
         $options_count    = $form->getSubmitValue('options_count');
         $course_id        = api_get_course_int_id();
-       
+
         $correct = array();
         $options = Question::readQuestionOption($this->id, $course_id);
-        	
-        
+
+
         if (!empty($options)) {
             foreach ($options as $option_data) {
                 $id = $option_data['id'];
                 unset($option_data['id']);
                 Question::updateQuestionOption($id, $option_data, $course_id);
             }
-        } else {            
-            for ($i=1 ; $i <= 3 ; $i++) {                
+        } else {
+            for ($i=1 ; $i <= 3 ; $i++) {
         	   $last_id = Question::saveQuestionOption($this->id, $this->options[$i], $course_id, $i);
                $correct[$i] = $last_id;
-            }            
+            }
         }
-  
+
         //Getting quiz_question_options (true, false, doubt) because it's possible that there are more options in the future
         $new_options = Question::readQuestionOption($this->id, $course_id);
-        
+
         $sorted_by_position = array();
         foreach($new_options as $item) {
         	$sorted_by_position[$item['position']] = $item;
-        }        
-        
-        //Saving quiz_question.extra values that has the correct scores of the true, false, doubt options registered in this format XX:YY:ZZZ where XX is a float score value 
+        }
+
+        //Saving quiz_question.extra values that has the correct scores of the true, false, doubt options registered in this format XX:YY:ZZZ where XX is a float score value
         $extra_values = array();
         for ($i=1 ; $i <= 3 ; $i++) {
             $score = trim($form -> getSubmitValue('option['.$i.']'));
             $extra_values[]= $score;
-        }        
-        $this->setExtra(implode(':',$extra_values));       
-          
+        }
+        $this->setExtra(implode(':',$extra_values));
+
 		for ($i=1 ; $i <= $nb_answers ; $i++) {
         	$answer     = trim($form -> getSubmitValue('answer['.$i.']'));
             $comment    = trim($form -> getSubmitValue('comment['.$i.']'));
-            $goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));  
+            $goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));
             if (empty($options)) {
-                //If this is the first time that the question is created when change the default values from the form 1 and 2 by the correct "option id" registered 
+                //If this is the first time that the question is created when change the default values from the form 1 and 2 by the correct "option id" registered
                 $goodAnswer = $sorted_by_position[$goodAnswer]['id'];
-            }         
+            }
     	    $questionWeighting += $extra_values[0]; //By default 0 has the correct answers
-        	$objAnswer->createAnswer($answer, $goodAnswer, $comment,'',$i);            
-        }        
-    
+        	$objAnswer->createAnswer($answer, $goodAnswer, $comment,'',$i);
+        }
+
 
     	// saves the answers into the data base
         $objAnswer -> save();
-    
+
         // sets the total weighting of the question
         $this -> updateWeighting($questionWeighting);
         $this -> save();
 	}
-	
-	function return_header($feedback_type = null, $counter = null, $score = null) {	    	    
-        $header = parent::return_header($feedback_type, $counter, $score);        
-  	    $header .= '<table class="'.$this->question_table_class .'">		
+
+	function return_header($feedback_type = null, $counter = null, $score = null) {
+        $header = parent::return_header($feedback_type, $counter, $score);
+  	    $header .= '<table class="'.$this->question_table_class .'">
 		<tr>
 			<th>'.get_lang("Choice").'</th>
 			<th>'. get_lang("ExpectedChoice").'</th>
 			<th>'. get_lang("Answer").'</th>';
-			if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { 
+			if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
 				$header .= '<th>'.get_lang("Comment").'</th>';
-			} else { 
+			} else {
 				$header .= '<th>&nbsp;</th>';
 			}
         $header .= '</tr>';
-        return $header;	  
+        return $header;
 	}
 }
-endif;

+ 4 - 6
main/exercice/oral_expression.class.php

@@ -11,7 +11,6 @@
 /**
  * Code
  */
-if(!class_exists('OralExpression')):
 /**
  * @package chamilo.exercise
  */
@@ -55,7 +54,7 @@ class OralExpression extends Question {
 		$this->weighting = $form -> getSubmitValue('weighting');
 		$this->save();
 	}
-	
+
 	function return_header($feedback_type = null, $counter = null, $score = null) {
 	    $header = parent::return_header($feedback_type, $counter, $score);
 	    $header .= '<table class="'.$this->question_table_class.'">
@@ -67,8 +66,7 @@ class OralExpression extends Question {
 			</tr>
 			<tr>
                 <th>&nbsp;</th>
-			</tr>';				
-        return $header;	  
-	}	
+			</tr>';
+        return $header;
+	}
 }
-endif;

+ 91 - 79
main/exercice/unique_answer.class.php

@@ -10,8 +10,6 @@
  * Code
  */
 
-if(!class_exists('UniqueAnswer')):
-
 /**
 	CLASS UNIQUE_ANSWER
  *
@@ -23,15 +21,16 @@ if(!class_exists('UniqueAnswer')):
  *	@package chamilo.exercise
  **/
 
-class UniqueAnswer extends Question {
-
+class UniqueAnswer extends Question
+{
 	static $typePicture = 'mcua.gif';
 	static $explanationLangVar = 'UniqueSelect';
 
 	/**
 	 * Constructor
 	 */
-	function UniqueAnswer() {
+	function UniqueAnswer()
+    {
 		//this is highly important
 		parent::question();
 		$this -> type = UNIQUE_ANSWER;
@@ -39,11 +38,12 @@ class UniqueAnswer extends Question {
 	}
 
 	/**
-	 * function which redifines Question::createAnswersForm
+	 * function which redefines Question::createAnswersForm
 	 * @param the formvalidator instance
 	 * @param the answers number to display
 	 */
-	function createAnswersForm ($form) {
+	function createAnswersForm ($form)
+    {
 		// Getting the exercise list
 		$obj_ex = $_SESSION['objExercise'];
 
@@ -89,11 +89,11 @@ class UniqueAnswer extends Question {
                         '.$feedback_title.'
                     <th width="50px">
                         '.get_lang('Weighting').'
-                    </th>        
+                    </th>
                 </tr>';
 
         $form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
-		
+
 		$defaults = array();
 		$correct = 0;
 		if(!empty($this -> id)) {
@@ -110,7 +110,7 @@ class UniqueAnswer extends Question {
 		$select_question=array();
 		$select_question[0] = get_lang('SelectTargetQuestion');
 
-		require_once '../newscorm/learnpathList.class.php';        
+		require_once '../newscorm/learnpathList.class.php';
 		if (is_array($question_list)) {
 			foreach ($question_list as $key=>$questionid) {
 				//To avoid warning messages
@@ -133,14 +133,14 @@ class UniqueAnswer extends Question {
 		}
 
 		$temp_scenario = array();
-        
+
         if ($nb_answers < 1) {
             $nb_answers = 1;
             Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
-        }                        
+        }
 
         for ($i = 1 ; $i <= $nb_answers ; ++$i) {
-            $form -> addElement ('html', '<tr>');                
+            $form -> addElement ('html', '<tr>');
             if (isset($answer) && is_object($answer)) {
                 if ($answer -> correct[$i]) {
                     $correct = $i;
@@ -183,67 +183,67 @@ class UniqueAnswer extends Question {
             $defaults['scenario'] = $temp_scenario;
 
             $renderer = $form->defaultRenderer();
-            
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
+
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
             $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');        
-            
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
+
             $answer_number = $form->addElement('text', 'counter['.$i.']',null,' value = "'.$i.'"');
             $answer_number->freeze();
 
             $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
             $form->addElement('html_editor', 'answer['.$i.']', null, 'style="vertical-align:middle"', $editor_config);
-            
+
             $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
 
             if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
                 $form->addElement('html_editor', 'comment['.$i.']', null, 'style="vertical-align:middle"', $editor_config);
                 // Direct feedback
-          
+
                 //Adding extra feedback fields
                 $group = array();
                 $group['try'.$i] = $form->createElement('checkbox', 'try'.$i, null , get_lang('TryAgain'));
                 $group['lp'.$i]  = $form->createElement('select', 'lp'.$i, get_lang('SeeTheory').': ', $select_lp_id);
                 $group['destination'.$i]= $form->createElement('select', 'destination'.$i, get_lang('GoToQuestion').': ' , $select_question);
                 $group['url'.$i] = $form->createElement('text', 'url'.$i, get_lang('Other').': ', array('class'=>'span2', 'placeholder' => get_lang('Other')));
-                $form->addGroup($group, 'scenario');                
-                
-                $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}', 'scenario');            
-                
+                $form->addGroup($group, 'scenario');
+
+                $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}', 'scenario');
+
             }
             else {
                 $form->addElement('html_editor', 'comment['.$i.']', null, 'style="vertical-align:middle"', $editor_config);
             }
-            $form->addElement('text', 'weighting['.$i.']', null, array('class' => "span1", 'value' => '0'));                    
-            $form->addElement ('html', '</tr>');                
+            $form->addElement('text', 'weighting['.$i.']', null, array('class' => "span1", 'value' => '0'));
+            $form->addElement ('html', '</tr>');
         }
 
 		$form -> addElement ('html', '</table>');
-		$form -> addElement ('html', '<br />');        
-        
+		$form -> addElement ('html', '<br />');
+
 		$navigator_info = api_get_navigator();
 
 		global $text, $class;
-        
+
 		//ie6 fix
 		if ($obj_ex->edit_exercise_in_lp == true) {
-			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {                
+			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
                 $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
-                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"'); 
+                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
                 $form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
 			} else {
-                //setting the save button here and not in the question class.php                
+                //setting the save button here and not in the question class.php
                 $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
-                $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');                
-                $form->addElement('style_submit_button', 'submitQuestion',$text, 'class="'.$class.'"');				
+                $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
+                $form->addElement('style_submit_button', 'submitQuestion',$text, 'class="'.$class.'"');
 			}
 		}
 		$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
 		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
 		$renderer->setElementTemplate('{element}&nbsp;','moreAnswers');
-        
+
         $form->addElement('html', '</div></div>');
 
 		//We check the first radio button to be sure a radio button will be check
@@ -265,13 +265,13 @@ class UniqueAnswer extends Question {
 
 	/**
 	 * abstract function which creates the form to create / edit the answers of the question
-	 * @param the formvalidator instance
+	 * @param FormValidator $form
 	 * @param the answers number to display
 	 */
-	function processAnswersCreation($form) {
-
+	function processAnswersCreation($form)
+    {
 		$questionWeighting = $nbrGoodAnswers = 0;
-		$correct = $form -> getSubmitValue('correct');
+		$correct = $form->getSubmitValue('correct');
 		$objAnswer = new Answer($this->id);
 		$nb_answers = $form->getSubmitValue('nb_answers');
 
@@ -281,11 +281,11 @@ class UniqueAnswer extends Question {
             $weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
 
             $scenario = $form -> getSubmitValue('scenario');
-            
+
            	//$list_destination = $form -> getSubmitValue('destination'.$i);
            	//$destination_str = $form -> getSubmitValue('destination'.$i);
 
- 		    $try = $scenario['try'.$i];            
+ 		    $try = $scenario['try'.$i];
             $lp = $scenario['lp'.$i];
  			$destination = $scenario['destination'.$i];
  			$url = trim($scenario['url'.$i]);
@@ -302,7 +302,7 @@ class UniqueAnswer extends Question {
 			lp_id = id of a learning path (0 if dont select)
 			selected_questions= ids of questions
 			url= an url
-	
+
  			$destination_str='';
  			foreach ($list_destination as $destination_id)
  			{
@@ -330,16 +330,16 @@ class UniqueAnswer extends Question {
  			if (empty($destination)) {
  				$destination=0;
  			}
-            
+
  			if ($url=='') {
  				$url=0;
  			}
 
  			//1@@1;2;@@2;4;4;@@http://www.chamilo.org
-			$dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url;            
+			$dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
         	$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i, null, null, $dest);
         }
-        
+
     	// saves the answers into the data base
         $objAnswer->save();
 
@@ -347,45 +347,57 @@ class UniqueAnswer extends Question {
         $this->updateWeighting($questionWeighting);
         $this->save();
 	}
-	
-	function return_header($feedback_type = null, $counter = null, $score = null) {
+
+	function return_header($feedback_type = null, $counter = null, $score = null)
+    {
 	    $header = parent::return_header($feedback_type, $counter, $score);
-	    $header .= '<table class="'.$this->question_table_class .'">			
+	    $header .= '<table class="'.$this->question_table_class .'">
 			<tr>
 				<th>'.get_lang("Choice").'</th>
 				<th>'. get_lang("ExpectedChoice").'</th>
-				<th>'. get_lang("Answer").'</th>';        
+				<th>'. get_lang("Answer").'</th>';
         $header .= '<th>'.get_lang("Comment").'</th>';
         $header .= '</tr>';
-        return $header;	
+
+        return $header;
     }
-    
-  function create_answer($id, $question_id, $answer_title, $comment, $score = 0, $correct = 0) {
-    $tbl_quiz_answer = Database::get_course_table(TABLE_QUIZ_ANSWER);
-    $tbl_quiz_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
-    $course_id = api_get_course_int_id();
-    $position = 1;
-    $question_id = filter_var($question_id,FILTER_SANITIZE_NUMBER_INT);
-    $score = filter_var($score,FILTER_SANITIZE_NUMBER_FLOAT);
-    $correct = filter_var($correct,FILTER_SANITIZE_NUMBER_INT);
-    // Get the max position
-    $sql = "SELECT max(position) as max_position FROM $tbl_quiz_answer "
-          ." WHERE c_id = $course_id AND question_id = $question_id";
-    $rs_max  = Database::query($sql);
-    $row_max = Database::fetch_object($rs_max);
-    $position = $row_max->max_position + 1;
-    // Insert a new answer
-    $sql = "INSERT INTO $tbl_quiz_answer "
-    ."(c_id, id, question_id,answer,correct,comment,ponderation,position,destination)"
-    ."VALUES ($course_id, $id,$question_id,'".Database::escape_string($answer_title)."',"
-    ."$correct,'".Database::escape_string($comment)."',$score,$position, "
-    ." '0@@0@@0@@0')";
-    $rs = Database::query($sql);
-    if ($correct) {
-        $sql = "UPDATE $tbl_quiz_question "
-        ." SET ponderation = (ponderation + $score) WHERE c_id = $course_id AND id = ".$question_id;
-        $rs = Database::query($sql);
+
+    /**
+     * @param int $id
+     * @param int $question_id
+     * @param string $title
+     * @param string $comment
+     * @param float $score
+     * @param int $correct
+     */
+    function addAnswer($id, $question_id, $title, $comment, $score = 0, $correct = 0)
+    {
+        $tbl_quiz_answer = Database::get_course_table(TABLE_QUIZ_ANSWER);
+        $tbl_quiz_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
+        $course_id = api_get_course_int_id();
+        $question_id = intval($question_id);
+        $score = floatval($score);
+        $correct = intval($correct);
+        $title = Database::escape_string($title);
+        $comment = Database::escape_string($comment);
+        // Get the max position.
+        $sql = "SELECT max(position) as max_position
+                FROM $tbl_quiz_answer
+                WHERE
+                  c_id = $course_id AND
+                  question_id = $question_id";
+        $rs_max  = Database::query($sql);
+        $row_max = Database::fetch_object($rs_max);
+        $position = $row_max->max_position + 1;
+        // Insert a new answer
+        $sql = "INSERT INTO $tbl_quiz_answer (c_id, id, question_id,answer,correct,comment,ponderation,position,destination)
+                VALUES ($course_id, $id, $question_id, '".$title."', $correct, '".$comment."', '$score', $position, '0@@0@@0@@0')";
+        Database::query($sql);
+        if ($correct) {
+            $sql = "UPDATE $tbl_quiz_question
+                    SET ponderation = (ponderation + $score)
+                    WHERE c_id = $course_id AND id = ".$question_id;
+            Database::query($sql);
+        }
     }
-  }
 }
-endif;

+ 76 - 81
main/exercice/unique_answer_no_option.class.php

@@ -11,8 +11,6 @@
  * Code
  */
 
-if(!class_exists('UniqueAnswerNoOption')):
-
 /**
 	CLASS UNIQUE_ANSWER
  *
@@ -24,8 +22,8 @@ if(!class_exists('UniqueAnswerNoOption')):
  *	@package chamilo.exercise
  **/
 
-class UniqueAnswerNoOption extends Question {
-
+class UniqueAnswerNoOption extends Question
+{
 	static $typePicture = 'mcuao.gif';
 	static $explanationLangVar = 'UniqueAnswerNoOption';
 
@@ -52,7 +50,7 @@ class UniqueAnswerNoOption extends Question {
 
 		//this line define how many question by default appear when creating a choice question
 		$nb_answers  = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3;  // The previous default value was 2. See task #1759.
-		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); 
+		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
 
 		/*
 	 		Types of Feedback
@@ -89,32 +87,32 @@ class UniqueAnswerNoOption extends Question {
 							'.$feedback_title.'
 						<th width="60px">
 							'.get_lang('Weighting').'
-						</th>        
+						</th>
 					</tr>';
         $form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
 
 		$defaults = array();
 		$correct = 0;
-		
+
 		if (!empty($this -> id)) {
 			$answer = new Answer($this -> id);
 			$answer -> read();
 			if (count($answer->nbrAnswers)>0 && !$form->isSubmitted()) {
-				$nb_answers = $answer->nbrAnswers;				
+				$nb_answers = $answer->nbrAnswers;
 			}
 		}
 
 		$temp_scenario = array();
-	    	    
+
 		if ($nb_answers < 1) {
 			$nb_answers = 1;
 			Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
-		}				
+		}
         if ($_GET['editQuestion']) {
-            
+
             //fixing $nb_answers
             $new_list = array();
-            $count = 1;            
+            $count = 1;
             if (isset($_POST['lessAnswers'])) {
                 if (!isset($_SESSION['less_answer'])) {
                     $_SESSION['less_answer'] = $this -> id;
@@ -122,106 +120,106 @@ class UniqueAnswerNoOption extends Question {
                 }
             }
             for ($k = 1 ; $k <= $nb_answers; ++$k) {
-                if ($answer->position[$k] != '666') {                    
+                if ($answer->position[$k] != '666') {
                     $new_list[$count] = $count;
                     $count++;
                 }
-            }          
+            }
         } else {
-            for ($k = 1 ; $k <= $nb_answers; ++$k) {                                
-                $new_list[$k] = $k;                
-            }            
+            for ($k = 1 ; $k <= $nb_answers; ++$k) {
+                $new_list[$k] = $k;
+            }
         }
-        
+
         $i = 1;
-		//for ($k = 1 ; $k <= $real_nb_answers; $k++) {            
+		//for ($k = 1 ; $k <= $real_nb_answers; $k++) {
         foreach ($new_list as $key) {
-            $i = $key;	    
-			$form -> addElement ('html', '<tr>'); 
-		             
+            $i = $key;
+			$form -> addElement ('html', '<tr>');
+
 			if (is_object($answer)) {
 			    if($answer->position[$i] == 666) {
-			        //we set nothing			        
-			    } else {			    
+			        //we set nothing
+			    } else {
     				if ($answer->correct[$i]) {
     					$correct = $i;
     				}
-                    $answer_result = $answer->answer[$i];                
+                    $answer_result = $answer->answer[$i];
                     $weight_result = float_format($answer->weighting[$i], 1);
                     if ($nb_answers == $i) {
                         $weight_result = '0';
                     }
-                    
+
     				$defaults['answer['.$i.']']    = $answer_result;
     				$defaults['comment['.$i.']']   = $answer->comment[$i];
     				$defaults['weighting['.$i.']'] = $weight_result;
-    
+
     				$item_list=explode('@@',$answer -> destination[$i]);
-    
+
     				$try       = $item_list[0];
     				$lp        = $item_list[1];
     				$list_dest = $item_list[2];
     				$url       = $item_list[3];
-    
+
     				if ($try==0)
     					$try_result=0;
     				else
     					$try_result=1;
-    
+
     				if ($url==0)
     					$url_result='';
     				else
     					$url_result=$url;
-    
+
     				$temp_scenario['url'.$i]        = $url_result;
     				$temp_scenario['try'.$i]        = $try_result;
     				$temp_scenario['lp'.$i]         = $lp;
     				$temp_scenario['destination'.$i]= $list_dest;
 			    }
 			}
-			
+
 			$defaults['scenario']=$temp_scenario;
 			$renderer = & $form->defaultRenderer();
-            
-			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');  
-            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');        
-          
-            
+
+			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
+            $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
+
+
 			$answer_number=$form->addElement('text', 'counter['.$i.']', null,'value="'.$i.'"');
 			$answer_number->freeze();
-		
-        
+
+
 			$form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
 			$form->addElement('html_editor', 'answer['.$i.']', null, 'style="vertical-align:middle"', $editor_config);
-			
+
             $form->addElement('html_editor', 'comment['.$i.']', null, 'style="vertical-align:middle"', $editor_config);
 			$form->addElement('text', 'weighting['.$i.']', null, array('class' => "span1", 'value' => '0'));
 			$form->addElement('html', '</tr>');
-            $i++;				
-		}	
-		
+            $i++;
+		}
+
 		if (empty($this -> id)) {
 		    $form->addElement('hidden', 'new_question', 1);
 		}
-        
+
         //Adding the "I don't know" question answer
         //if (empty($this -> id)) {
-        $i = 666;        
-        $form -> addElement ('html', '<tr>'); 
+        $i = 666;
+        $form -> addElement ('html', '<tr>');
 
         $defaults['answer['.$i.']']     = get_lang('DontKnow');
         $defaults['weighting['.$i.']']  = 0;
         $defaults['scenario']=$temp_scenario;
         $renderer = & $form->defaultRenderer();
 
-        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');  
-        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');  
-        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');  
-        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');  
-        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']'); 
+        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct');
+        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
+        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
+        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
+        $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
 
         $answer_number=$form->addElement('text', 'counter['.$i.']',null,'value="-"');
         $answer_number->freeze();
@@ -241,9 +239,7 @@ class UniqueAnswerNoOption extends Question {
         $form->addElement('text', 'weighting['.$i.']', null, array('class' => "span1", 'value' => '0', 'readonly' =>'readonly'));
         $form->addElement ('html', '</tr>');
 
-     //}
-    
-       
+
 		$form -> addElement ('html', '</table>');
 		$form -> addElement ('html', '<br />');
 		$navigator_info = api_get_navigator();
@@ -251,15 +247,15 @@ class UniqueAnswerNoOption extends Question {
 		global $text, $class;
 		//ie6 fix
 		if ($obj_ex->edit_exercise_in_lp == true) {
-			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {                
-                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');                
+			if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
+                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
 				$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
 			} else {
-                //setting the save button here and not in the question class.php                
+                //setting the save button here and not in the question class.php
                 $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
                 $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
-                $form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');				
+                $form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
 			}
 		}
 		$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
@@ -278,13 +274,13 @@ class UniqueAnswerNoOption extends Question {
 			$form -> setDefaults($defaults);
 		} else {
             $form -> setDefaults($defaults);
-		}		
-		
+		}
+
 		$form->addElement('hidden', 'nb_answers');
-		
-	
+
+
 	    $form->setConstants(array('nb_answers' => $nb_answers));
-		
+
 	}
 
 
@@ -301,19 +297,19 @@ class UniqueAnswerNoOption extends Question {
 		$nb_answers = $form -> getSubmitValue('nb_answers');
 		$minus = 1;
 		if ($form -> getSubmitValue('new_question')) {
-		    $minus = 0;    
-		}	
-            
+		    $minus = 0;
+		}
+
 		for ($i=1 ; $i <= $nb_answers - $minus; $i++) {
 		    $position   = trim($form -> getSubmitValue('position['.$i.']'));
         	$answer     = trim($form -> getSubmitValue('answer['.$i.']'));
             $comment    = trim($form -> getSubmitValue('comment['.$i.']'));
             $weighting  = trim($form -> getSubmitValue('weighting['.$i.']'));
             $scenario   = $form -> getSubmitValue('scenario');
-            
-            
+
+
 //
-            
+
            	//$list_destination = $form -> getSubmitValue('destination'.$i);
            	//$destination_str = $form -> getSubmitValue('destination'.$i);
 
@@ -362,7 +358,7 @@ class UniqueAnswerNoOption extends Question {
  			if (empty($destination)) {
  				$destination=0;
  			}
-            
+
  			if ($url=='') {
  				$url=0;
  			}
@@ -371,17 +367,17 @@ class UniqueAnswerNoOption extends Question {
 			$dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
         	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
         }
-        
+
         //Create 666 answer
         $i = 666;
         $answer     = trim($form -> getSubmitValue('answer['.$i.']'));
         $comment    = trim($form -> getSubmitValue('comment['.$i.']'));
         $weighting  = trim($form -> getSubmitValue('weighting['.$i.']'));
         $goodAnswer= ($correct == $i) ? true : false;
-        $dest       = ''; 
-            
+        $dest       = '';
+
         $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
-        
+
     	// saves the answers into the data base
         $objAnswer -> save();
 
@@ -389,17 +385,16 @@ class UniqueAnswerNoOption extends Question {
         $this -> updateWeighting($questionWeighting);
         $this -> save();
 	}
-	
+
 	function return_header($feedback_type = null, $counter = null, $score = null) {
 	    $header = parent::return_header($feedback_type, $counter, $score);
-	    $header .= '<table class="'.$this->question_table_class .'">			
+	    $header .= '<table class="'.$this->question_table_class .'">
 			<tr>
 				<th>'.get_lang("Choice").'</th>
 				<th>'. get_lang("ExpectedChoice").'</th>
 				<th>'. get_lang("Answer").'</th>';
         $header .= '<th>'.get_lang("Comment").'</th>';
         $header .= '</tr>';
-        return $header;	
+        return $header;
 	}
 }
-endif;

+ 115 - 64
main/exercice/upload_exercise.php

@@ -32,13 +32,13 @@ $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
 if (!$is_allowed_to_edit) {
     api_not_allowed(true);
 }
-
 // setting the tabs
 $this_section = SECTION_COURSES;
-$htmlHeadXtra[] = "<script type='text/javascript'>
-  $(document).ready( function(){
-  $(\"div.formw\").attr(\"style\",\"width: 73%;\");
-  $(\"#img_plus_and_minus\").hide();
+$htmlHeadXtra[] = "<script>
+$(document).ready( function(){
+    $('#user_custom_score').click(function() {
+        $('#options').toggle();
+    });
 });
 </script>";
 
@@ -48,41 +48,34 @@ lp_upload_quiz_action_handling();
 $interbreadcrumb[]= array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
 
 // Display the header
-if ($origin != 'learnpath') {
-    //so we are not in learnpath tool
-    Display :: display_header(get_lang('ImportExcelQuiz'), 'Exercises');
-    if (isset ($_GET['message'])) {
-        if (in_array($_GET['message'], array ('ExerciseEdited'))) {
-            Display :: display_confirmation_message(get_lang($_GET['message']));
-        }
+
+Display :: display_header(get_lang('ImportExcelQuiz'), 'Exercises');
+
+if (isset($_GET['message'])) {
+    if (in_array($_GET['message'], array('ExerciseEdited'))) {
+        Display :: display_confirmation_message(get_lang($_GET['message']));
     }
-} else {
-    echo '<link rel="stylesheet" type="text/css" href="' . api_get_path(WEB_CODE_PATH) . 'css/default.css"/>';
 }
+
 // display the actions
 echo '<div class="actions">';
 echo lp_upload_quiz_actions();
 echo '</div>';
 
-// start the content div
-echo '<div id="content_with_secondary_actions" class="gradient">';
 // the main content
 lp_upload_quiz_main();
 
-// close the content div
-echo '</div>';
-
 function lp_upload_quiz_actions() {
-    $lp_id = Security::remove_XSS($_GET['lp_id']);
-    $return = "";
-    $return .= '<a href="exercice.php?'.api_get_cidReq().'">'.Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
+    $return = '<a href="exercice.php?'.api_get_cidReq().'">'.
+        Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
     return $return;
 }
 
 function lp_upload_quiz_secondary_actions() {
     $lp_id = Security::remove_XSS($_GET['lp_id']);
     $return = '';
-    $return.='<a href="exercise_report.php?' . api_get_cidreq() . '">' . Display :: return_icon('reporting32.png', get_lang('Tracking')) . get_lang('Tracking') . '</a>';
+    $return .= '<a href="exercise_report.php?' . api_get_cidreq() . '">' .
+                Display :: return_icon('reporting32.png', get_lang('Tracking')) . get_lang('Tracking') . '</a>';
     return $return;
 }
 
@@ -91,15 +84,24 @@ function lp_upload_quiz_main() {
     // variable initialisation
     $lp_id = Security::remove_XSS($_GET['lp_id']);
 
-    $form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id=' . $lp_id, '', array('enctype' => 'multipart/form-data'));
+    $form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id='.$lp_id, '', array('enctype' => 'multipart/form-data'));
     $form->addElement('header', get_lang('ImportExcelQuiz'));
     $form->addElement('file', 'user_upload_quiz', get_lang('FileUpload'));
 
-    $link = '<a href="../exercice/quiz_template.xls">'.Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate'),null,16).get_lang('DownloadExcelTemplate');
-
+    $link = '<a href="../exercice/quiz_template.xls">'.
+             Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')).get_lang('DownloadExcelTemplate').'</a>';
     $form->addElement('advanced_settings', $link);
 
-    //button send document
+    $form->addElement('checkbox', 'user_custom_score', null, get_lang('UseCustomScoreForAllQuestions'), array('id'=> 'user_custom_score'));
+
+    $form->addElement('html', '<div id="options" style="display:none">');
+    $form->addElement('text', 'correct_score', get_lang('CorrectScore'));
+    $form->addElement('text', 'incorrect_score', get_lang('IncorrectScore'));
+    $form->addElement('html', '</div>');
+
+    $form->addRule('user_upload_quiz', get_lang('ThisFieldIsRequired'), 'required');
+
+    $form->add_progress_bar();
     $form->addElement('style_submit_button', 'submit_upload_quiz', get_lang('Send'), 'class="upload"');
 
     // Display the upload field
@@ -110,16 +112,21 @@ function lp_upload_quiz_main() {
  * Handles a given Excel spreadsheets as in the template provided
  */
 function lp_upload_quiz_action_handling() {
-    global $_course, $debug;
+    global $debug;
+    $_course = api_get_course_info();
+
     if (!isset($_POST['submit_upload_quiz'])) {
         return;
     }
+
     // Get the extension of the document.
     $path_info = pathinfo($_FILES['user_upload_quiz']['name']);
+
     // Check if the document is an Excel document
     if ($path_info['extension'] != 'xls') {
         return;
     }
+
     // Read the Excel document
     $data = new Spreadsheet_Excel_Reader();
     // Set output Encoding.
@@ -127,6 +134,17 @@ function lp_upload_quiz_action_handling() {
     // Reading the xls document.
     $data->read($_FILES['user_upload_quiz']['tmp_name']);
 
+    $correctScore = isset($_POST['correct_score']) ? $_POST['correct_score'] : null;
+    $incorrectScore = isset($_POST['incorrect_score']) ? $_POST['incorrect_score'] : null;
+    $useCustomScore = isset($_POST['user_custom_score']) ? true : false;
+
+    $propagateNegative = 0;
+    if ($useCustomScore && !empty($incorrectScore)) {
+        if ($incorrectScore < 0) {
+            $propagateNegative = 1;
+        }
+    }
+
     // Variables
     $quiz_index = 0;
     $question_title_index = array();
@@ -137,7 +155,7 @@ function lp_upload_quiz_action_handling() {
     $feedback_false_index = array();
     $number_questions = 0;
     $question_description_index = array();
-    // Reading all the first column items sequencially to create breakpoints
+    // Reading all the first column items sequentially to create breakpoints
     for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
         if ($data->sheets[0]['cells'][$i][1] == 'Quiz' && $i == 1) {
             $quiz_index = $i; // Quiz title position, only occurs once
@@ -155,18 +173,18 @@ function lp_upload_quiz_action_handling() {
         } elseif ($data->sheets[0]['cells'][$i][1] == 'EnrichQuestion') {
             $question_description_index[] = $i;
         }
-
     }
+
     // Variables
     $quiz = array();
     $question = array();
-    $answer = array();
     $new_answer = array();
     $score_list = array();
     $feedback_true_list = array();
     $feedback_false_list = array();
     $question_description = array();
-    // Get questions
+
+    // Getting questions.
     $k = $z = $q = $l = $m = 0;
     for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
         if (is_array($data->sheets[0]['cells'][$i])) {
@@ -183,22 +201,28 @@ function lp_upload_quiz_action_handling() {
             $column_data = '';
         }
         // Fill quiz data
-        if ($quiz_index == $i) { // The title always in the first position
+        if ($quiz_index == $i) {
+            // The title always in the first position
             $quiz = $column_data;
         } elseif (in_array($i, $question_title_index)) {
-            $question[$k] = $column_data; //a complete line where 1st column is 'Question'
+            //a complete line where 1st column is 'Question'
+            $question[$k] = $column_data;
             $k++;
         } elseif (in_array($i, $score_index)) {
-            $score_list[$z] = $column_data; //a complete line where 1st column is 'Score'
+            //a complete line where 1st column is 'Score'
+            $score_list[$z] = $column_data;
             $z++;
         } elseif (in_array($i, $feedback_true_index)) {
-            $feedback_true_list[$q] = $column_data;//a complete line where 1st column is 'FeedbackTrue'
+            //a complete line where 1st column is 'FeedbackTrue'
+            $feedback_true_list[$q] = $column_data;
             $q++;
         } elseif (in_array($i, $feedback_false_index)) {
-            $feedback_false_list[$l] = $column_data;//a complete line where 1st column is 'FeedbackFalse' for wrong answers
+            //a complete line where 1st column is 'FeedbackFalse' for wrong answers
+            $feedback_false_list[$l] = $column_data;
             $l++;
         } elseif (in_array($i, $question_description_index)) {
-            $question_description[$m] = $column_data; //a complete line where 1st column is 'EnrichQuestion'
+            //a complete line where 1st column is 'EnrichQuestion'
+            $question_description[$m] = $column_data;
             $m++;
         }
     }
@@ -223,49 +247,67 @@ function lp_upload_quiz_action_handling() {
         }
     }
 
-    $quiz_title = $quiz[2]; // Quiz title
+    // Quiz title.
+    $quiz_title = $quiz[2];
 
     if ($quiz_title != '') {
         // Variables
         $type = 2;
         $random = $active = $results = $max_attempt = $expired_time = 0;
-        //make sure feedback is enabled (3 to disable), otherwise the fields
+        // Make sure feedback is enabled (3 to disable), otherwise the fields
         // added to the XLS are not shown, which is confusing
         $feedback = 0;
+
         // Quiz object
-        $quiz_object = new Exercise();
-        $quiz_id = $quiz_object->create_quiz($quiz_title, $expired_time, $type, $random, $active, $results, $max_attempt, $feedback);
+        $exercise = new Exercise();
+        //
+        $quiz_id = $exercise->createExercise(
+            $quiz_title,
+            $expired_time,
+            $type,
+            $random,
+            $active,
+            $results,
+            $max_attempt,
+            $feedback,
+            $propagateNegative
+        );
 
         if ($quiz_id) {
 
             // insert into the item_property table
             api_item_property_update($_course, TOOL_QUIZ, $quiz_id, 'QuizAdded', api_get_user_id());
 
-            // Import questions
+            // Import questions.
             for ($i = 0; $i < $number_questions; $i++) {
-                // Create questions
-
-
-                $question_title = $question[$i][2]; // Question name
+                // Question name
+                $question_title = $question[$i][2];
                 $question_description_text = "<p></p>";
                 if (isset($question_description[$i][2])) {
-                    $question_description_text =  "<p>".$question_description[$i][2]."</p>"; // Question description, if any
+                    // Question description.
+                    $question_description_text =  "<p>".$question_description[$i][2]."</p>";
                 }
 
                 // Unique answers are the only question types available for now
                 // through xls-format import
-                $unique_answer = new UniqueAnswer();
+                $uniqueAnswer = new UniqueAnswer();
                 if ($question_title != '') {
-                    $question_id = $unique_answer->create_question($quiz_id, $question_title, $question_description_text);
+                    $question_id = $uniqueAnswer->create_question(
+                        $quiz_id,
+                        $question_title,
+                        $question_description_text
+                    );
                 }
+
                 if (is_array($new_answer[$i])) {
                     $id = 1;
                     $answers_data = $new_answer[$i];
+
                     foreach ($answers_data as $answer_data) {
                         $answer = $answer_data[2];
                         $correct = 0;
                         $score = 0;
-                        $comment = '';
+
                         if (strtolower($answer_data[3]) == 'x') {
                             $correct = 1;
                             $score = $score_list[$i][3];
@@ -273,15 +315,25 @@ function lp_upload_quiz_action_handling() {
                         } else {
                             $comment = $feedback_false_list[$i][2];
                         }
-                        /*
-                        if ($id == 1) {
-                            $comment = $feedback_true_list[$i][2];
-                        } elseif ($id == 2) {
-                            $comment = $feedback_false_list[$i][2];
+
+                        if ($useCustomScore) {
+                            if ($correct) {
+                                $score = $correctScore;
+                            } else {
+                                $score = $incorrectScore;
+                            }
                         }
-                        */
-                        // Create answer
-                        $unique_answer->create_answer($id, $question_id, $answer, $comment, $score, $correct);
+
+                        // Add answer.
+                        $uniqueAnswer->addAnswer(
+                            $id,
+                            $question_id,
+                            $answer,
+                            $comment,
+                            $score,
+                            $correct
+                        );
+
                         $id++;
                     }
                 }
@@ -306,22 +358,21 @@ function lp_upload_quiz_action_handling() {
                     Session::erase('lpobject');
                 } else {
                     $_SESSION['oLP'] = $oLP;
-                    $lp_found = true;
                 }
             }
         }
-        if (isset($_SESSION['oLP']) && isset($_GET['lp_id'])) {
 
+        if (isset($_SESSION['oLP']) && isset($_GET['lp_id'])) {
             $previous = $_SESSION['oLP']->select_previous_item_id();
             $parent = 0;
             // Add a Quiz as Lp Item
-            $_SESSION['oLP']->add_item($parent, $previous, TOOL_QUIZ, $quiz_id, ($quiz_title), '');
+            $_SESSION['oLP']->add_item($parent, $previous, TOOL_QUIZ, $quiz_id, $quiz_title, '');
             // Redirect to home page for add more content
-            header('location: ../newscorm/lp_controller.php?' . api_get_cidreq() . '&action=add_item&type=step&lp_id=' . Security::remove_XSS($_GET['lp_id']).'&session_id='.api_get_session_id());
+            header('location: ../newscorm/lp_controller.php?'.api_get_cidreq().'&action=add_item&type=step&lp_id='.Security::remove_XSS($_GET['lp_id']));
             exit;
         } else {
             //  header('location: exercice.php?' . api_get_cidreq());
-            echo '<script>window.location.href = "admin.php?'.api_get_cidReq().'&exerciseId='.$quiz_id.'&session_id='.api_get_session_id().'"</script>';
+            echo '<script>window.location.href = "'.api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidReq().'&exerciseId='.$quiz_id.'&session_id='.api_get_session_id().'"</script>';
         }
     }
 }

+ 12 - 2
main/forum/forumfunction.inc.php

@@ -3598,6 +3598,8 @@ function display_forum_search_results($search_term)
     $table_forums = Database :: get_course_table(TABLE_FORUM);
     $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
     $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
+    $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
+    $session_id = api_get_session_id();
 
     $gradebook = Security::remove_XSS($_GET['gradebook']);
 
@@ -3616,8 +3618,16 @@ function display_forum_search_results($search_term)
                                     OR posts.post_text LIKE '%".Database::escape_string(trim($value))."%')";
     }
 
-    $sql = "SELECT * FROM $table_posts posts
-                WHERE c_id = $course_id AND ".implode(' AND ', $search_restriction)."
+    $sql = "SELECT posts.* FROM $table_posts posts, $table_threads threads, $table_item_property item_property
+                WHERE posts.c_id = $course_id
+                AND item_property.c_id = $course_id
+                AND posts.thread_id = threads.thread_id
+                AND item_property.ref = threads.thread_id
+                AND item_property.visibility = 1
+                AND item_property.id_session = $session_id
+                AND posts.visible = 1
+                AND item_property.tool = '".TOOL_FORUM_THREAD."'
+                AND ".implode(' AND ', $search_restriction)."
                 GROUP BY posts.post_id";
 
     // Getting all the information of the forum categories.

+ 22 - 5
main/inc/lib/course.lib.php

@@ -1827,9 +1827,15 @@ class CourseManager
      * @param   boolean get empty groups (optional)
      * @return  array   List of groups info
      */
-    public static function get_group_list_of_course($course_code, $session_id = 0, $in_get_empty_group = 0) {
+    public static function get_group_list_of_course($course_code, $session_id = 0, $in_get_empty_group = 0)
+    {
         $course_info = Database::get_course_info($course_code);
         $course_id = $course_info['real_id'];
+
+        if (empty($course_id)) {
+            return array();
+        }
+
         $group_list = array();
         $session_id != 0 ? $session_condition = ' WHERE g.session_id IN(1,'.intval($session_id).')' : $session_condition = ' WHERE g.session_id = 0';
 
@@ -4450,11 +4456,13 @@ class CourseManager
 
     /**
      * Course available settings variables see c_course_setting table
+     * @param AppPlugin $appPlugin
      * @return array
      */
-    public static function getCourseSettingVariables()
+    public static function getCourseSettingVariables(AppPlugin $appPlugin)
     {
-        return array(
+        $pluginCourseSettings = $appPlugin->getAllPluginCourseSettings();
+        $courseSettings = array(
             // Get allow_learning_path_theme from table
             'allow_learning_path_theme',
             // Get allow_open_chat_window from table
@@ -4486,17 +4494,26 @@ class CourseManager
             'pdf_export_watermark_text',
             'show_system_folders'
         );
+        if (!empty($pluginCourseSettings)) {
+            $courseSettings = array_merge(
+                $courseSettings,
+                $pluginCourseSettings
+            );
+        }
+        return $courseSettings;
     }
 
     /**
+     * @param AppPlugin $appPlugin
      * @param string $variable
      * @param string $value
      * @param int $courseId
      * @return bool
      */
-    public static function saveCourseConfigurationSetting($variable, $value, $courseId)
+    public static function saveCourseConfigurationSetting(AppPlugin $appPlugin, $variable, $value, $courseId)
     {
-        $settingList = self::getCourseSettingVariables();
+        $settingList = self::getCourseSettingVariables($appPlugin);
+
         if (!in_array($variable, $settingList)) {
             return false;
         }

+ 1 - 1
main/inc/lib/course_home.lib.php

@@ -741,7 +741,7 @@ class CourseHome
                 // Creating title and the link
 
                 if (isset($tool['category']) && $tool['category'] == 'plugin') {
-                    $plugin_info = $app_plugin->get_plugin_info($tool['name']);
+                    $plugin_info = $app_plugin->getPluginInfo($tool['name']);
                     if (isset($plugin_info) && isset($plugin_info['title'])) {
                         $tool_name = $plugin_info['title'];
                     }

+ 131 - 69
main/inc/lib/document.lib.php

@@ -910,7 +910,7 @@ class DocumentManager
      * @param int $session_id
      * @param bool $remove_content_from_db
      */
-    public static function delete_document_from_db(
+    public static function deleteDocumentFromDb(
         $document_id,
         $course_info = array(),
         $session_id = 0,
@@ -950,12 +950,15 @@ class DocumentManager
         //Hard DB delete
         if ($remove_content_from_db) {
             $sql = "DELETE FROM $TABLE_ITEMPROPERTY
-                    WHERE c_id = {$course_info['real_id']} AND ref = ".$document_id." AND tool='".TOOL_DOCUMENT."'";
+                    WHERE
+                        c_id = {$course_info['real_id']} AND
+                        ref = ".$document_id." AND
+                        tool='".TOOL_DOCUMENT."'";
             Database::query($sql);
 
-            $sql = "DELETE FROM $TABLE_DOCUMENT WHERE c_id = {$course_info['real_id']} AND id = ".$document_id;
+            $sql = "DELETE FROM $TABLE_DOCUMENT
+                    WHERE c_id = {$course_info['real_id']} AND id = ".$document_id;
             Database::query($sql);
-
             self::delete_document_metadata($document_id);
         }
     }
@@ -987,21 +990,27 @@ class DocumentManager
      * @param int   $documentId The document id, if available
      * @return boolean true/false
      * @todo now only files/folders in a folder get visibility 2, we should rename them too.
+     * @todo We should be able to get rid of this later when using only documentId (check further usage)
      */
-    public static function delete_document($_course, $path = null, $base_work_dir, $sessionId = null, $documentId = null)
-    {
-        $TABLE_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
-        // @todo We should be able to get rid of this later when using only documentId (check further usage)
-        if (empty($documentId)) {
-            if (empty($path) || empty($base_work_dir)) {
-                return false;
-            }
+    public static function delete_document(
+        $_course,
+        $path = null,
+        $base_work_dir,
+        $sessionId = null,
+        $documentId = null,
+        $groupId = null
+    ) {
+        $TABLE_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
+        if (empty($groupId)) {
+            $groupId = api_get_group_id();
         } else {
-            if (empty($base_work_dir)) {
-                return false;
-            }
-            $docInfo = self::get_document_data_by_id($documentId, $_course['code'], false, $sessionId);
-            $path = $docInfo['path'];
+            $groupId = intval($groupId);
+        }
+
+        if (empty($sessionId)) {
+            $sessionId = api_get_session_id();
+        } else {
+            $sessionId = intval($sessionId);
         }
 
         $course_id = $_course['real_id'];
@@ -1010,95 +1019,145 @@ class DocumentManager
             return false;
         }
 
-        if (empty($sessionId)) {
-            $sessionId = api_get_session_id();
-        } else {
-            $sessionId = intval($sessionId);
+        if (empty($base_work_dir)) {
+            return false;
         }
 
-        // First, delete the actual document.
         if (empty($documentId)) {
-            $document_id = self::get_document_id($_course, $path, $sessionId);
+            $documentId = self::get_document_id($_course, $path, $sessionId);
+            $docInfo = self::get_document_data_by_id(
+                $documentId,
+                $_course['code'],
+                false,
+                $sessionId
+            );
+            $path = $docInfo['path'];
         } else {
-            $document_id = intval($documentId);
+            $docInfo = self::get_document_data_by_id(
+                $documentId,
+                $_course['code'],
+                false,
+                $sessionId
+            );
+            if (empty($docInfo)) {
+                return false;
+            }
+            $path = $docInfo['path'];
         }
 
-        if (empty($document_id)) {
+        $documentId = intval($documentId);
+
+        if (empty($path) || empty($docInfo) || empty($documentId)) {
+            return false;
+        }
+
+        $itemInfo = api_get_item_property_info($_course['real_id'], TOOL_DOCUMENT, $documentId, 0);
+
+        if (empty($itemInfo)) {
+            return false;
+        }
+
+        // File was already deleted.
+        if ($itemInfo['lastedit_type'] == 'DocumentDeleted' ||
+            $itemInfo['lastedit_type'] == 'delete' ||
+            $itemInfo['visibility'] == 2
+        ) {
+            return false;
+        }
+
+        // Filtering by group.
+        if ($itemInfo['to_group_id'] != $groupId) {
             return false;
         }
 
         $document_exists_in_disk = file_exists($base_work_dir.$path);
-        $new_path = $path.'_DELETED_'.$document_id;
+        $new_path = $path.'_DELETED_'.$documentId;
 
         $file_deleted_from_db = false;
         $file_deleted_from_disk = false;
         $file_renamed_from_disk = false;
 
-        if ($document_id) {
-            self::delete_document_from_db($document_id, $_course, $sessionId);
+        if ($documentId) {
+            // Deleting doc from the DB.
+            self::deleteDocumentFromDb($documentId, $_course, $sessionId);
             // Checking
-            // $file_exists_in_db = self::get_document_data_by_id($document_id, $_course['code']);
+            // $file_exists_in_db = self::get_document_data_by_id($documentId, $_course['code']);
             $file_deleted_from_db = true;
         }
 
-        if ($document_exists_in_disk) {
-            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
+        // Looking for children.
+        if ($docInfo['filetype'] == 'folder') {
+            $cleanPath = Database::escape_string($path);
 
-                // Deleted files are *really* deleted.
-                $sql = "SELECT id FROM $TABLE_DOCUMENT
-                        WHERE
-                            c_id = $course_id AND
-                            session_id = $sessionId AND
-                            (path = '".$path."' OR path LIKE BINARY '".$path."/%') ";
-                // Get all id's of documents that are deleted.
-                $result = Database::query($sql);
-
-                if ($result && Database::num_rows($result) != 0) {
-                    // Delete all item_property entries
-                    while ($row = Database::fetch_array($result)) {
-                        // Query to delete from item_property table (hard way)
-                        self::delete_document_from_db($row['id'], $_course, $sessionId, true);
-                    }
+            // Deleted files inside this folder.
+            $sql = "SELECT id FROM $TABLE_DOCUMENT
+                    WHERE
+                        c_id = $course_id AND
+                        session_id = $sessionId AND
+                        path LIKE BINARY '".$cleanPath."/%'";
+
+            // Get all id's of documents that are deleted.
+            $result = Database::query($sql);
+
+            if ($result && Database::num_rows($result) != 0) {
+                // Recursive delete.
+                while ($row = Database::fetch_array($result)) {
+                    self::delete_document(
+                        $_course,
+                        null,
+                        $base_work_dir,
+                        $sessionId,
+                        $row['id']
+                    );
                 }
+            }
+        }
 
+        if ($document_exists_in_disk) {
+            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
                 // Delete documents, do it like this so metadata gets deleted too
                 my_delete($base_work_dir.$path);
+                // Hard delete.
+                self::deleteDocumentFromDb($documentId, $_course, $sessionId, true);
                 $file_deleted_from_disk = true;
-
             } else {
                 // Set visibility to 2 and rename file/folder to xxx_DELETED_#id (soft delete)
 
                 if (is_file($base_work_dir.$path) || is_dir($base_work_dir.$path)) {
                     if (rename($base_work_dir.$path, $base_work_dir.$new_path)) {
+                        $new_path = Database::escape_string($new_path);
 
-                        $sql = "UPDATE $TABLE_DOCUMENT SET path='".$new_path."'
-                                WHERE c_id = $course_id AND session_id = $sessionId AND id = '".$document_id."'";
+                        $sql = "UPDATE $TABLE_DOCUMENT
+                                SET path = '".$new_path."'
+                                WHERE
+                                    c_id = $course_id AND
+                                    session_id = $sessionId AND
+                                    id = ".$documentId;
                         Database::query($sql);
 
-                        $sql = "SELECT id, path FROM $TABLE_DOCUMENT
+                        // Soft delete.
+                        self::deleteDocumentFromDb($documentId, $_course, $sessionId);
+
+                        // Change path of sub folders and documents in database.
+                        $old_item_path = $docInfo['path'];
+                        $new_item_path = $new_path.substr($old_item_path, strlen($path));
+                        $new_item_path = Database::escape_string($new_item_path);
+
+                        $sql = "UPDATE $TABLE_DOCUMENT
+                                SET path = '".$new_item_path."'
                                 WHERE
                                     c_id = $course_id AND
                                     session_id = $sessionId AND
-                                    (path = '".$path."' OR path LIKE BINARY '".$path."/%') ";
-                        $result = Database::query($sql);
-                        if ($result && Database::num_rows($result) > 0) {
-                            while ($deleted_items = Database::fetch_array($result, 'ASSOC')) {
-                                self::delete_document_from_db($deleted_items['id'], $_course, $sessionId);
-
-                                // Change path of sub folders and documents in database.
-                                $old_item_path = $deleted_items['path'];
-                                $new_item_path = $new_path.substr($old_item_path, strlen($path));
-
-                                $sql = "UPDATE $TABLE_DOCUMENT
-                                        SET path = '".$new_item_path."'
-                                        WHERE c_id = $course_id AND session_id = $sessionId AND id = ".$deleted_items['id'];
-                                Database::query($sql);
-                            }
-                        }
+                                    id = ".$documentId;
+                        Database::query($sql);
+
                         $file_renamed_from_disk = true;
                     } else {
                         // Couldn't rename - file permissions problem?
-                        error_log(__FILE__ . ' ' . __LINE__ . ': Error renaming '.$base_work_dir.$path.' to '.$base_work_dir.$new_path.'. This is probably due to file permissions', 0);
+                        error_log(
+                            __FILE__.' '.__LINE__.': Error renaming '.$base_work_dir.$path.' to '.$base_work_dir.$new_path.'. This is probably due to file permissions',
+                            0
+                        );
                     }
                 }
             }
@@ -1116,7 +1175,10 @@ class DocumentManager
             // This means it has been removed externally. To prevent a
             // blocking error from happening, we drop the related items from the
             // item_property and the document table.
-            error_log(__FILE__.' '.__LINE__.': System inconsistency detected. The file or directory '.$base_work_dir.$path.' seems to have been removed from the filesystem independently from the web platform. To restore consistency, the elements using the same path will be removed from the database', 0);
+            error_log(
+                __FILE__.' '.__LINE__.': System inconsistency detected. The file or directory '.$base_work_dir.$path.' seems to have been removed from the filesystem independently from the web platform. To restore consistency, the elements using the same path will be removed from the database',
+                0
+            );
             return false;
         }
     }
@@ -1230,7 +1292,7 @@ class DocumentManager
             $row['absolute_path_from_document'] = '/document' . $row['path'];
 
             $pathinfo = pathinfo($row['path']);
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $pathinfo['dirname'] . '/';
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
             $row['direct_url'] = $www . $path;
 
             if (dirname($row['path']) == '.') {

+ 1 - 1
main/inc/lib/formvalidator/FormValidator.class.php

@@ -173,7 +173,7 @@ class FormValidator extends HTML_QuickForm
         } else {
             $element_template = '
             <div class="control-group {error_class}">
-                <label class="control-label">
+                <label class="control-label" for="{label-for}">
                     <!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
                     {label}
                 </label>

+ 8 - 10
main/inc/lib/groupmanager.lib.php

@@ -1943,21 +1943,19 @@ class GroupManager
         $table_group = Database::get_course_table(TABLE_GROUP);
         $user_id = intval($user_id);
         $course_id = api_get_course_int_id();
-        $sql = "SELECT DISTINCT name FROM $table_group g
-               INNER JOIN $table_group_user gu
-               ON (gu.group_id = g.id)
-               INNER JOIN $table_tutor_user tu
-               ON (tu.group_id = g.id)
+        $sql = "SELECT DISTINCT name
+               FROM $table_group g
+               LEFT JOIN $table_group_user gu
+               ON (gu.group_id = g.id AND g.c_id = gu.c_id)
+               LEFT JOIN $table_tutor_user tu
+               ON (tu.group_id = g.id AND g.c_id = tu.c_id)
                WHERE
-                  tu.c_id= $course_id AND
-                  gu.c_id= $course_id AND
-                  g.c_id= $course_id AND
+                  g.c_id = $course_id AND
                   (gu.user_id = $user_id OR tu.user_id = $user_id) ";
-
         $res = Database::query($sql);
         $groups = array();
         while ($group = Database::fetch_array($res)) {
-            $groups[] .= $group['name'];
+            $groups[] = $group['name'];
         }
         return $groups;
     }

+ 1646 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery-ui-i18n.js

@@ -0,0 +1,1646 @@
+/*! jQuery UI - v1.8.21 - 2012-06-05
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.datepicker-af.js, jquery.ui.datepicker-ar-DZ.js, jquery.ui.datepicker-ar.js, jquery.ui.datepicker-az.js, jquery.ui.datepicker-bg.js, jquery.ui.datepicker-bs.js, jquery.ui.datepicker-ca.js, jquery.ui.datepicker-cs.js, jquery.ui.datepicker-cy-GB.js, jquery.ui.datepicker-da.js, jquery.ui.datepicker-de.js, jquery.ui.datepicker-el.js, jquery.ui.datepicker-en-AU.js, jquery.ui.datepicker-en-GB.js, jquery.ui.datepicker-en-NZ.js, jquery.ui.datepicker-eo.js, jquery.ui.datepicker-es.js, jquery.ui.datepicker-et.js, jquery.ui.datepicker-eu.js, jquery.ui.datepicker-fa.js, jquery.ui.datepicker-fi.js, jquery.ui.datepicker-fo.js, jquery.ui.datepicker-fr-CH.js, jquery.ui.datepicker-fr.js, jquery.ui.datepicker-gl.js, jquery.ui.datepicker-he.js, jquery.ui.datepicker-hi.js, jquery.ui.datepicker-hr.js, jquery.ui.datepicker-hu.js, jquery.ui.datepicker-hy.js, jquery.ui.datepicker-id.js, jquery.ui.datepicker-is.js, jquery.ui.datepicker-it.js, jquery.ui.datepicker-ja.js, jquery.ui.datepicker-ka.js, jquery.ui.datepicker-kk.js, jquery.ui.datepicker-km.js, jquery.ui.datepicker-ko.js, jquery.ui.datepicker-lb.js, jquery.ui.datepicker-lt.js, jquery.ui.datepicker-lv.js, jquery.ui.datepicker-mk.js, jquery.ui.datepicker-ml.js, jquery.ui.datepicker-ms.js, jquery.ui.datepicker-nl-BE.js, jquery.ui.datepicker-nl.js, jquery.ui.datepicker-no.js, jquery.ui.datepicker-pl.js, jquery.ui.datepicker-pt-BR.js, jquery.ui.datepicker-pt.js, jquery.ui.datepicker-rm.js, jquery.ui.datepicker-ro.js, jquery.ui.datepicker-ru.js, jquery.ui.datepicker-sk.js, jquery.ui.datepicker-sl.js, jquery.ui.datepicker-sq.js, jquery.ui.datepicker-sr-SR.js, jquery.ui.datepicker-sr.js, jquery.ui.datepicker-sv.js, jquery.ui.datepicker-ta.js, jquery.ui.datepicker-th.js, jquery.ui.datepicker-tj.js, jquery.ui.datepicker-tr.js, jquery.ui.datepicker-uk.js, jquery.ui.datepicker-vi.js, jquery.ui.datepicker-zh-CN.js, jquery.ui.datepicker-zh-HK.js, jquery.ui.datepicker-zh-TW.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+
+/* Afrikaans initialisation for the jQuery UI date picker plugin. */
+/* Written by Renier Pretorius. */
+jQuery(function($){
+	$.datepicker.regional['af'] = {
+		closeText: 'Selekteer',
+		prevText: 'Vorige',
+		nextText: 'Volgende',
+		currentText: 'Vandag',
+		monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
+		'Julie','Augustus','September','Oktober','November','Desember'],
+		monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
+		dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
+		dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
+		dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['af']);
+});
+
+/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
+/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
+
+jQuery(function($){
+	$.datepicker.regional['ar-DZ'] = {
+		closeText: 'إغلاق',
+		prevText: '&#x3c;السابق',
+		nextText: 'التالي&#x3e;',
+		currentText: 'اليوم',
+		monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
+		'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
+		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		weekHeader: 'أسبوع',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 6,
+  		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ar-DZ']);
+});
+
+/* Arabic Translation for jQuery UI date picker plugin. */
+/* Khaled Alhourani -- me@khaledalhourani.com */
+/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
+jQuery(function($){
+	$.datepicker.regional['ar'] = {
+		closeText: 'إغلاق',
+		prevText: '&#x3c;السابق',
+		nextText: 'التالي&#x3e;',
+		currentText: 'اليوم',
+		monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
+		'تموز', 'آب', 'أيلول',	'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
+		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+		weekHeader: 'أسبوع',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 6,
+  		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ar']);
+});
+/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Jamil Najafov (necefov33@gmail.com). */
+jQuery(function($) {
+	$.datepicker.regional['az'] = {
+		closeText: 'Bağla',
+		prevText: '&#x3c;Geri',
+		nextText: 'İrəli&#x3e;',
+		currentText: 'Bugün',
+		monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun',
+		'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
+		monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun',
+		'İyul','Avq','Sen','Okt','Noy','Dek'],
+		dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
+		dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
+		dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
+		weekHeader: 'Hf',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['az']);
+});
+/* Bulgarian initialisation for the jQuery UI date picker plugin. */
+/* Written by Stoyan Kyosev (http://svest.org). */
+jQuery(function($){
+    $.datepicker.regional['bg'] = {
+        closeText: 'затвори',
+        prevText: '&#x3c;назад',
+        nextText: 'напред&#x3e;',
+		nextBigText: '&#x3e;&#x3e;',
+        currentText: 'днес',
+        monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
+        'Юли','Август','Септември','Октомври','Ноември','Декември'],
+        monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
+        'Юли','Авг','Сеп','Окт','Нов','Дек'],
+        dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
+        dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
+        dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
+		weekHeader: 'Wk',
+        dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+        isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['bg']);
+});
+
+/* Bosnian i18n for the jQuery UI date picker plugin. */
+/* Written by Kenan Konjo. */
+jQuery(function($){
+	$.datepicker.regional['bs'] = {
+		closeText: 'Zatvori', 
+		prevText: '&#x3c;', 
+		nextText: '&#x3e;', 
+		currentText: 'Danas', 
+		monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
+		'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
+		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
+		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['bs']);
+});
+/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
+/* Writers: (joan.leon@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ca'] = {
+		closeText: 'Tancar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Seg&#x3e;',
+		currentText: 'Avui',
+		monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny',
+		'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
+		monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
+		'Jul','Ago','Set','Oct','Nov','Des'],
+		dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
+		dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
+		dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ca']);
+});
+/* Czech initialisation for the jQuery UI date picker plugin. */
+/* Written by Tomas Muller (tomas@tomas-muller.net). */
+jQuery(function($){
+	$.datepicker.regional['cs'] = {
+		closeText: 'Zavřít',
+		prevText: '&#x3c;Dříve',
+		nextText: 'Později&#x3e;',
+		currentText: 'Nyní',
+		monthNames: ['leden','únor','březen','duben','květen','červen',
+        'červenec','srpen','září','říjen','listopad','prosinec'],
+		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
+		'čvc','srp','zář','říj','lis','pro'],
+		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
+		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
+		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
+		weekHeader: 'Týd',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['cs']);
+});
+
+/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
+/* Written by William Griffiths. */
+jQuery(function($){
+	$.datepicker.regional['cy-GB'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin',
+		'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'],
+		monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh',
+		'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'],
+		dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
+		dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
+		dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'],
+		weekHeader: 'Wy',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['cy-GB']);
+});
+/* Danish initialisation for the jQuery UI date picker plugin. */
+/* Written by Jan Christensen ( deletestuff@gmail.com). */
+jQuery(function($){
+    $.datepicker.regional['da'] = {
+		closeText: 'Luk',
+        prevText: '&#x3c;Forrige',
+		nextText: 'Næste&#x3e;',
+		currentText: 'Idag',
+        monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
+        'Juli','August','September','Oktober','November','December'],
+        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+        'Jul','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
+		dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
+		dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
+		weekHeader: 'Uge',
+        dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['da']);
+});
+
+/* German initialisation for the jQuery UI date picker plugin. */
+/* Written by Milian Wolff (mail@milianw.de). */
+jQuery(function($){
+	$.datepicker.regional['de'] = {
+		closeText: 'schließen',
+		prevText: '&#x3c;zurück',
+		nextText: 'Vor&#x3e;',
+		currentText: 'heute',
+		monthNames: ['Januar','Februar','März','April','Mai','Juni',
+		'Juli','August','September','Oktober','November','Dezember'],
+		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Dez'],
+		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
+		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+		weekHeader: 'KW',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['de']);
+});
+
+/* Greek (el) initialisation for the jQuery UI date picker plugin. */
+/* Written by Alex Cicovic (http://www.alexcicovic.com) */
+jQuery(function($){
+	$.datepicker.regional['el'] = {
+		closeText: 'Κλείσιμο',
+		prevText: 'Προηγούμενος',
+		nextText: 'Επόμενος',
+		currentText: 'Τρέχων Μήνας',
+		monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
+		'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
+		monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
+		'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
+		dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
+		dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
+		dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
+		weekHeader: 'Εβδ',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['el']);
+});
+/* English/Australia initialisation for the jQuery UI date picker plugin. */
+/* Based on the en-GB initialisation. */
+jQuery(function($){
+	$.datepicker.regional['en-AU'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-AU']);
+});
+
+/* English/UK initialisation for the jQuery UI date picker plugin. */
+/* Written by Stuart. */
+jQuery(function($){
+	$.datepicker.regional['en-GB'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-GB']);
+});
+
+/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
+/* Based on the en-GB initialisation. */
+jQuery(function($){
+	$.datepicker.regional['en-NZ'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-NZ']);
+});
+
+/* Esperanto initialisation for the jQuery UI date picker plugin. */
+/* Written by Olivier M. (olivierweb@ifrance.com). */
+jQuery(function($){
+	$.datepicker.regional['eo'] = {
+		closeText: 'Fermi',
+		prevText: '&lt;Anta',
+		nextText: 'Sekv&gt;',
+		currentText: 'Nuna',
+		monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
+		'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Aŭg','Sep','Okt','Nov','Dec'],
+		dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
+		dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
+		dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
+		weekHeader: 'Sb',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['eo']);
+});
+
+/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
+/* Traducido por Vester (xvester@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['es'] = {
+		closeText: 'Cerrar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Sig&#x3e;',
+		currentText: 'Hoy',
+		monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
+		'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
+		monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
+		'Jul','Ago','Sep','Oct','Nov','Dic'],
+		dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
+		dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
+		dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['es']);
+});
+/* Estonian initialisation for the jQuery UI date picker plugin. */
+/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
+jQuery(function($){
+	$.datepicker.regional['et'] = {
+		closeText: 'Sulge',
+		prevText: 'Eelnev',
+		nextText: 'Järgnev',
+		currentText: 'Täna',
+		monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
+		'Juuli','August','September','Oktoober','November','Detsember'],
+		monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
+		'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
+		dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
+		dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
+		dayNamesMin: ['P','E','T','K','N','R','L'],
+		weekHeader: 'näd',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['et']);
+}); 
+/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
+/* Karrikas-ek itzulia (karrikas@karrikas.com) */
+jQuery(function($){
+	$.datepicker.regional['eu'] = {
+		closeText: 'Egina',
+		prevText: '&#x3c;Aur',
+		nextText: 'Hur&#x3e;',
+		currentText: 'Gaur',
+		monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
+			'uztaila','abuztua','iraila','urria','azaroa','abendua'],
+		monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
+			'uzt.','abu.','ira.','urr.','aza.','abe.'],
+		dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
+		dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
+		dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
+		weekHeader: 'As',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['eu']);
+});
+/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
+/* Javad Mowlanezhad -- jmowla@gmail.com */
+/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
+jQuery(function($) {
+	$.datepicker.regional['fa'] = {
+		closeText: 'بستن',
+		prevText: '&#x3C;قبلی',
+		nextText: 'بعدی&#x3E;',
+		currentText: 'امروز',
+		monthNames: [
+			'فروردين',
+			'ارديبهشت',
+			'خرداد',
+			'تير',
+			'مرداد',
+			'شهريور',
+			'مهر',
+			'آبان',
+			'آذر',
+			'دی',
+			'بهمن',
+			'اسفند'
+		],
+		monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
+		dayNames: [
+			'يکشنبه',
+			'دوشنبه',
+			'سه‌شنبه',
+			'چهارشنبه',
+			'پنجشنبه',
+			'جمعه',
+			'شنبه'
+		],
+		dayNamesShort: [
+			'ی',
+			'د',
+			'س',
+			'چ',
+			'پ',
+			'ج', 
+			'ش'
+		],
+		dayNamesMin: [
+			'ی',
+			'د',
+			'س',
+			'چ',
+			'پ',
+			'ج', 
+			'ش'
+		],
+		weekHeader: 'هف',
+		dateFormat: 'yy/mm/dd',
+		firstDay: 6,
+		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fa']);
+});
+/* Finnish initialisation for the jQuery UI date picker plugin. */
+/* Written by Harri Kilpiö (harrikilpio@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['fi'] = {
+		closeText: 'Sulje',
+		prevText: '&#xAB;Edellinen',
+		nextText: 'Seuraava&#xBB;',
+		currentText: 'T&#xE4;n&#xE4;&#xE4;n',
+		monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&#xE4;kuu',
+		'Hein&#xE4;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
+		monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&#xE4;',
+		'Hein&#xE4;','Elo','Syys','Loka','Marras','Joulu'],
+		dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
+		dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
+		dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
+		weekHeader: 'Vk',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fi']);
+});
+
+/* Faroese initialisation for the jQuery UI date picker plugin */
+/* Written by Sverri Mohr Olsen, sverrimo@gmail.com */
+jQuery(function($){
+	$.datepicker.regional['fo'] = {
+		closeText: 'Lat aftur',
+		prevText: '&#x3c;Fyrra',
+		nextText: 'Næsta&#x3e;',
+		currentText: 'Í dag',
+		monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
+		'Juli','August','September','Oktober','November','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Des'],
+		dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
+		dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
+		dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
+		weekHeader: 'Vk',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fo']);
+});
+
+/* Swiss-French initialisation for the jQuery UI date picker plugin. */
+/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
+jQuery(function($){
+	$.datepicker.regional['fr-CH'] = {
+		closeText: 'Fermer',
+		prevText: '&#x3c;Préc',
+		nextText: 'Suiv&#x3e;',
+		currentText: 'Courant',
+		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
+		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
+		'Jul','Aoû','Sep','Oct','Nov','Déc'],
+		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
+		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fr-CH']);
+});
+/* French initialisation for the jQuery UI date picker plugin. */
+/* Written by Keith Wood (kbwood{at}iinet.com.au),
+              Stéphane Nahmani (sholby@sholby.net),
+              Stéphane Raimbault <stephane.raimbault@gmail.com> */
+jQuery(function($){
+	$.datepicker.regional['fr'] = {
+		closeText: 'Fermer',
+		prevText: 'Précédent',
+		nextText: 'Suivant',
+		currentText: 'Aujourd\'hui',
+		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
+		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+		monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin',
+		'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
+		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+		dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
+		dayNamesMin: ['D','L','M','M','J','V','S'],
+		weekHeader: 'Sem.',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fr']);
+});
+
+/* Galician localization for 'UI date picker' jQuery extension. */
+/* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */
+jQuery(function($){
+	$.datepicker.regional['gl'] = {
+		closeText: 'Pechar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Seg&#x3e;',
+		currentText: 'Hoxe',
+		monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
+		'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
+		monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
+		'Xul','Ago','Set','Out','Nov','Dec'],
+		dayNames: ['Domingo','Luns','Martes','M&eacute;rcores','Xoves','Venres','S&aacute;bado'],
+		dayNamesShort: ['Dom','Lun','Mar','M&eacute;r','Xov','Ven','S&aacute;b'],
+		dayNamesMin: ['Do','Lu','Ma','M&eacute;','Xo','Ve','S&aacute;'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['gl']);
+});
+/* Hebrew initialisation for the UI Datepicker extension. */
+/* Written by Amir Hardon (ahardon at gmail dot com). */
+jQuery(function($){
+	$.datepicker.regional['he'] = {
+		closeText: 'סגור',
+		prevText: '&#x3c;הקודם',
+		nextText: 'הבא&#x3e;',
+		currentText: 'היום',
+		monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
+		'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
+		monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
+		'יולי','אוג','ספט','אוק','נוב','דצמ'],
+		dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
+		dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+		dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['he']);
+});
+
+/* Hindi initialisation for the jQuery UI date picker plugin. */
+/* Written by Michael Dawart. */
+jQuery(function($){
+	$.datepicker.regional['hi'] = {
+		closeText: 'बंद',
+		prevText: 'पिछला',
+		nextText: 'अगला',
+		currentText: 'आज',
+		monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
+		'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
+		monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
+		'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
+		dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
+		dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+		dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+		weekHeader: 'हफ्ता',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hi']);
+});
+
+/* Croatian i18n for the jQuery UI date picker plugin. */
+/* Written by Vjekoslav Nesek. */
+jQuery(function($){
+	$.datepicker.regional['hr'] = {
+		closeText: 'Zatvori',
+		prevText: '&#x3c;',
+		nextText: '&#x3e;',
+		currentText: 'Danas',
+		monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
+		'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
+		monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
+		'Srp','Kol','Ruj','Lis','Stu','Pro'],
+		dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
+		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
+		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+		weekHeader: 'Tje',
+		dateFormat: 'dd.mm.yy.',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hr']);
+});
+/* Hungarian initialisation for the jQuery UI date picker plugin. */
+/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */
+jQuery(function($){
+	$.datepicker.regional['hu'] = {
+		closeText: 'bezár',
+		prevText: 'vissza',
+		nextText: 'előre',
+		currentText: 'ma',
+		monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
+		'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
+		monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
+		'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
+		dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
+		dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
+		dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+		weekHeader: 'Hét',
+		dateFormat: 'yy.mm.dd.',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hu']);
+});
+
+/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
+jQuery(function($){
+	$.datepicker.regional['hy'] = {
+		closeText: 'Փակել',
+		prevText: '&#x3c;Նախ.',
+		nextText: 'Հաջ.&#x3e;',
+		currentText: 'Այսօր',
+		monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
+		'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
+		monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
+		'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
+		dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
+		dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
+		dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
+		weekHeader: 'ՇԲՏ',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hy']);
+});
+/* Indonesian initialisation for the jQuery UI date picker plugin. */
+/* Written by Deden Fathurahman (dedenf@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['id'] = {
+		closeText: 'Tutup',
+		prevText: '&#x3c;mundur',
+		nextText: 'maju&#x3e;',
+		currentText: 'hari ini',
+		monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
+		'Juli','Agustus','September','Oktober','Nopember','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+		'Jul','Agus','Sep','Okt','Nop','Des'],
+		dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
+		dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
+		dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
+		weekHeader: 'Mg',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['id']);
+});
+/* Icelandic initialisation for the jQuery UI date picker plugin. */
+/* Written by Haukur H. Thorsson (haukur@eskill.is). */
+jQuery(function($){
+	$.datepicker.regional['is'] = {
+		closeText: 'Loka',
+		prevText: '&#x3c; Fyrri',
+		nextText: 'N&aelig;sti &#x3e;',
+		currentText: '&Iacute; dag',
+		monthNames: ['Jan&uacute;ar','Febr&uacute;ar','Mars','Apr&iacute;l','Ma&iacute','J&uacute;n&iacute;',
+		'J&uacute;l&iacute;','&Aacute;g&uacute;st','September','Okt&oacute;ber','N&oacute;vember','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Ma&iacute;','J&uacute;n',
+		'J&uacute;l','&Aacute;g&uacute;','Sep','Okt','N&oacute;v','Des'],
+		dayNames: ['Sunnudagur','M&aacute;nudagur','&THORN;ri&eth;judagur','Mi&eth;vikudagur','Fimmtudagur','F&ouml;studagur','Laugardagur'],
+		dayNamesShort: ['Sun','M&aacute;n','&THORN;ri','Mi&eth;','Fim','F&ouml;s','Lau'],
+		dayNamesMin: ['Su','M&aacute;','&THORN;r','Mi','Fi','F&ouml;','La'],
+		weekHeader: 'Vika',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['is']);
+});
+/* Italian initialisation for the jQuery UI date picker plugin. */
+/* Written by Antonello Pasella (antonello.pasella@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['it'] = {
+		closeText: 'Chiudi',
+		prevText: '&#x3c;Prec',
+		nextText: 'Succ&#x3e;',
+		currentText: 'Oggi',
+		monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
+			'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
+		monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
+			'Lug','Ago','Set','Ott','Nov','Dic'],
+		dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'],
+		dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
+		dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['it']);
+});
+
+/* Japanese initialisation for the jQuery UI date picker plugin. */
+/* Written by Kentaro SATO (kentaro@ranvis.com). */
+jQuery(function($){
+	$.datepicker.regional['ja'] = {
+		closeText: '閉じる',
+		prevText: '&#x3c;前',
+		nextText: '次&#x3e;',
+		currentText: '今日',
+		monthNames: ['1月','2月','3月','4月','5月','6月',
+		'7月','8月','9月','10月','11月','12月'],
+		monthNamesShort: ['1月','2月','3月','4月','5月','6月',
+		'7月','8月','9月','10月','11月','12月'],
+		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
+		dayNamesShort: ['日','月','火','水','木','金','土'],
+		dayNamesMin: ['日','月','火','水','木','金','土'],
+		weekHeader: '週',
+		dateFormat: 'yy/mm/dd',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '年'};
+	$.datepicker.setDefaults($.datepicker.regional['ja']);
+});
+/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Lado Lomidze (lado.lomidze@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ka'] = {
+		closeText: 'დახურვა',
+		prevText: '&#x3c; წინა',
+		nextText: 'შემდეგი &#x3e;',
+		currentText: 'დღეს',
+		monthNames: ['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი', 'ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'],
+		monthNamesShort: ['იან','თებ','მარ','აპრ','მაი','ივნ', 'ივლ','აგვ','სექ','ოქტ','ნოე','დეკ'],
+		dayNames: ['კვირა','ორშაბათი','სამშაბათი','ოთხშაბათი','ხუთშაბათი','პარასკევი','შაბათი'],
+		dayNamesShort: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
+		dayNamesMin: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
+		weekHeader: 'კვირა',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ka']);
+});
+
+/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['kk'] = {
+		closeText: 'Жабу',
+		prevText: '&#x3c;Алдыңғы',
+		nextText: 'Келесі&#x3e;',
+		currentText: 'Бүгін',
+		monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
+		'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
+		monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
+		'Шіл','Там','Қыр','Қаз','Қар','Жел'],
+		dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
+		dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
+		dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
+		weekHeader: 'Не',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['kk']);
+});
+
+/* Khmer initialisation for the jQuery calendar extension. */
+/* Written by Chandara Om (chandara.teacher@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['km'] = {
+		closeText: 'ធ្វើ​រួច',
+		prevText: 'មុន',
+		nextText: 'បន្ទាប់',
+		currentText: 'ថ្ងៃ​នេះ',
+		monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+		monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+		dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
+		dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+		dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+		weekHeader: 'សប្ដាហ៍',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['km']);
+});
+
+/* Korean initialisation for the jQuery calendar extension. */
+/* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */
+jQuery(function($){
+	$.datepicker.regional['ko'] = {
+		closeText: '닫기',
+		prevText: '이전달',
+		nextText: '다음달',
+		currentText: '오늘',
+		monthNames: ['1월','2월','3월','4월','5월','6월',
+		'7월','8월','9월','10월','11월','12월'],
+		monthNamesShort: ['1월','2월','3월','4월','5월','6월',
+		'7월','8월','9월','10월','11월','12월'],
+		dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
+		dayNamesShort: ['일','월','화','수','목','금','토'],
+		dayNamesMin: ['일','월','화','수','목','금','토'],
+		weekHeader: 'Wk',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '년'};
+	$.datepicker.setDefaults($.datepicker.regional['ko']);
+});
+/* Luxembourgish initialisation for the jQuery UI date picker plugin. */
+/* Written by Michel Weimerskirch <michel@weimerskirch.net> */
+jQuery(function($){
+	$.datepicker.regional['lb'] = {
+		closeText: 'Fäerdeg',
+		prevText: 'Zréck',
+		nextText: 'Weider',
+		currentText: 'Haut',
+		monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
+		'Juli','August','September','Oktober','November','Dezember'],
+		monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+		dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
+		dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
+		dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
+		weekHeader: 'W',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lb']);
+});
+
+/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* @author Arturas Paleicikas <arturas@avalon.lt> */
+jQuery(function($){
+	$.datepicker.regional['lt'] = {
+		closeText: 'Uždaryti',
+		prevText: '&#x3c;Atgal',
+		nextText: 'Pirmyn&#x3e;',
+		currentText: 'Šiandien',
+		monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
+		'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
+		monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
+		'Lie','Rugp','Rugs','Spa','Lap','Gru'],
+		dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
+		dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
+		dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'],
+		weekHeader: 'Wk',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lt']);
+});
+/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
+jQuery(function($){
+	$.datepicker.regional['lv'] = {
+		closeText: 'Aizvērt',
+		prevText: 'Iepr',
+		nextText: 'Nāka',
+		currentText: 'Šodien',
+		monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
+		'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
+		'Jūl','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
+		dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
+		dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
+		weekHeader: 'Nav',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lv']);
+});
+/* Macedonian i18n for the jQuery UI date picker plugin. */
+/* Written by Stojce Slavkovski. */
+jQuery(function($){
+	$.datepicker.regional['mk'] = {
+		closeText: 'Затвори',
+		prevText: '&#x3C;',
+		nextText: '&#x3E;',
+		currentText: 'Денес',
+		monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
+		'Јули','Август','Септември','Октомври','Ноември','Декември'],
+		monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
+		'Јул','Авг','Сеп','Окт','Ное','Дек'],
+		dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
+		dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
+		dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
+		weekHeader: 'Сед',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['mk']);
+});
+
+/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Saji Nediyanchath (saji89@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ml'] = {
+		closeText: 'ശരി',
+		prevText: 'മുന്നത്തെ',  
+		nextText: 'അടുത്തത് ',
+		currentText: 'ഇന്ന്',
+		monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍',
+		'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'],
+		monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍',
+		'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'],
+		dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
+		dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
+		dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'],
+		weekHeader: 'ആ',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ml']);
+});
+
+/* Malaysian initialisation for the jQuery UI date picker plugin. */
+/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
+jQuery(function($){
+	$.datepicker.regional['ms'] = {
+		closeText: 'Tutup',
+		prevText: '&#x3c;Sebelum',
+		nextText: 'Selepas&#x3e;',
+		currentText: 'hari ini',
+		monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
+		'Julai','Ogos','September','Oktober','November','Disember'],
+		monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
+		'Jul','Ogo','Sep','Okt','Nov','Dis'],
+		dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
+		dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
+		dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
+		weekHeader: 'Mg',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ms']);
+});
+/* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */
+/* David De Sloovere @DavidDeSloovere */
+jQuery(function($){
+	$.datepicker.regional['nl-BE'] = {
+		closeText: 'Sluiten',
+		prevText: '←',
+		nextText: '→',
+		currentText: 'Vandaag',
+		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
+		'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
+		monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
+		'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
+		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
+		dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
+		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['nl-BE']);
+});
+
+/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Mathias Bynens <http://mathiasbynens.be/> */
+jQuery(function($){
+	$.datepicker.regional.nl = {
+		closeText: 'Sluiten',
+		prevText: '←',
+		nextText: '→',
+		currentText: 'Vandaag',
+		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
+		'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
+		monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
+		'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
+		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
+		dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
+		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional.nl);
+});
+/* Norwegian initialisation for the jQuery UI date picker plugin. */
+/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */
+
+jQuery(function($){
+  $.datepicker.regional['no'] = {
+    closeText: 'Lukk',
+    prevText: '&laquo;Forrige',
+    nextText: 'Neste&raquo;',
+    currentText: 'I dag',
+    monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
+    monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
+    dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
+    dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
+    dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
+    weekHeader: 'Uke',
+    dateFormat: 'dd.mm.yy',
+    firstDay: 1,
+    isRTL: false,
+    showMonthAfterYear: false,
+    yearSuffix: ''
+  };
+  $.datepicker.setDefaults($.datepicker.regional['no']);
+});
+
+/* Polish initialisation for the jQuery UI date picker plugin. */
+/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['pl'] = {
+		closeText: 'Zamknij',
+		prevText: '&#x3c;Poprzedni',
+		nextText: 'Następny&#x3e;',
+		currentText: 'Dziś',
+		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
+		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
+		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
+		'Lip','Sie','Wrz','Pa','Lis','Gru'],
+		dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
+		dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
+		dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
+		weekHeader: 'Tydz',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['pl']);
+});
+
+/* Brazilian initialisation for the jQuery UI date picker plugin. */
+/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['pt-BR'] = {
+		closeText: 'Fechar',
+		prevText: '&#x3c;Anterior',
+		nextText: 'Pr&oacute;ximo&#x3e;',
+		currentText: 'Hoje',
+		monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
+		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
+		'Jul','Ago','Set','Out','Nov','Dez'],
+		dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
+		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
+		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
+});
+/* Portuguese initialisation for the jQuery UI date picker plugin. */
+jQuery(function($){
+	$.datepicker.regional['pt'] = {
+		closeText: 'Fechar',
+		prevText: '&#x3c;Anterior',
+		nextText: 'Seguinte',
+		currentText: 'Hoje',
+		monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
+		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
+		'Jul','Ago','Set','Out','Nov','Dez'],
+		dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
+		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
+		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
+		weekHeader: 'Sem',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['pt']);
+});
+/* Romansh initialisation for the jQuery UI date picker plugin. */
+/* Written by Yvonne Gienal (yvonne.gienal@educa.ch). */
+jQuery(function($){
+	$.datepicker.regional['rm'] = {
+		closeText: 'Serrar',
+		prevText: '&#x3c;Suandant',
+		nextText: 'Precedent&#x3e;',
+		currentText: 'Actual',
+		monthNames: ['Schaner','Favrer','Mars','Avrigl','Matg','Zercladur', 'Fanadur','Avust','Settember','October','November','December'],
+		monthNamesShort: ['Scha','Fev','Mar','Avr','Matg','Zer', 'Fan','Avu','Sett','Oct','Nov','Dec'],
+		dayNames: ['Dumengia','Glindesdi','Mardi','Mesemna','Gievgia','Venderdi','Sonda'],
+		dayNamesShort: ['Dum','Gli','Mar','Mes','Gie','Ven','Som'],
+		dayNamesMin: ['Du','Gl','Ma','Me','Gi','Ve','So'],
+		weekHeader: 'emna',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['rm']);
+});
+
+/* Romanian initialisation for the jQuery UI date picker plugin.
+ *
+ * Written by Edmond L. (ll_edmond@walla.com)
+ * and Ionut G. Stan (ionut.g.stan@gmail.com)
+ */
+jQuery(function($){
+	$.datepicker.regional['ro'] = {
+		closeText: 'Închide',
+		prevText: '&laquo; Luna precedentă',
+		nextText: 'Luna următoare &raquo;',
+		currentText: 'Azi',
+		monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie',
+		'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
+		monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun',
+		'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'],
+		dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
+		dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'],
+		weekHeader: 'Săpt',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ro']);
+});
+
+/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Andrew Stromnov (stromnov@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ru'] = {
+		closeText: 'Закрыть',
+		prevText: '&#x3c;Пред',
+		nextText: 'След&#x3e;',
+		currentText: 'Сегодня',
+		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
+		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
+		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
+		'Июл','Авг','Сен','Окт','Ноя','Дек'],
+		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
+		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
+		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
+		weekHeader: 'Нед',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ru']);
+});
+/* Slovak initialisation for the jQuery UI date picker plugin. */
+/* Written by Vojtech Rinik (vojto@hmm.sk). */
+jQuery(function($){
+	$.datepicker.regional['sk'] = {
+		closeText: 'Zavrieť',
+		prevText: '&#x3c;Predchádzajúci',
+		nextText: 'Nasledujúci&#x3e;',
+		currentText: 'Dnes',
+		monthNames: ['Január','Február','Marec','Apríl','Máj','Jún',
+		'Júl','August','September','Október','November','December'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
+		'Júl','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'],
+		dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'],
+		dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'],
+		weekHeader: 'Ty',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['sk']);
+});
+
+/* Slovenian initialisation for the jQuery UI date picker plugin. */
+/* Written by Jaka Jancar (jaka@kubje.org). */
+/* c = &#x10D;, s = &#x161; z = &#x17E; C = &#x10C; S = &#x160; Z = &#x17D; */
+jQuery(function($){
+	$.datepicker.regional['sl'] = {
+		closeText: 'Zapri',
+		prevText: '&lt;Prej&#x161;nji',
+		nextText: 'Naslednji&gt;',
+		currentText: 'Trenutni',
+		monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
+		'Julij','Avgust','September','Oktober','November','December'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Avg','Sep','Okt','Nov','Dec'],
+		dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','&#x10C;etrtek','Petek','Sobota'],
+		dayNamesShort: ['Ned','Pon','Tor','Sre','&#x10C;et','Pet','Sob'],
+		dayNamesMin: ['Ne','Po','To','Sr','&#x10C;e','Pe','So'],
+		weekHeader: 'Teden',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['sl']);
+});
+
+/* Albanian initialisation for the jQuery UI date picker plugin. */
+/* Written by Flakron Bytyqi (flakron@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['sq'] = {
+		closeText: 'mbylle',
+		prevText: '&#x3c;mbrapa',
+		nextText: 'Përpara&#x3e;',
+		currentText: 'sot',
+		monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
+		'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
+		monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
+		'Kor','Gus','Sht','Tet','Nën','Dhj'],
+		dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
+		dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
+		dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
+		weekHeader: 'Ja',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['sq']);
+});
+
+/* Serbian i18n for the jQuery UI date picker plugin. */
+/* Written by Dejan Dimić. */
+jQuery(function($){
+	$.datepicker.regional['sr-SR'] = {
+		closeText: 'Zatvori',
+		prevText: '&#x3c;',
+		nextText: '&#x3e;',
+		currentText: 'Danas',
+		monthNames: ['Januar','Februar','Mart','April','Maj','Jun',
+		'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Avg','Sep','Okt','Nov','Dec'],
+		dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'],
+		dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'],
+		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+		weekHeader: 'Sed',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['sr-SR']);
+});
+
+/* Serbian i18n for the jQuery UI date picker plugin. */
+/* Written by Dejan Dimić. */
+jQuery(function($){
+	$.datepicker.regional['sr'] = {
+		closeText: 'Затвори',
+		prevText: '&#x3c;',
+		nextText: '&#x3e;',
+		currentText: 'Данас',
+		monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
+		'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
+		monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
+		'Јул','Авг','Сеп','Окт','Нов','Дец'],
+		dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
+		dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
+		dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
+		weekHeader: 'Сед',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['sr']);
+});
+
+/* Swedish initialisation for the jQuery UI date picker plugin. */
+/* Written by Anders Ekdahl ( anders@nomadiz.se). */
+jQuery(function($){
+    $.datepicker.regional['sv'] = {
+		closeText: 'Stäng',
+        prevText: '&laquo;Förra',
+		nextText: 'Nästa&raquo;',
+		currentText: 'Idag',
+        monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
+        'Juli','Augusti','September','Oktober','November','December'],
+        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+        'Jul','Aug','Sep','Okt','Nov','Dec'],
+		dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
+		dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
+		dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
+		weekHeader: 'Ve',
+        dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['sv']);
+});
+
+/* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by S A Sureshkumar (saskumar@live.com). */
+jQuery(function($){
+	$.datepicker.regional['ta'] = {
+		closeText: 'மூடு',
+		prevText: 'முன்னையது',
+		nextText: 'அடுத்தது',
+		currentText: 'இன்று',
+		monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி',
+		'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'],
+		monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி',
+		'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'],
+		dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'],
+		dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'],
+		dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'],
+		weekHeader: 'Не',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ta']);
+});
+
+/* Thai initialisation for the jQuery UI date picker plugin. */
+/* Written by pipo (pipo@sixhead.com). */
+jQuery(function($){
+	$.datepicker.regional['th'] = {
+		closeText: 'ปิด',
+		prevText: '&laquo;&nbsp;ย้อน',
+		nextText: 'ถัดไป&nbsp;&raquo;',
+		currentText: 'วันนี้',
+		monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
+		'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
+		monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
+		'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
+		dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
+		dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
+		dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['th']);
+});
+/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Abdurahmon Saidov (saidovab@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['tj'] = {
+		closeText: 'Идома',
+		prevText: '&#x3c;Қафо',
+		nextText: 'Пеш&#x3e;',
+		currentText: 'Имрӯз',
+		monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн',
+		'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'],
+		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
+		'Июл','Авг','Сен','Окт','Ноя','Дек'],
+		dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'],
+		dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'],
+		dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'],
+		weekHeader: 'Хф',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['tj']);
+});
+/* Turkish initialisation for the jQuery UI date picker plugin. */
+/* Written by Izzet Emre Erkan (kara@karalamalar.net). */
+jQuery(function($){
+	$.datepicker.regional['tr'] = {
+		closeText: 'kapat',
+		prevText: '&#x3c;geri',
+		nextText: 'ileri&#x3e',
+		currentText: 'bugün',
+		monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
+		'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
+		monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
+		'Tem','Ağu','Eyl','Eki','Kas','Ara'],
+		dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
+		dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
+		dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
+		weekHeader: 'Hf',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['tr']);
+});
+/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
+/* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['uk'] = {
+		closeText: 'Закрити',
+		prevText: '&#x3c;',
+		nextText: '&#x3e;',
+		currentText: 'Сьогодні',
+		monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
+		'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
+		monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
+		'Лип','Сер','Вер','Жов','Лис','Гру'],
+		dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
+		dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
+		dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
+		weekHeader: 'Тиж',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['uk']);
+});
+/* Vietnamese initialisation for the jQuery UI date picker plugin. */
+/* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */
+jQuery(function($){
+	$.datepicker.regional['vi'] = {
+		closeText: 'Đóng',
+		prevText: '&#x3c;Trước',
+		nextText: 'Tiếp&#x3e;',
+		currentText: 'Hôm nay',
+		monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
+		'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
+		monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
+		'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
+		dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
+		dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
+		dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
+		weekHeader: 'Tu',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['vi']);
+});
+
+/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* Written by Cloudream (cloudream@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['zh-CN'] = {
+		closeText: '关闭',
+		prevText: '&#x3c;上月',
+		nextText: '下月&#x3e;',
+		currentText: '今天',
+		monthNames: ['一月','二月','三月','四月','五月','六月',
+		'七月','八月','九月','十月','十一月','十二月'],
+		monthNamesShort: ['一','二','三','四','五','六',
+		'七','八','九','十','十一','十二'],
+		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
+		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
+		dayNamesMin: ['日','一','二','三','四','五','六'],
+		weekHeader: '周',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '年'};
+	$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
+});
+
+/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* Written by SCCY (samuelcychan@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['zh-HK'] = {
+		closeText: '關閉',
+		prevText: '&#x3c;上月',
+		nextText: '下月&#x3e;',
+		currentText: '今天',
+		monthNames: ['一月','二月','三月','四月','五月','六月',
+		'七月','八月','九月','十月','十一月','十二月'],
+		monthNamesShort: ['一','二','三','四','五','六',
+		'七','八','九','十','十一','十二'],
+		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
+		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
+		dayNamesMin: ['日','一','二','三','四','五','六'],
+		weekHeader: '周',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '年'};
+	$.datepicker.setDefaults($.datepicker.regional['zh-HK']);
+});
+
+/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* Written by Ressol (ressol@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['zh-TW'] = {
+		closeText: '關閉',
+		prevText: '&#x3c;上月',
+		nextText: '下月&#x3e;',
+		currentText: '今天',
+		monthNames: ['一月','二月','三月','四月','五月','六月',
+		'七月','八月','九月','十月','十一月','十二月'],
+		monthNamesShort: ['一','二','三','四','五','六',
+		'七','八','九','十','十一','十二'],
+		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
+		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
+		dayNamesMin: ['日','一','二','三','四','五','六'],
+		weekHeader: '周',
+		dateFormat: 'yy/mm/dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '年'};
+	$.datepicker.setDefaults($.datepicker.regional['zh-TW']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-af.js

@@ -0,0 +1,23 @@
+/* Afrikaans initialisation for the jQuery UI date picker plugin. */
+/* Written by Renier Pretorius. */
+jQuery(function($){
+	$.datepicker.regional['af'] = {
+		closeText: 'Selekteer',
+		prevText: 'Vorige',
+		nextText: 'Volgende',
+		currentText: 'Vandag',
+		monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
+		'Julie','Augustus','September','Oktober','November','Desember'],
+		monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
+		dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
+		dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
+		dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['af']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ar-DZ.js

@@ -0,0 +1,23 @@
+/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
+/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
+
+jQuery(function($){
+	$.datepicker.regional['ar-DZ'] = {
+		closeText: 'إغلاق',
+		prevText: '&#x3c;السابق',
+		nextText: 'التالي&#x3e;',
+		currentText: 'اليوم',
+		monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
+		'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
+		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		weekHeader: 'أسبوع',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 6,
+  		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ar-DZ']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ar.js

@@ -0,0 +1,23 @@
+/* Arabic Translation for jQuery UI date picker plugin. */
+/* Khaled Alhourani -- me@khaledalhourani.com */
+/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
+jQuery(function($){
+	$.datepicker.regional['ar'] = {
+		closeText: 'إغلاق',
+		prevText: '&#x3c;السابق',
+		nextText: 'التالي&#x3e;',
+		currentText: 'اليوم',
+		monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
+		'تموز', 'آب', 'أيلول',	'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
+		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+		dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+		weekHeader: 'أسبوع',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 6,
+  		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ar']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-az.js

@@ -0,0 +1,23 @@
+/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Jamil Najafov (necefov33@gmail.com). */
+jQuery(function($) {
+	$.datepicker.regional['az'] = {
+		closeText: 'Bağla',
+		prevText: '&#x3c;Geri',
+		nextText: 'İrəli&#x3e;',
+		currentText: 'Bugün',
+		monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun',
+		'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
+		monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun',
+		'İyul','Avq','Sen','Okt','Noy','Dek'],
+		dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
+		dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
+		dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
+		weekHeader: 'Hf',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['az']);
+});

+ 24 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-bg.js

@@ -0,0 +1,24 @@
+/* Bulgarian initialisation for the jQuery UI date picker plugin. */
+/* Written by Stoyan Kyosev (http://svest.org). */
+jQuery(function($){
+    $.datepicker.regional['bg'] = {
+        closeText: 'затвори',
+        prevText: '&#x3c;назад',
+        nextText: 'напред&#x3e;',
+		nextBigText: '&#x3e;&#x3e;',
+        currentText: 'днес',
+        monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
+        'Юли','Август','Септември','Октомври','Ноември','Декември'],
+        monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
+        'Юли','Авг','Сеп','Окт','Нов','Дек'],
+        dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
+        dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
+        dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
+		weekHeader: 'Wk',
+        dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+        isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['bg']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-bs.js

@@ -0,0 +1,23 @@
+/* Bosnian i18n for the jQuery UI date picker plugin. */
+/* Written by Kenan Konjo. */
+jQuery(function($){
+	$.datepicker.regional['bs'] = {
+		closeText: 'Zatvori', 
+		prevText: '&#x3c;', 
+		nextText: '&#x3e;', 
+		currentText: 'Danas', 
+		monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
+		'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
+		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
+		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['bs']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ca.js

@@ -0,0 +1,23 @@
+/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
+/* Writers: (joan.leon@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ca'] = {
+		closeText: 'Tancar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Seg&#x3e;',
+		currentText: 'Avui',
+		monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny',
+		'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
+		monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
+		'Jul','Ago','Set','Oct','Nov','Des'],
+		dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
+		dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
+		dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ca']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-cs.js

@@ -0,0 +1,23 @@
+/* Czech initialisation for the jQuery UI date picker plugin. */
+/* Written by Tomas Muller (tomas@tomas-muller.net). */
+jQuery(function($){
+	$.datepicker.regional['cs'] = {
+		closeText: 'Zavřít',
+		prevText: '&#x3c;Dříve',
+		nextText: 'Později&#x3e;',
+		currentText: 'Nyní',
+		monthNames: ['leden','únor','březen','duben','květen','červen',
+        'červenec','srpen','září','říjen','listopad','prosinec'],
+		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
+		'čvc','srp','zář','říj','lis','pro'],
+		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
+		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
+		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
+		weekHeader: 'Týd',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['cs']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-cy-GB.js

@@ -0,0 +1,23 @@
+/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
+/* Written by William Griffiths. */
+jQuery(function($){
+	$.datepicker.regional['cy-GB'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin',
+		'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'],
+		monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh',
+		'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'],
+		dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
+		dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
+		dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'],
+		weekHeader: 'Wy',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['cy-GB']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-da.js

@@ -0,0 +1,23 @@
+/* Danish initialisation for the jQuery UI date picker plugin. */
+/* Written by Jan Christensen ( deletestuff@gmail.com). */
+jQuery(function($){
+    $.datepicker.regional['da'] = {
+		closeText: 'Luk',
+        prevText: '&#x3c;Forrige',
+		nextText: 'Næste&#x3e;',
+		currentText: 'Idag',
+        monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
+        'Juli','August','September','Oktober','November','December'],
+        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+        'Jul','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
+		dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
+		dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
+		weekHeader: 'Uge',
+        dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['da']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-de.js

@@ -0,0 +1,23 @@
+/* German initialisation for the jQuery UI date picker plugin. */
+/* Written by Milian Wolff (mail@milianw.de). */
+jQuery(function($){
+	$.datepicker.regional['de'] = {
+		closeText: 'schließen',
+		prevText: '&#x3c;zurück',
+		nextText: 'Vor&#x3e;',
+		currentText: 'heute',
+		monthNames: ['Januar','Februar','März','April','Mai','Juni',
+		'Juli','August','September','Oktober','November','Dezember'],
+		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Dez'],
+		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
+		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+		weekHeader: 'KW',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['de']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-el.js

@@ -0,0 +1,23 @@
+/* Greek (el) initialisation for the jQuery UI date picker plugin. */
+/* Written by Alex Cicovic (http://www.alexcicovic.com) */
+jQuery(function($){
+	$.datepicker.regional['el'] = {
+		closeText: 'Κλείσιμο',
+		prevText: 'Προηγούμενος',
+		nextText: 'Επόμενος',
+		currentText: 'Τρέχων Μήνας',
+		monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
+		'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
+		monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
+		'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
+		dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
+		dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
+		dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
+		weekHeader: 'Εβδ',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['el']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-AU.js

@@ -0,0 +1,23 @@
+/* English/Australia initialisation for the jQuery UI date picker plugin. */
+/* Based on the en-GB initialisation. */
+jQuery(function($){
+	$.datepicker.regional['en-AU'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-AU']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js

@@ -0,0 +1,23 @@
+/* English/UK initialisation for the jQuery UI date picker plugin. */
+/* Written by Stuart. */
+jQuery(function($){
+	$.datepicker.regional['en-GB'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-GB']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-en-NZ.js

@@ -0,0 +1,23 @@
+/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
+/* Based on the en-GB initialisation. */
+jQuery(function($){
+	$.datepicker.regional['en-NZ'] = {
+		closeText: 'Done',
+		prevText: 'Prev',
+		nextText: 'Next',
+		currentText: 'Today',
+		monthNames: ['January','February','March','April','May','June',
+		'July','August','September','October','November','December'],
+		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['en-NZ']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-eo.js

@@ -0,0 +1,23 @@
+/* Esperanto initialisation for the jQuery UI date picker plugin. */
+/* Written by Olivier M. (olivierweb@ifrance.com). */
+jQuery(function($){
+	$.datepicker.regional['eo'] = {
+		closeText: 'Fermi',
+		prevText: '&lt;Anta',
+		nextText: 'Sekv&gt;',
+		currentText: 'Nuna',
+		monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
+		'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+		'Jul','Aŭg','Sep','Okt','Nov','Dec'],
+		dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
+		dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
+		dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
+		weekHeader: 'Sb',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['eo']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-es.js

@@ -0,0 +1,23 @@
+/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
+/* Traducido por Vester (xvester@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['es'] = {
+		closeText: 'Cerrar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Sig&#x3e;',
+		currentText: 'Hoy',
+		monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
+		'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
+		monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
+		'Jul','Ago','Sep','Oct','Nov','Dic'],
+		dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
+		dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
+		dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['es']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-et.js

@@ -0,0 +1,23 @@
+/* Estonian initialisation for the jQuery UI date picker plugin. */
+/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
+jQuery(function($){
+	$.datepicker.regional['et'] = {
+		closeText: 'Sulge',
+		prevText: 'Eelnev',
+		nextText: 'Järgnev',
+		currentText: 'Täna',
+		monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
+		'Juuli','August','September','Oktoober','November','Detsember'],
+		monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
+		'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
+		dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
+		dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
+		dayNamesMin: ['P','E','T','K','N','R','L'],
+		weekHeader: 'näd',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['et']);
+}); 

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-eu.js

@@ -0,0 +1,23 @@
+/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
+/* Karrikas-ek itzulia (karrikas@karrikas.com) */
+jQuery(function($){
+	$.datepicker.regional['eu'] = {
+		closeText: 'Egina',
+		prevText: '&#x3c;Aur',
+		nextText: 'Hur&#x3e;',
+		currentText: 'Gaur',
+		monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
+			'uztaila','abuztua','iraila','urria','azaroa','abendua'],
+		monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
+			'uzt.','abu.','ira.','urr.','aza.','abe.'],
+		dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
+		dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
+		dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
+		weekHeader: 'As',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['eu']);
+});

+ 59 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fa.js

@@ -0,0 +1,59 @@
+/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
+/* Javad Mowlanezhad -- jmowla@gmail.com */
+/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
+jQuery(function($) {
+	$.datepicker.regional['fa'] = {
+		closeText: 'بستن',
+		prevText: '&#x3C;قبلی',
+		nextText: 'بعدی&#x3E;',
+		currentText: 'امروز',
+		monthNames: [
+			'فروردين',
+			'ارديبهشت',
+			'خرداد',
+			'تير',
+			'مرداد',
+			'شهريور',
+			'مهر',
+			'آبان',
+			'آذر',
+			'دی',
+			'بهمن',
+			'اسفند'
+		],
+		monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
+		dayNames: [
+			'يکشنبه',
+			'دوشنبه',
+			'سه‌شنبه',
+			'چهارشنبه',
+			'پنجشنبه',
+			'جمعه',
+			'شنبه'
+		],
+		dayNamesShort: [
+			'ی',
+			'د',
+			'س',
+			'چ',
+			'پ',
+			'ج', 
+			'ش'
+		],
+		dayNamesMin: [
+			'ی',
+			'د',
+			'س',
+			'چ',
+			'پ',
+			'ج', 
+			'ش'
+		],
+		weekHeader: 'هف',
+		dateFormat: 'yy/mm/dd',
+		firstDay: 6,
+		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fa']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fi.js

@@ -0,0 +1,23 @@
+/* Finnish initialisation for the jQuery UI date picker plugin. */
+/* Written by Harri Kilpiö (harrikilpio@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['fi'] = {
+		closeText: 'Sulje',
+		prevText: '&#xAB;Edellinen',
+		nextText: 'Seuraava&#xBB;',
+		currentText: 'T&#xE4;n&#xE4;&#xE4;n',
+		monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&#xE4;kuu',
+		'Hein&#xE4;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
+		monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&#xE4;',
+		'Hein&#xE4;','Elo','Syys','Loka','Marras','Joulu'],
+		dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
+		dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
+		dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
+		weekHeader: 'Vk',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fi']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fo.js

@@ -0,0 +1,23 @@
+/* Faroese initialisation for the jQuery UI date picker plugin */
+/* Written by Sverri Mohr Olsen, sverrimo@gmail.com */
+jQuery(function($){
+	$.datepicker.regional['fo'] = {
+		closeText: 'Lat aftur',
+		prevText: '&#x3c;Fyrra',
+		nextText: 'Næsta&#x3e;',
+		currentText: 'Í dag',
+		monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
+		'Juli','August','September','Oktober','November','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+		'Jul','Aug','Sep','Okt','Nov','Des'],
+		dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
+		dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
+		dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
+		weekHeader: 'Vk',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fo']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fr-CH.js

@@ -0,0 +1,23 @@
+/* Swiss-French initialisation for the jQuery UI date picker plugin. */
+/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
+jQuery(function($){
+	$.datepicker.regional['fr-CH'] = {
+		closeText: 'Fermer',
+		prevText: '&#x3c;Préc',
+		nextText: 'Suiv&#x3e;',
+		currentText: 'Courant',
+		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
+		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
+		'Jul','Aoû','Sep','Oct','Nov','Déc'],
+		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
+		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fr-CH']);
+});

+ 25 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-fr.js

@@ -0,0 +1,25 @@
+/* French initialisation for the jQuery UI date picker plugin. */
+/* Written by Keith Wood (kbwood{at}iinet.com.au),
+              Stéphane Nahmani (sholby@sholby.net),
+              Stéphane Raimbault <stephane.raimbault@gmail.com> */
+jQuery(function($){
+	$.datepicker.regional['fr'] = {
+		closeText: 'Fermer',
+		prevText: 'Précédent',
+		nextText: 'Suivant',
+		currentText: 'Aujourd\'hui',
+		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
+		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+		monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin',
+		'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
+		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+		dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
+		dayNamesMin: ['D','L','M','M','J','V','S'],
+		weekHeader: 'Sem.',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['fr']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-gl.js

@@ -0,0 +1,23 @@
+/* Galician localization for 'UI date picker' jQuery extension. */
+/* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */
+jQuery(function($){
+	$.datepicker.regional['gl'] = {
+		closeText: 'Pechar',
+		prevText: '&#x3c;Ant',
+		nextText: 'Seg&#x3e;',
+		currentText: 'Hoxe',
+		monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
+		'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
+		monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
+		'Xul','Ago','Set','Out','Nov','Dec'],
+		dayNames: ['Domingo','Luns','Martes','M&eacute;rcores','Xoves','Venres','S&aacute;bado'],
+		dayNamesShort: ['Dom','Lun','Mar','M&eacute;r','Xov','Ven','S&aacute;b'],
+		dayNamesMin: ['Do','Lu','Ma','M&eacute;','Xo','Ve','S&aacute;'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['gl']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-he.js

@@ -0,0 +1,23 @@
+/* Hebrew initialisation for the UI Datepicker extension. */
+/* Written by Amir Hardon (ahardon at gmail dot com). */
+jQuery(function($){
+	$.datepicker.regional['he'] = {
+		closeText: 'סגור',
+		prevText: '&#x3c;הקודם',
+		nextText: 'הבא&#x3e;',
+		currentText: 'היום',
+		monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
+		'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
+		monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
+		'יולי','אוג','ספט','אוק','נוב','דצמ'],
+		dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
+		dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+		dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
+		weekHeader: 'Wk',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: true,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['he']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hi.js

@@ -0,0 +1,23 @@
+/* Hindi initialisation for the jQuery UI date picker plugin. */
+/* Written by Michael Dawart. */
+jQuery(function($){
+	$.datepicker.regional['hi'] = {
+		closeText: 'बंद',
+		prevText: 'पिछला',
+		nextText: 'अगला',
+		currentText: 'आज',
+		monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
+		'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
+		monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
+		'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
+		dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
+		dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+		dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+		weekHeader: 'हफ्ता',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hi']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hr.js

@@ -0,0 +1,23 @@
+/* Croatian i18n for the jQuery UI date picker plugin. */
+/* Written by Vjekoslav Nesek. */
+jQuery(function($){
+	$.datepicker.regional['hr'] = {
+		closeText: 'Zatvori',
+		prevText: '&#x3c;',
+		nextText: '&#x3e;',
+		currentText: 'Danas',
+		monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
+		'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
+		monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
+		'Srp','Kol','Ruj','Lis','Stu','Pro'],
+		dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
+		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
+		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+		weekHeader: 'Tje',
+		dateFormat: 'dd.mm.yy.',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hr']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hu.js

@@ -0,0 +1,23 @@
+/* Hungarian initialisation for the jQuery UI date picker plugin. */
+/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */
+jQuery(function($){
+	$.datepicker.regional['hu'] = {
+		closeText: 'bezár',
+		prevText: 'vissza',
+		nextText: 'előre',
+		currentText: 'ma',
+		monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
+		'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
+		monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
+		'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
+		dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
+		dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
+		dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+		weekHeader: 'Hét',
+		dateFormat: 'yy.mm.dd.',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hu']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-hy.js

@@ -0,0 +1,23 @@
+/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
+jQuery(function($){
+	$.datepicker.regional['hy'] = {
+		closeText: 'Փակել',
+		prevText: '&#x3c;Նախ.',
+		nextText: 'Հաջ.&#x3e;',
+		currentText: 'Այսօր',
+		monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
+		'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
+		monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
+		'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
+		dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
+		dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
+		dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
+		weekHeader: 'ՇԲՏ',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['hy']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-id.js

@@ -0,0 +1,23 @@
+/* Indonesian initialisation for the jQuery UI date picker plugin. */
+/* Written by Deden Fathurahman (dedenf@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['id'] = {
+		closeText: 'Tutup',
+		prevText: '&#x3c;mundur',
+		nextText: 'maju&#x3e;',
+		currentText: 'hari ini',
+		monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
+		'Juli','Agustus','September','Oktober','Nopember','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
+		'Jul','Agus','Sep','Okt','Nop','Des'],
+		dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
+		dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
+		dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
+		weekHeader: 'Mg',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['id']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-is.js

@@ -0,0 +1,23 @@
+/* Icelandic initialisation for the jQuery UI date picker plugin. */
+/* Written by Haukur H. Thorsson (haukur@eskill.is). */
+jQuery(function($){
+	$.datepicker.regional['is'] = {
+		closeText: 'Loka',
+		prevText: '&#x3c; Fyrri',
+		nextText: 'N&aelig;sti &#x3e;',
+		currentText: '&Iacute; dag',
+		monthNames: ['Jan&uacute;ar','Febr&uacute;ar','Mars','Apr&iacute;l','Ma&iacute','J&uacute;n&iacute;',
+		'J&uacute;l&iacute;','&Aacute;g&uacute;st','September','Okt&oacute;ber','N&oacute;vember','Desember'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Ma&iacute;','J&uacute;n',
+		'J&uacute;l','&Aacute;g&uacute;','Sep','Okt','N&oacute;v','Des'],
+		dayNames: ['Sunnudagur','M&aacute;nudagur','&THORN;ri&eth;judagur','Mi&eth;vikudagur','Fimmtudagur','F&ouml;studagur','Laugardagur'],
+		dayNamesShort: ['Sun','M&aacute;n','&THORN;ri','Mi&eth;','Fim','F&ouml;s','Lau'],
+		dayNamesMin: ['Su','M&aacute;','&THORN;r','Mi','Fi','F&ouml;','La'],
+		weekHeader: 'Vika',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['is']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-it.js

@@ -0,0 +1,23 @@
+/* Italian initialisation for the jQuery UI date picker plugin. */
+/* Written by Antonello Pasella (antonello.pasella@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['it'] = {
+		closeText: 'Chiudi',
+		prevText: '&#x3c;Prec',
+		nextText: 'Succ&#x3e;',
+		currentText: 'Oggi',
+		monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
+			'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
+		monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
+			'Lug','Ago','Set','Ott','Nov','Dic'],
+		dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'],
+		dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
+		dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
+		weekHeader: 'Sm',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['it']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ja.js

@@ -0,0 +1,23 @@
+/* Japanese initialisation for the jQuery UI date picker plugin. */
+/* Written by Kentaro SATO (kentaro@ranvis.com). */
+jQuery(function($){
+	$.datepicker.regional['ja'] = {
+		closeText: '閉じる',
+		prevText: '&#x3c;前',
+		nextText: '次&#x3e;',
+		currentText: '今日',
+		monthNames: ['1月','2月','3月','4月','5月','6月',
+		'7月','8月','9月','10月','11月','12月'],
+		monthNamesShort: ['1月','2月','3月','4月','5月','6月',
+		'7月','8月','9月','10月','11月','12月'],
+		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
+		dayNamesShort: ['日','月','火','水','木','金','土'],
+		dayNamesMin: ['日','月','火','水','木','金','土'],
+		weekHeader: '週',
+		dateFormat: 'yy/mm/dd',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '年'};
+	$.datepicker.setDefaults($.datepicker.regional['ja']);
+});

+ 21 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ka.js

@@ -0,0 +1,21 @@
+/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Lado Lomidze (lado.lomidze@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ka'] = {
+		closeText: 'დახურვა',
+		prevText: '&#x3c; წინა',
+		nextText: 'შემდეგი &#x3e;',
+		currentText: 'დღეს',
+		monthNames: ['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი', 'ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'],
+		monthNamesShort: ['იან','თებ','მარ','აპრ','მაი','ივნ', 'ივლ','აგვ','სექ','ოქტ','ნოე','დეკ'],
+		dayNames: ['კვირა','ორშაბათი','სამშაბათი','ოთხშაბათი','ხუთშაბათი','პარასკევი','შაბათი'],
+		dayNamesShort: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
+		dayNamesMin: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
+		weekHeader: 'კვირა',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ka']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-kk.js

@@ -0,0 +1,23 @@
+/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['kk'] = {
+		closeText: 'Жабу',
+		prevText: '&#x3c;Алдыңғы',
+		nextText: 'Келесі&#x3e;',
+		currentText: 'Бүгін',
+		monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
+		'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
+		monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
+		'Шіл','Там','Қыр','Қаз','Қар','Жел'],
+		dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
+		dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
+		dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
+		weekHeader: 'Не',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['kk']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-km.js

@@ -0,0 +1,23 @@
+/* Khmer initialisation for the jQuery calendar extension. */
+/* Written by Chandara Om (chandara.teacher@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['km'] = {
+		closeText: 'ធ្វើ​រួច',
+		prevText: 'មុន',
+		nextText: 'បន្ទាប់',
+		currentText: 'ថ្ងៃ​នេះ',
+		monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+		monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
+		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
+		dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
+		dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+		dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
+		weekHeader: 'សប្ដាហ៍',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['km']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ko.js

@@ -0,0 +1,23 @@
+/* Korean initialisation for the jQuery calendar extension. */
+/* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */
+jQuery(function($){
+	$.datepicker.regional['ko'] = {
+		closeText: '닫기',
+		prevText: '이전달',
+		nextText: '다음달',
+		currentText: '오늘',
+		monthNames: ['1월','2월','3월','4월','5월','6월',
+		'7월','8월','9월','10월','11월','12월'],
+		monthNamesShort: ['1월','2월','3월','4월','5월','6월',
+		'7월','8월','9월','10월','11월','12월'],
+		dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
+		dayNamesShort: ['일','월','화','수','목','금','토'],
+		dayNamesMin: ['일','월','화','수','목','금','토'],
+		weekHeader: 'Wk',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: true,
+		yearSuffix: '년'};
+	$.datepicker.setDefaults($.datepicker.regional['ko']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lb.js

@@ -0,0 +1,23 @@
+/* Luxembourgish initialisation for the jQuery UI date picker plugin. */
+/* Written by Michel Weimerskirch <michel@weimerskirch.net> */
+jQuery(function($){
+	$.datepicker.regional['lb'] = {
+		closeText: 'Fäerdeg',
+		prevText: 'Zréck',
+		nextText: 'Weider',
+		currentText: 'Haut',
+		monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
+		'Juli','August','September','Oktober','November','Dezember'],
+		monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
+		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+		dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
+		dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
+		dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
+		weekHeader: 'W',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lb']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lt.js

@@ -0,0 +1,23 @@
+/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* @author Arturas Paleicikas <arturas@avalon.lt> */
+jQuery(function($){
+	$.datepicker.regional['lt'] = {
+		closeText: 'Uždaryti',
+		prevText: '&#x3c;Atgal',
+		nextText: 'Pirmyn&#x3e;',
+		currentText: 'Šiandien',
+		monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
+		'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
+		monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
+		'Lie','Rugp','Rugs','Spa','Lap','Gru'],
+		dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
+		dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
+		dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'],
+		weekHeader: 'Wk',
+		dateFormat: 'yy-mm-dd',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lt']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-lv.js

@@ -0,0 +1,23 @@
+/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
+jQuery(function($){
+	$.datepicker.regional['lv'] = {
+		closeText: 'Aizvērt',
+		prevText: 'Iepr',
+		nextText: 'Nāka',
+		currentText: 'Šodien',
+		monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
+		'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
+		monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
+		'Jūl','Aug','Sep','Okt','Nov','Dec'],
+		dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
+		dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
+		dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
+		weekHeader: 'Nav',
+		dateFormat: 'dd-mm-yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['lv']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-mk.js

@@ -0,0 +1,23 @@
+/* Macedonian i18n for the jQuery UI date picker plugin. */
+/* Written by Stojce Slavkovski. */
+jQuery(function($){
+	$.datepicker.regional['mk'] = {
+		closeText: 'Затвори',
+		prevText: '&#x3C;',
+		nextText: '&#x3E;',
+		currentText: 'Денес',
+		monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
+		'Јули','Август','Септември','Октомври','Ноември','Декември'],
+		monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
+		'Јул','Авг','Сеп','Окт','Ное','Дек'],
+		dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
+		dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
+		dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
+		weekHeader: 'Сед',
+		dateFormat: 'dd.mm.yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['mk']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ml.js

@@ -0,0 +1,23 @@
+/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* Written by Saji Nediyanchath (saji89@gmail.com). */
+jQuery(function($){
+	$.datepicker.regional['ml'] = {
+		closeText: 'ശരി',
+		prevText: 'മുന്നത്തെ',  
+		nextText: 'അടുത്തത് ',
+		currentText: 'ഇന്ന്',
+		monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍',
+		'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'],
+		monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍',
+		'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'],
+		dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
+		dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
+		dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'],
+		weekHeader: 'ആ',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 1,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ml']);
+});

+ 23 - 0
main/inc/lib/javascript/jquery-ui/ui/i18n/jquery.ui.datepicker-ms.js

@@ -0,0 +1,23 @@
+/* Malaysian initialisation for the jQuery UI date picker plugin. */
+/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
+jQuery(function($){
+	$.datepicker.regional['ms'] = {
+		closeText: 'Tutup',
+		prevText: '&#x3c;Sebelum',
+		nextText: 'Selepas&#x3e;',
+		currentText: 'hari ini',
+		monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
+		'Julai','Ogos','September','Oktober','November','Disember'],
+		monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
+		'Jul','Ogo','Sep','Okt','Nov','Dis'],
+		dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
+		dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
+		dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
+		weekHeader: 'Mg',
+		dateFormat: 'dd/mm/yy',
+		firstDay: 0,
+		isRTL: false,
+		showMonthAfterYear: false,
+		yearSuffix: ''};
+	$.datepicker.setDefaults($.datepicker.regional['ms']);
+});

Some files were not shown because too many files changed in this diff