浏览代码

Merge branch '1.10.x' of https://github.com/chamilo/chamilo-lms into BADGE

Conflicts:
	main/css/chamilo/default.css
	main/lang/english/trad4all.inc.php
	main/lang/spanish/trad4all.inc.php
	main/social/home.php
	main/template/default/layout/social_layout.tpl
Angel Fernando Quiroz Campos 10 年之前
父节点
当前提交
28ea2977fe
共有 100 个文件被更改,包括 1777 次插入1673 次删除
  1. 8 0
      .gitignore
  2. 8 3
      archive/.htaccess
  3. 966 106
      composer.lock
  4. 1 0
      documentation/changelog.html
  5. 21 20
      documentation/credits.html
  6. 14 13
      documentation/dependencies.html
  7. 7 6
      documentation/index.html
  8. 17 10
      documentation/installation_guide.html
  9. 7 3
      documentation/installation_guide_es_ES.html
  10. 6 2
      documentation/installation_guide_fr_FR.html
  11. 6 2
      documentation/installation_guide_it_IT.html
  12. 10 9
      documentation/license.html
  13. 1 0
      documentation/migration-checklist.html
  14. 9 5
      documentation/optimization.html
  15. 15 14
      documentation/readme.html
  16. 2 1
      documentation/security.html
  17. 1 1
      main/admin/access_url_edit.php
  18. 1 1
      main/admin/access_urls.php
  19. 1 1
      main/admin/add_courses_to_usergroup.php
  20. 1 1
      main/admin/add_sessions_to_promotion.php
  21. 1 1
      main/admin/add_sessions_to_usergroup.php
  22. 1 1
      main/admin/add_users_to_group.php
  23. 13 2
      main/admin/add_users_to_session.php
  24. 1 1
      main/admin/archive_cleanup.php
  25. 1 2
      main/admin/career_dashboard.php
  26. 3 3
      main/admin/class_add.php
  27. 2 2
      main/admin/class_edit.php
  28. 8 11
      main/admin/configure_extensions.php
  29. 8 6
      main/admin/configure_homepage.php
  30. 5 5
      main/admin/configure_inscription.php
  31. 59 32
      main/admin/configure_plugin.php
  32. 5 7
      main/admin/course_add.php
  33. 3 3
      main/admin/course_category.php
  34. 69 94
      main/admin/course_edit.php
  35. 7 7
      main/admin/course_list.php
  36. 1 1
      main/admin/course_request_accepted.php
  37. 2 2
      main/admin/course_request_edit.php
  38. 1 1
      main/admin/course_request_rejected.php
  39. 1 1
      main/admin/course_request_review.php
  40. 0 390
      main/admin/course_virtual.php
  41. 1 1
      main/admin/dashboard_add_courses_to_user.php
  42. 1 1
      main/admin/dashboard_add_sessions_to_user.php
  43. 1 1
      main/admin/dashboard_add_users_to_user.php
  44. 2 2
      main/admin/group_add.php
  45. 1 1
      main/admin/group_edit.php
  46. 7 8
      main/admin/group_list.php
  47. 0 1
      main/admin/inactive_user_list.php
  48. 23 50
      main/admin/index.php
  49. 5 5
      main/admin/ldap_users_list.php
  50. 1 1
      main/admin/legal_add.php
  51. 6 8
      main/admin/session_add.php
  52. 1 2
      main/admin/session_category_list.php
  53. 8 13
      main/admin/session_edit.php
  54. 1 1
      main/admin/session_list.php
  55. 1 1
      main/admin/settings.lib.php
  56. 1 1
      main/admin/skills_profile.php
  57. 1 1
      main/admin/special_exports.php
  58. 2 2
      main/admin/system_announcements.php
  59. 0 5
      main/admin/teacher_time_report.php
  60. 52 11
      main/admin/user_add.php
  61. 29 29
      main/admin/user_edit.php
  62. 50 27
      main/admin/user_list.php
  63. 27 20
      main/admin/user_move_stats.php
  64. 2 2
      main/admin/usergroups.php
  65. 3 6
      main/announcements/announcements.php
  66. 3 3
      main/attendance/attendance_add.php
  67. 6 5
      main/attendance/attendance_calendar.php
  68. 3 3
      main/attendance/attendance_edit.php
  69. 2 0
      main/attendance/attendance_list.php
  70. 4 2
      main/attendance/attendance_sheet.php
  71. 0 1
      main/attendance/index.php
  72. 5 5
      main/auth/inscription.php
  73. 1 1
      main/auth/lostPassword.php
  74. 3 2
      main/auth/openid/login.php
  75. 8 8
      main/auth/profile.php
  76. 1 1
      main/calendar/agenda.inc.php
  77. 1 1
      main/calendar/agenda_js.php
  78. 1 1
      main/calendar/agenda_list.php
  79. 5 5
      main/calendar/myagenda.inc.php
  80. 1 1
      main/calendar/myagenda.php
  81. 3 3
      main/course_description/add.php
  82. 62 62
      main/course_description/course_description.class.php
  83. 3 3
      main/course_description/course_description_form.class.php
  84. 3 3
      main/course_description/edit.php
  85. 4 3
      main/course_description/listing.php
  86. 3 3
      main/course_description/upload_file_form.class.php
  87. 5 5
      main/course_home/activity.php
  88. 6 6
      main/course_info/infocours.php
  89. 2 2
      main/course_progress/thematic.php
  90. 3 4
      main/course_progress/thematic_advance.php
  91. 4 4
      main/course_progress/thematic_plan.php
  92. 1 1
      main/coursecopy/classes/CourseBuilder.class.php
  93. 14 15
      main/coursecopy/classes/CourseRestorer.class.php
  94. 1 1
      main/coursecopy/classes/DummyCourseCreator.class.php
  95. 1 1
      main/coursecopy/copy_course_session.php
  96. 1 1
      main/coursecopy/copy_course_session_selected.php
  97. 2 2
      main/create_course/add_course.php
  98. 94 0
      main/cron/create_course_sessions.php
  99. 2 2
      main/cron/import_csv.php
  100. 0 543
      main/css/academica/dataTable.css

+ 8 - 0
.gitignore

@@ -17,6 +17,14 @@ home/*
 main/upload/users/*
 !main/upload/users/index.html
 
+# Session images
+main/upload/sessions/*
+!main/upload/sessions/index.html
+
+# Course images
+main/upload/courses/*
+!main/upload/courses/index.html
+
 # Logs and databases #
 *.log
 

+ 8 - 3
archive/.htaccess

@@ -10,7 +10,7 @@
     },
     "autoload": {
         "psr-0": {
-            "": "src/"
+            "Chamilo": "src/"
         },
         "classmap": [
             "main/auth",
@@ -31,7 +31,7 @@
         ]
     },
     "require": {
-        "php": ">=5.3.3",
+        "php": ">=5.4",
         "php-ffmpeg/php-ffmpeg": "~0.6",
         "sabre/vobject": "~3.1",
         "toin0u/digitalocean": "~1.4",
@@ -47,7 +47,12 @@
         "mpdf/mpdf": "5.7.4",
         "barryvdh/elfinder-builds": "2.1.0.3",
         "jbroadway/urlify": "1.0.3-stable",
-        "monolog/monolog": "~1.0"
+        "monolog/monolog": "~1.0",
+        "doctrine/orm": "~2.2,>=2.2.3,<2.5",
+        "symfony/doctrine-bridge": "2.6.4",
+        "symfony/validator": "2.6.4",
+        "gedmo/doctrine-extensions": "~2.3",
+        "sonata-project/user-bundle": "~2.2"
     },
     "extra": {
         "branch-alias": {

文件差异内容过多而无法显示
+ 966 - 106
composer.lock


+ 1 - 0
documentation/changelog.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Chamilo Changelog</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />

+ 21 - 20
documentation/credits.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Chamilo Credits</title>
+  <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -20,11 +21,11 @@
             <ul class="nav">
                 <li><a href="index.html">Home</a></li>
                 <li ><a href="readme.html">About</a></li>
-                <li ><a href="license.html">License</a></li>            
-                <li class="active"><a href="credits.html">Credits</a></li>            
-                <li><a href="dependencies.html">Dependencies</a></li>            
+                <li ><a href="license.html">License</a></li>
+                <li class="active"><a href="credits.html">Credits</a></li>
+                <li><a href="dependencies.html">Dependencies</a></li>
                 <li><a href="changelog.html">Changelog</a></li>
-            </ul>        
+            </ul>
             </div><!--/.nav-collapse -->
         </div>
     </div>
@@ -34,7 +35,7 @@
     <li>
         <a href="index.html">Documentation</a>
         <span class="divider">/</span>
-    </li>    
+    </li>
     <li>Credits</li>
 </ul>
 <h1>Chamilo Credits</h1>
@@ -61,12 +62,12 @@ In the following credits, when possible, we tried to put the latest contributors
 <h2>Chamilo LMS 1.10.*</h2>
 <ul>
   <li>Yannick Warnier (yannick.warnier@beeznest.com) - Technical coordinator, Project Leader - BeezNest, Belgium/Peru</li>
-  <li>Julio Allen Montoya Armas (gugli100@gmail.com) - Lead developer - BeezNest, France</li>
+  <li>Julio Montoya (gugli100@gmail.com) - Lead developer - BeezNest, France</li>
 </ul>
 <h2>Chamilo LMS 1.9.*</h2>
 <ul>
   <li>Yannick Warnier (yannick.warnier@beeznest.com) - Technical coordinator, Project Leader - BeezNest, Belgium/Peru</li>
-  <li>Julio Allen Montoya Armas (gugli100@gmail.com) - Lead developer - BeezNest, France</li>
+  <li>Julio Montoya (gugli100@gmail.com) - Lead developer - BeezNest, France</li>
   <li>Hubert Borderiou - Developer responsible for exercises categories and many other practical fixes - Université de Grenoble, France</li>
   <li>Michela Mosquera - Community manager for the (very large) Latin American community - BeezNest, Peru</li>
   <li>Coursenligne45 - Anonymous reporter and contributor to many bugfixes - Independent, France</li>
@@ -83,7 +84,7 @@ In the following credits, when possible, we tried to put the latest contributors
   <li>BeezNest Latino (2007-2014) (aka Dokeos Latinoamérica from 2007-2009)
   <ul>
       <li>Yannick Warnier (ywarnier@beeznest.org) - Lead developer</li>
-      <li>Julio Allen Montoya Armas (gugli100@gmail.com) - Lead Latino developer</li>
+      <li>Julio Montoya (gugli100@gmail.com) - Lead Latino developer</li>
       <li>Christian Fasanando (christian534@hotmail.com) - 2009-2010</li>
       <li>Yoselyn Castillo (yoselyn.castillo@beeznest.com) - Developer</li>
     </ul>
@@ -260,7 +261,7 @@ Rewritten by
   <li>First version:</li>
   <li>Adapted from PHPBB 1.4 (http://www.phpbb.com)</li>
   <li>Modifications: Patrick Cool (patrick.cool@ugent.be)</li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Management of scoring of threads:</li>
   <li>Christian Fasanando</li>
   <li>Isaac Flores</li>
@@ -294,7 +295,7 @@ Rewritten by
 </ul>
 <h2>Interface and CSS</h2>
 <ul>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Noa Orizales Iglesias (noa@contidosdixitais.com)</li>
   <li>Sandra Matthys</li>
   <li>Wolfgang Schneider (webmaster@bibelcenter.de)</li>
@@ -347,7 +348,7 @@ Rewritten by
   <li>Vargas Palma Rubén (thiefdp@hotmail.com)</li>
   <li>Dokeos 1.8 integration and refactoring:</li>
   <li> Evie Embrechts </li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Isaac Flores</li>
 </ul>
 
@@ -408,7 +409,7 @@ Rewritten by
 <h2>Survey</h2>
 <ul>
   <li>Patrick Cool</li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Yannick Warnier</li>
 </ul>
 
@@ -419,7 +420,7 @@ Rewritten by
   <li> Denes Nagy (hotpotatoes integration)</li>
   <li> Eric Marguin </li>
   <li> Julian Prud'homme</li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
 </ul>
 
 <h2>Wiki</h2>
@@ -432,7 +433,7 @@ Rewritten by
 <h2>Social Network</h2>
 <ul>
   <li>Thanks to Universidad San Ignacio de Loyola, Lima for the sponsoring of this development</li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Isaac Flores</li>
   <li>Christian Fasanando</li>
 </ul>
@@ -440,7 +441,7 @@ Rewritten by
 <h2>Platform group tool</h2>
 <ul>
   <li>Thanks to Universidad San Ignacio de Loyola, Lima for the sponsoring of this development</li>
-  <li>Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Julio Montoya (gugli100@gmail.com)</li>
   <li>Christian Fasanando</li>
 </ul>
 
@@ -460,7 +461,7 @@ Rewritten by
   <li> Elie Harfouche (elie at harfdesign dot com)</li>
   <li> Roan Embrechts (roan.embrechts@vub.ac.be)</li>
   <li> Bart Mollet (bart.mollet@hogent.be)</li>
-  <li> Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li> Julio Montoya (gugli100@gmail.com)</li>
 </ul>
 
 <h2>(un)zip</h2>
@@ -494,7 +495,7 @@ Rewritten by
   <li>Patrick Cool (patrick.cool@UGent.be)</li>
   <li>Eric Marguin</li>
   <li>Yannick Warnier</li>
-  <li>Social network improvements: Julio Montoya Armas (gugli100@gmail.com)</li>
+  <li>Social network improvements: Julio Montoya (gugli100@gmail.com)</li>
 </ul>
 
 <h2>Web services</h2>
@@ -518,7 +519,7 @@ Rewritten by
 <ul>
   <li>First integration: HTMLArea</li>
   <li>Second integration: FCKEditor</li>
-  <li>Update to FCKEditor 2.6.2: Julio Montoya Armas(gugli100@gmail.com)</li>
+  <li>Update to FCKEditor 2.6.2: Julio Montoya (gugli100@gmail.com)</li>
   <li>Update to FCKEditor 2.6.6 and addition of other plugins: Ivan Tcholakov</li>
   <li>ASCIIMathML-based formula rendering and ASCIIsvg-based mathematical graphics:
     <ul>
@@ -589,7 +590,7 @@ There are too much translators to list them all. Please check http://translate.c
 <h1>Our special thanks also go to</h1>
 (in no particular order - bug reporters are only listed when having contributed 4 reports or more)
 
-Note that we are infinitely grateful to our translators, having made the spread of Chamilo to other cultures possible. Sadly, we aren't quite as organized as we would like, and we haven't been able to sort the real translators out from people having just registered on our translation portal. This is on our TO DO list, so please be just a little more patient. We know we can count on you! Thank you. Your efforts mean a lot to us! 
+Note that we are infinitely grateful to our translators, having made the spread of Chamilo to other cultures possible. Sadly, we aren't quite as organized as we would like, and we haven't been able to sort the real translators out from people having just registered on our translation portal. This is on our TO DO list, so please be just a little more patient. We know we can count on you! Thank you. Your efforts mean a lot to us!
 <ul>
   <li> Hubert Borderiou for various bugfixes</li>
   <li> Philippe Béranger</li>
@@ -696,7 +697,7 @@ Note that we are infinitely grateful to our translators, having made the spread
   <li>Guillaume Fosset, Aix-Marseilles Academy, for issues reporting and improvement suggestions in 1.9.*</li>
   <li>Laurent Goossens, for Encora, Antwerp, for issues reporting and improvement suggestions in 1.9.* (most notably on the assignments tool)</li>
   <li>Diego Escalante, Peru, for issues reporting and fixes in 1.9.*</li>
-  <li>All the supporting parents, partners, children, friends, colleagues and sometimes students, of the very special geeks that we are, for their continous support and inspiration</li> 
+  <li>All the supporting parents, partners, children, friends, colleagues and sometimes students, of the very special geeks that we are, for their continous support and inspiration</li>
 </ul>
 
 <a name="organisations"></a>

+ 14 - 13
documentation/dependencies.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Chamilo Server Dependencies</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -20,11 +21,11 @@
             <ul class="nav">
                 <li><a href="index.html">Home</a></li>
                 <li ><a href="readme.html">About</a></li>
-                <li ><a href="license.html">License</a></li>            
-                <li><a href="credits.html">Credits</a></li>            
-                <li class="active"><a href="dependencies.html">Dependencies</a></li>            
+                <li ><a href="license.html">License</a></li>
+                <li><a href="credits.html">Credits</a></li>
+                <li class="active"><a href="dependencies.html">Dependencies</a></li>
                 <li><a href="changelog.html">Changelog</a></li>
-            </ul>        
+            </ul>
             </div><!--/.nav-collapse -->
         </div>
     </div>
@@ -34,24 +35,24 @@
     <li>
         <a href="index.html">Documentation</a>
         <span class="divider">/</span>
-    </li>    
+    </li>
     <li>Dependencies</li>
 </ul>
 <h1>Chamilo - Server Dependencies</h1>
 
 <h2>Introduction</h2>
-<p>In the ever-evoluting web environment, Chamilo has to rely on 
-state-of-the-art third-party software in order to provide you with useful and 
+<p>In the ever-evoluting web environment, Chamilo has to rely on
+state-of-the-art third-party software in order to provide you with useful and
 practical features. Some of this third-party software usually come bundled with
 your operating system, but some don't. This means that if that software is
-not installed on your Chamilo server, along with Chamilo, you might not enjoy 
+not installed on your Chamilo server, along with Chamilo, you might not enjoy
 the best possible experience with your Chamilo platform. To avoid this problem,
 most of the sofware we used is bundled into a typical Chamilo installation.</p>
 <p>
-However, if such a third-party software is too big to be included, or if it 
-doesn't make sense to include it for whatever reason, you must make sure it is 
-installed on your system. This is the goal of this list: to help you keep a 
-track of what software is needed and, as much as possible, where to get the 
+However, if such a third-party software is too big to be included, or if it
+doesn't make sense to include it for whatever reason, you must make sure it is
+installed on your system. This is the goal of this list: to help you keep a
+track of what software is needed and, as much as possible, where to get the
 required information to install it.</p>
 
 <a name="dependencies"></a>
@@ -69,7 +70,7 @@ We recommend using HTML5-compatible technology.
 <h2>Dependencies - server-side</h2>
 <ul>
   <li>Apache 2+</li>
-  <li> PHP 5.3 or higher with MySQL bindings (mysqlnd is recommended) and php-gd extension to allow Chamilo to resize pictures. The 
+  <li> PHP 5.4 or higher with MySQL bindings (mysqlnd is recommended) and php-gd extension to allow Chamilo to resize pictures. The
   <li>MySQL 5.1+ or any version of MariaDB database server</li>
   new components we have included from the Symfony framework highly depend on namespaces, a feature that appeared in PHP 5.3.0</li>
   <li>php5-intl package (for international behaviour support)</li>

+ 7 - 6
documentation/index.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Chamilo</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -20,11 +21,11 @@
                 <ul class="nav">
                     <li class="active"><a href="index.html">Home</a></li>
                     <li><a href="readme.html">About</a></li>
-                    <li><a href="license.html">License</a></li>            
-                    <li><a href="credits.html">Credits</a></li>            
-                    <li><a href="dependencies.html">Dependencies</a></li>            
+                    <li><a href="license.html">License</a></li>
+                    <li><a href="credits.html">Credits</a></li>
+                    <li><a href="dependencies.html">Dependencies</a></li>
                     <li><a href="changelog.html">Changelog</a></li>
-                </ul>        
+                </ul>
                 </div><!--/.nav-collapse -->
             </div>
         </div>
@@ -46,13 +47,13 @@
 
             <p> Are you interested in translating the installation guide to your own language? The best way to proceed is to ask us on the <a href="http://forum.chamilo.org">Chamilo forum</a>
         for the latest version – there may be updates to the guide since
-        this version was released – and send new translations off to the <a href="mailto:translation@chamilo.com">translation@chamilo.com</a> email address. 
+        this version was released – and send new translations off to the <a href="mailto:translation@chamilo.com">translation@chamilo.com</a> email address.
             </p>
 
         </div>
         </div>
 </div>
-    
+
 <hr />
     <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
 	<a href="http://jigsaw.w3.org/css-validator/">

+ 17 - 10
documentation/installation_guide.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Chamilo Installation Guide</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -77,9 +78,12 @@ optimal flexibility, remote control and scalability. <br />
 
 <br />
 
-Chamilo is mainly a LMS running <span style="font-weight: bold;">Apache (2.2 recommended)</span>, <span style="font-weight: bold;">MySQL 5.1 or 5.5 (or MariaDB)</span> and <span style="font-weight: bold;">PHP 5.3, 5.4 or 5.5 (5.5 recommended for greater efficiency)</span> (the so called <span style="font-weight: bold;">AMP</span> trilogy). <br />
-
-
+Chamilo is mainly a LMS running (the so called <span style="font-weight: bold;">AMP</span> trilogy): <br />
+<ul>
+<li><span style="font-weight: bold;">Apache (2.2 recommended)</span></li>
+<li><span style="font-weight: bold;">MySQL 5.1 or 5.5 (or MariaDB)</span></li>
+<li><span style="font-weight: bold;">PHP 5.4, 5.5 or 5.6 (5.6 recommended for greater efficiency)</span></li>
+</ul>
 <br />
 
 All these pieces of software are free software and freely available. <br />
@@ -144,10 +148,13 @@ The following directories need to be readable, writeable and executable by your
 <ul>
   <li>[chamilo]/main/inc/conf/</li>
   <li>[chamilo]/main/upload/users/</li>
+  <li>[chamilo]/main/upload/sessions/</li>
+  <li>[chamilo]/main/upload/courses/</li>
   <li>[chamilo]/main/default_course_document/images/</li>
   <li>[chamilo]/archive/</li>
   <li>[chamilo]/courses/</li>
   <li>[chamilo]/home/</li>
+  <li>[chamilo]/data/</li>
 </ul>
 Optionally, you can do the same to the following directories if you want to
 enable CSS styles package upload and sub-language definition:
@@ -281,7 +288,7 @@ Past Chamilo versions required register_globals to be set to On. This is
 no longer necessary, this can (and should) be set to Off.
 <span class="muted">It is considered a bad choice in terms of security to set register_globals to On.</a></p>
 
-<p><strong>Note:</strong> if you are using PHP 5.3 or higher, you need to set
+<p><strong>Note:</strong> You need to set
 your <em>date.timezone</em> setting to whatever your server's timezone is.
 For example, if your server is in the 'America/New_York' timezone, set this
 in your php.ini:</p>
@@ -325,16 +332,16 @@ previous version of Chamilo LMS (1.*) or Dok€os (&lt;2.0)</h2>
 Before upgrading, we <b>heavily</b> recommend you do a full backup of the previous
 Chamilo or Dok€os directories and databases. If you are unsure how to achieve this
 please ask your hosting provider for advice.<br />
-<em>Chamilo LMS 1.10 comes with a new database structure in comparison to 1.9, and so between 1.9 and 1.8. 
+<em>Chamilo LMS 1.10 comes with a new database structure in comparison to 1.9, and so between 1.9 and 1.8.
 Although the upgrade script takes the migration in charge, it might be generating
-a very heavy load on your server during the upgrade, and will change your 
-database completely, preserving the data as well as possible (we have tested 
-the procedure many times, but remember this is GNU/GPLv3 and we cannot be held 
+a very heavy load on your server during the upgrade, and will change your
+database completely, preserving the data as well as possible (we have tested
+the procedure many times, but remember this is GNU/GPLv3 and we cannot be held
 responsible for what would happen to your data without professional supervision).
-This is why we *really* recommend you take a full backup of your system before 
+This is why we *really* recommend you take a full backup of your system before
 you upgrade.</em>
 <br />
-<div class="muted"> NOTE: For very heavy Chamilo databases, some of our official 
+<div class="muted"> NOTE: For very heavy Chamilo databases, some of our official
 providers have developed improved migration procedures that use more memory but
 process the upgrades up to 20 times faster. If this is the kind of thing you
 need, we highly recommend you contact them (see reference below).</div>

+ 7 - 3
documentation/installation_guide_es_ES.html

@@ -1,7 +1,8 @@
 <html lang="es">
 <head>
     <meta charset="utf-8" />
-	<title>Guia de Instalación de Chamilo 1.9</title>
+	<title>Guia de Instalación de Chamilo 1.10</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
 </head>
@@ -83,7 +84,7 @@
 Chamilo puede ser instalado indiferentemente en servidores Windows, Linux, Mac OS X y UNIX. Sin embargo, nosotros recomendamos el uso de un servidor Linux para una óptima flexibilidad, control remoto y escalabilidad.
 </p>
 <p>
-Chamilo es fundamentalmente un LMS que se ejecuta con Apache (1.3, 2.0 o 2.2), MySQL 5.1 (o MariaDB) y PHP 5.3 (o 5.4) (trilogía también llamada AMP).
+Chamilo es fundamentalmente un LMS que se ejecuta con Apache (1.3, 2.0 o 2.2), MySQL 5.1 (o MariaDB) y PHP 5.4 (trilogía también llamada AMP).
 </p>
 <p>
 Todo este software es software de código abierto y está disponible libremente.
@@ -132,10 +133,13 @@ Remplace [chamilo] por el directorio en el cual está ubicado su Chamilo:
 <ul>
   <li>[chamilo]/main/inc/conf/</li>
   <li>[chamilo]/main/upload/users/</li>
+  <li>[chamilo]/main/upload/sessions/</li>
+  <li>[chamilo]/main/upload/courses/</li>
   <li>[chamilo]/main/default_course_document/images/</li>
   <li>[chamilo]/archive/</li>
   <li>[chamilo]/courses/</li>
   <li>[chamilo]/home/</li>
+  <li>[chamilo]/data/</li>
 </ul>
 Opcionalmente, puede hacer lo mismo a los directorios siguientes si desea
 activar la subida de paquetes de estilos CSS y la definición de sub-idiomas:
@@ -240,7 +244,7 @@ En versiones de Chamilo/Dok€os anteriores se requería que register_globals es
 necesario, puede (y debería) estar configurado en Off y Chamilo funcionará bien.<span>Se considera una mala elección en términos de seguridad configurar register_globals a On.</span>
 </p>
 
-<p><strong>Nota:</strong> si se usa PHP 5.3 o superior, se necesita configurar la variable <em>date.timezone</em> a la zona horaria de su servidor.
+<p><strong>Nota:</strong> Se necesita configurar la variable <em>date.timezone</em> a la zona horaria de su servidor.
 Por ejemplo, si su servidor está en la zona horaria 'America/Lima', modificar en el php.ini:</p>
 
 <div class="code">

+ 6 - 2
documentation/installation_guide_fr_FR.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
     <title>Guide d'installation de Chamilo</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -81,7 +82,7 @@ distribution Debian (ou sa petite soeur Ubuntu)<br />
 Chamilo est un système de gestion de l'apprentissage (LMS) qui fonctionne
 principallement sur base d'un <span style="font-weight: bold;">serveur web (Apache 2.2
 recommandé)</span>, de <span style="font-weight: bold;">MySQL (5.1 ou 5.5) ou de MariaDB
-(5 ou 10)</span> et de <span style="font-weight: bold;">PHP 5.3, 5.4 ou 5.5 (5.5 recommandé
+(5 ou 10)</span> et de <span style="font-weight: bold;">PHP 5.4, 5.5 ou 5.6 (5.6 recommandé
 pour une plus grande efficacité)</span> (la trilogie aussi appelée
 <span style="font-weight: bold;">AMP</span>). <br />
 
@@ -176,10 +177,13 @@ Remplacez [chamilo] par le répertoire où vous avez placé le contenu du zip:
 <ul>
   <li>[chamilo]/main/inc/conf/</li>
   <li>[chamilo]/main/upload/users/</li>
+  <li>[chamilo]/main/upload/sessions/</li>
+  <li>[chamilo]/main/upload/courses/</li>
   <li>[chamilo]/main/default_course_document/images/</li>
   <li>[chamilo]/archive/</li>
   <li>[chamilo]/courses/</li>
   <li>[chamilo]/home/</li>
+  <li>[chamilo]/data/</li>
 </ul>
 Optionnellement, vous pouvez faire la même chose pour les répertoires suivants
 si vous souhaitez permettre l'envoi de styles CSS ou la définition de nouvelles
@@ -325,7 +329,7 @@ devrait désormais être configuré à Off (bien que les dernières versions de
 ne proposent même plus ce paramètre de configuration et le mettent d'office à Off).
 <span class="muted">L'activation du register_globals est désormais largement considérée comme un mauvais choix au niveau sécurité.</span></p>
 
-<p><strong>Note:</strong> si vous utilisez PHP 5.3 ou supérieur, vous
+<p><strong>Note:</strong> Vous
 <em>devez</em> configurer le paramètre <em>date.timezone</em> à la zone horaire
 de votre serveur. Par exemple, si votre serveur est dans la zone horaire
 'America/New_York', configurez-le de la manière suivante dans votre php.ini:</p>

+ 6 - 2
documentation/installation_guide_it_IT.html

@@ -2,6 +2,7 @@
 <head>
   <meta charset="utf-8" />
   <title>Guida di installazione di Chamilo LMS</title>
+  <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
   <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
   <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
   <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -72,7 +73,7 @@
 <p class="p8"><span class="s1"></span><br></p>
 <p class="p2"><span class="s1"><b>Chamilo</b> può essere installato indifferentemente su server Windows, Linux, Mac OS X e Unix. Tuttavia raccomandiamo l’utilizzo di server Linux per sfruttarne al meglio le caratteristiche di flessibilità, controllo remoto e scalabilità.</span></p>
 <p class="p3"><span class="s1"></span><br></p>
-<p class="p2"><span class="s1"><b>Chamilo</b> è principalmente un <b>LMS (Learning Management System)</b> che gira sulla piattaforma composta da <b>Apache (1.3,2.0 or 2.2)</b>, <b>MySQL 5.1 (o MariaDB</b>) e <b>PHP 5.3 (o 5.4)</b>, meglio nota come piattaforma <b>AMP</b>.</span></p>
+<p class="p2"><span class="s1"><b>Chamilo</b> è principalmente un <b>LMS (Learning Management System)</b> che gira sulla piattaforma composta da <b>Apache (1.3,2.0 or 2.2)</b>, <b>MySQL 5.1 (o MariaDB</b>) e <b>PHP 5.4, 5.5 o 5.6</b>, meglio nota come piattaforma <b>AMP</b>.</span></p>
 <p class="p3"><span class="s1"></span><br></p>
 <p class="p2"><span class="s1">Tutti questi software sono gratuiti e liberamente scaricabili.</span></p>
 <p class="p3"><span class="s1"></span><br></p>
@@ -108,10 +109,13 @@
 <ul>
   <li class="li2"><span class="s1">[chamilo]/main/inc/conf/</span></li>
   <li class="li2"><span class="s1">[chamilo]/main/upload/users/</span></li>
+  <li clasS="li2">[chamilo]/main/upload/sessions/</li>
+  <li class="li2">[chamilo]/main/upload/courses/</li>
   <li class="li2"><span class="s1">[chamilo]/main/default_course_document/images/</span></li>
   <li class="li2"><span class="s1">[chamilo]/archive/</span></li>
   <li class="li2"><span class="s1">[chamilo]/courses/</span></li>
   <li class="li2"><span class="s1">[chamilo]/home/</span></li>
+  <li class="li2"><span class="s1">[chamilo]/data/</span></li>
 </ul>
 <p class="p3"><span class="s1"></span><br></p>
 <p class="p2"><span class="s1">Opzionalmente puoi fare lo stesso alle seguenti cartelle se vuoi consentire il caricamento dei pacchetti di stile CSS (CSS styles package) e la definizione di sotto-linguaggi (sub-language definition):</span></p>
@@ -175,7 +179,7 @@
 </ul>
 <p class="p3"><span class="s1"></span><br></p>
 <p class="p1"><span class="s1">Le versioni precedenti di Chamilo richiedevano che la variabile register_globals fosse impostata come “On”. Questo non è più necessario nelle versioni attuali e future di Chamilo, per cui può essere e dovrebbe essere impostata sempre su “Off”. E’ considerata una scelta scorretta impostare register_globals su “On” in termini di sicurezza.</span></p>
-<p class="p1"><span class="s1"><b>Nota:</b> se stai utilizzando PHP 5.3 o superiori, devi impostare il tuo valore di <i>date.timezone</i> rispetto alla timezone del tuo server. Per esempio se il tuo server si trova nella timezone 'America/New_York', imposta il parametro date.timezone in php.ini come segue:</span></p>
+<p class="p1"><span class="s1"><b>Nota:</b> Devi impostare il tuo valore di <i>date.timezone</i> rispetto alla timezone del tuo server. Per esempio se il tuo server si trova nella timezone 'America/New_York', imposta il parametro date.timezone in php.ini come segue:</span></p>
 <p class="p2"><span class="s1">date.timezone = 'America/New_York'</span></p>
 <p class="p3"><span class="s1"></span><br></p>
 <p class="p3"><span class="s1"></span><br></p>

+ 10 - 9
documentation/license.html

@@ -1,7 +1,8 @@
 <html lang="en">
 <head>
-    <meta charset="utf-8" />  
+    <meta charset="utf-8" />
     <title>Chamilo License</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
     <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -20,22 +21,22 @@
             <ul class="nav">
                 <li><a href="index.html">Home</a></li>
                 <li ><a href="readme.html">About</a></li>
-                <li class="active"><a href="license.html">License</a></li>            
-                <li><a href="credits.html">Credits</a></li>            
-                <li><a href="dependencies.html">Dependencies</a></li>            
+                <li class="active"><a href="license.html">License</a></li>
+                <li><a href="credits.html">Credits</a></li>
+                <li><a href="dependencies.html">Dependencies</a></li>
                 <li><a href="changelog.html">Changelog</a></li>
-            </ul>        
+            </ul>
             </div><!--/.nav-collapse -->
         </div>
     </div>
 </div>
-<div class="container">    
+<div class="container">
 
 <ul class="breadcrumb">
     <li>
         <a href="index.html">Documentation</a>
         <span class="divider">/</span>
-    </li>    
+    </li>
     <li>Gnu General Public License</li>
 </ul><h1>Chamilo License</h1>
 
@@ -118,7 +119,7 @@ modification follow.</p>
 
 <p>&ldquo;Copyright&rdquo; also means copyright-like laws that apply to other kinds of
 works, such as semiconductor masks.</p>
- 
+
 <p>&ldquo;The Program&rdquo; refers to any copyrightable work licensed under this
 License.  Each licensee is addressed as &ldquo;you&rdquo;.  &ldquo;Licensees&rdquo; and
 
@@ -559,7 +560,7 @@ covered work in a country, or your recipient's use of the covered work
 in a country, would infringe one or more identifiable patents in that
 country that you have reason to believe are valid.</p>
 
-  
+
 <p>If, pursuant to or in connection with a single transaction or
 arrangement, you convey, or propagate by procuring conveyance of, a
 covered work, and grant a patent license to some of the parties

+ 1 - 0
documentation/migration-checklist.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
 	<title>Chamilo Migration Checklist</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
 	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />

+ 9 - 5
documentation/optimization.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
 	<title>Chamilo Optimization Guide</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
 	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -20,11 +21,11 @@
                 <ul class="nav">
                     <li><a href="index.html">Home</a></li>
                     <li><a href="readme.html">About</a></li>
-                    <li><a href="license.html">License</a></li>            
-                    <li><a href="credits.html">Credits</a></li>            
-                    <li><a href="dependencies.html">Dependencies</a></li>            
+                    <li><a href="license.html">License</a></li>
+                    <li><a href="credits.html">Credits</a></li>
+                    <li><a href="dependencies.html">Dependencies</a></li>
                     <li><a href="changelog.html">Changelog</a></li>
-                </ul>        
+                </ul>
                 </div><!--/.nav-collapse -->
             </div>
         </div>
@@ -347,7 +348,7 @@ SetEnvIfNoCase Request_URI \
 
 # Make sure proxies don't deliver the wrong content
 Header append Vary User-Agent env=!dont-vary
-</Location> 
+</Location>
 </pre>
 <hr />
 Don't have time or resources to optimize your Chamilo installation yourself? Hire an <a href="http://www.chamilo.org/en/providers">official Chamilo provider</a> and get it sorted out professionally by specialists.
@@ -375,6 +376,9 @@ or
 $platform_email['SMTP_MAILER']       = 'mail';
 </pre>
 In fact, the complete loading of mail.conf.php can also be avoided if loaded conditionally (with <i>require_once</i>) when sending an e-mail (which is the only case where it is useful).
+<p>
+As an additional node, on very active portals with a lot of courses for each users, the icons that appear next to the courses illustrating changes in the corresponding course might be heavyweighted. You can alter slightly the behaviour by not querying for notifications you don't care about, like dropbox, notebook or chat. Change this in main/inc/lib/display.lib.php, in function show_notification().
+</p>
 <hr />
 <h2><a name="9.xsendfile"></a>Speeding file downloads with mod_xsendfile</h2>
 <p>It might have come to your attention that file downloads through Chamilo might get slow, under default conditions, in particular using Apache 2.</p>

+ 15 - 14
documentation/readme.html

@@ -1,10 +1,11 @@
 <html lang="en">
 <head>
     <meta charset="utf-8" />
-  <title>Chamilo Information</title>
-  <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
-  <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
-  <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />  
+    <title>Chamilo Information</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
+    <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
+    <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
+    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
 </head>
 <body>
 <div class="navbar navbar-fixed-top">
@@ -20,26 +21,26 @@
             <ul class="nav">
                 <li><a href="index.html">Home</a></li>
                 <li class="active"><a href="readme.html">About</a></li>
-                <li><a href="license.html">License</a></li>            
-                <li><a href="credits.html">Credits</a></li>            
-                <li><a href="dependencies.html">Dependencies</a></li>            
+                <li><a href="license.html">License</a></li>
+                <li><a href="credits.html">Credits</a></li>
+                <li><a href="dependencies.html">Dependencies</a></li>
                 <li><a href="changelog.html">Changelog</a></li>
-            </ul>        
+            </ul>
             </div><!--/.nav-collapse -->
         </div>
     </div>
 </div>
- 
+
 <div class="container">
-    
+
 <ul class="breadcrumb">
     <li>
         <a href="index.html">Documentation</a>
         <span class="divider">/</span>
-    </li>    
+    </li>
     <li>About Chamilo</li>
 </ul>
-    
+
 <h1>About Chamilo</h1>
 <p>Chamilo is an e-learning and course management web application, and free software under the GNU/GPLv3+ license. It's translated into more 30 languages,
       SCORM compatible, light and flexible.</p>
@@ -51,7 +52,7 @@
       Administrators provide support to trainers and trainee</p>
 
 
-<p>Technically, Chamilo is a web application written in PHP that stores data in a MySQL database. 
+<p>Technically, Chamilo is a web application written in PHP that stores data in a MySQL database.
     Users access it using a web browser.
     The first stable version of Chamilo, 1.8.6.2 Salto, was based on the Dokeos(TM) 1.8.6.1 code and is meant to be the next software step for institutions currently using Dokeos.
 </p>
@@ -135,6 +136,6 @@ Mail: <a href="mailto:info@chamilo.org">info@chamilo.org</a>
 	<a href="http://jigsaw.w3.org/css-validator/">
 		<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
 	</a>
-    
+
 </body>
 </html>

+ 2 - 1
documentation/security.html

@@ -2,6 +2,7 @@
 <head>
     <meta charset="utf-8" />
 	<title>Chamilo Security Guide</title>
+    <link rel="stylesheet" href="../main/css/bootstrap.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="../main/css/base.css" type="text/css" media="screen,projection" />
     <link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
 	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
@@ -44,7 +45,7 @@ Subscribe to our free security alerts mailing-list: <a href="http://lists.chamil
 <p>To  avoid being a risk to yourself and others, you should download and install a recent browser. We recommend <a href="http://www.getfirefox.com" target="_blank">the latest stable version of Firefox</a>.</p>
 
 <h2><a name="4.Moving-config-file"></a>4. Moving your configuration file out of the web directory</h2>
-<p>It is considered unsafe to leave the configuration file inside the main/inc/conf/ directory, as it will be directly accessible for all users, which could lead crackers to download it, uninterpreted, and read through your configuration, which could lead to illicit 
+<p>It is considered unsafe to leave the configuration file inside the main/inc/conf/ directory, as it will be directly accessible for all users, which could lead crackers to download it, uninterpreted, and read through your configuration, which could lead to illicit
 access to your database if that one isn't well protected and many other stuff we'd prefer to avoid. To secure it, move the configuration file out of your web directory. If your
 Chamilo installation is in /var/www/, move your configuration to /etc/chamilo/configuration.php, for example. Then create a new main/inc/conf/configuration.php file, open it, and write the following:</p>
 <p>

+ 1 - 1
main/admin/access_url_edit.php

@@ -156,7 +156,7 @@ $form->addElement('file','url_image_2','URL Image 2 (PNG)');
 $form->addElement('file','url_image_3','URL Image 3 (PNG)');
 
 // Submit button
-$form->addElement('style_submit_button', 'submit', $submit_name, 'class="add"');
+$form->addButtonCreate($submit_name);
 $form->display();
 
 Display::display_footer();

+ 1 - 1
main/admin/access_urls.php

@@ -107,7 +107,7 @@ echo Display::url(Display::return_icon('user.png',      get_lang('ManageUsers'),
 echo Display::url(Display::return_icon('course.png',    get_lang('ManageCourses'), array(), ICON_SIZE_MEDIUM),   api_get_path(WEB_CODE_PATH).'admin/access_url_edit_courses_to_url.php');
 //echo Display::url(Display::return_icon('session.png',   get_lang('ManageSessions'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH).'admin/access_url_edit_sessions_to_url.php');
 
-$userGroup = new Usergroup();
+$userGroup = new UserGroup();
 if ($userGroup->getUseMultipleUrl()) {
     echo Display::url(
         Display::return_icon('class.png', get_lang('ManageUserGroup'), array(), ICON_SIZE_MEDIUM),

+ 1 - 1
main/admin/add_courses_to_usergroup.php

@@ -148,7 +148,7 @@ $ajax_search = $add_type == 'unique' ? true : false;
 function search($needle,$type)
 {
     global $elements_in;
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
 

+ 1 - 1
main/admin/add_sessions_to_promotion.php

@@ -113,7 +113,7 @@ $ajax_search = $add_type == 'unique' ? true : false;
 function search_sessions($needle, $type)
 {
     global $session_in_promotion;
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
 

+ 1 - 1
main/admin/add_sessions_to_usergroup.php

@@ -125,7 +125,7 @@ $ajax_search = $add_type == 'unique' ? true : false;
 
 function search_sessions($needle,$type) {
     global $tbl_user,$elements_in;
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
 

+ 1 - 1
main/admin/add_users_to_group.php

@@ -47,7 +47,7 @@ $xajax->registerFunction('search_users');
 function search_users($needle, $type, $relation_type)
 {
     global $tbl_user, $tbl_user_rel_access_url, $tbl_group_rel_user, $group_id;
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = $return_origin = $return_destination = '';
     $without_user_id = $without_user_id = $condition_relation = '';
 

+ 13 - 2
main/admin/add_users_to_session.php

@@ -69,7 +69,7 @@ function search_users($needle, $type)
 {
     global $tbl_user, $tbl_session_rel_user, $id_session;
 
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
 
     if (!empty($needle) && !empty($type)) {
@@ -94,8 +94,19 @@ function search_users($needle, $type)
             $order_clause = ' ORDER BY official_code, firstname, lastname, username';
         }
 
+        if (api_is_session_admin()
+            && isset($_configuration['prevent_session_admins_to_manage_all_users'])
+            && $_configuration['prevent_session_admins_to_manage_all_users'] == 'true'
+        ) {
+            $order_clause = " AND user.creator_id = " . api_get_user_id() . $order_clause;
+        }
+
         $cond_user_id = '';
 
+        if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users')  == 'true') {
+            $order_clause = " AND user.creator_id = ".api_get_user_id().$order_clause;
+        }
+
         // Only for single & multiple
         if (in_array($type, array('single','multiple')))
         if (!empty($id_session)) {
@@ -197,7 +208,7 @@ function search_users($needle, $type)
                 }
             }
         }
-        //echo Database::fixQuery($sql);
+
         $rs = Database::query($sql);
         $i = 0;
         if ($type=='single') {

+ 1 - 1
main/admin/archive_cleanup.php

@@ -22,7 +22,7 @@ api_protect_admin_script(true);
 $interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
 
 $form = new FormValidator('archive_cleanup_form');
-$form->addElement('style_submit_button','proceed', get_lang('ArchiveDirCleanupProceedButton'),'class="save"');
+$form->addButton('proceed', get_lang('ArchiveDirCleanupProceedButton'));
 
 $message = null;
 

+ 1 - 2
main/admin/career_dashboard.php

@@ -48,8 +48,7 @@ foreach ($careers as $item) {
 }
 
 $form->addElement('select', 'filter', get_lang('Career'), $career_select_list, array('id'=>'filter_1', 'class'=>'chzn-select'));
-$form->addElement('style_submit_button', 'submit', get_lang('Filter'), 'class="search"');
-
+$form->addButtonSearch(get_lang('Filter'));
 
 // action links
 echo '<div class="actions" style="margin-bottom:20px">';

+ 3 - 3
main/admin/class_add.php

@@ -29,8 +29,8 @@ $interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Class
 $tool_name = get_lang("AddClasses");
 
 $form = new FormValidator('add_class');
-$form->add_textfield('name', get_lang('ClassName'));
-$form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"');
+$form->addText('name', get_lang('ClassName'));
+$form->addButtonCreate(get_lang('Ok'));
 if ($form->validate()) {
     $values = $form->exportValues();
     ClassManager::create_class($values['name']);
@@ -44,4 +44,4 @@ Display :: display_header($tool_name);
 $form->display();
 
 // Displaying the footer.
-Display :: display_footer();
+Display :: display_footer();

+ 2 - 2
main/admin/class_edit.php

@@ -33,8 +33,8 @@ $tool_name = get_lang('ModifyClassInfo');
 $class_id = intval($_GET['idclass']);
 $class = ClassManager :: get_class_info($class_id);
 $form = new FormValidator('edit_class', 'post', 'class_edit.php?idclass='.$class_id);
-$form->add_textfield('name',get_lang('ClassName'));
-$form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"');
+$form->addText('name',get_lang('ClassName'));
+$form->addButtonUpdate(get_lang('Ok'));
 $form->setDefaults(array('name'=>$class['name']));
 if($form->validate())
 {

+ 8 - 11
main/admin/configure_extensions.php

@@ -4,9 +4,7 @@
  * Edition of extensions configuration
  * @package chamilo.admin
  */
-/**
- * Code
- */
+
 // name of the language file that needs to be included
 $language_file='admin';
 $cidReset=true;
@@ -154,17 +152,18 @@ if (isset($_POST['activeExtension'])) {
 $listActiveServices = array();
 
 // get the list of active services
-$sql = 'SELECT variable FROM '.$tbl_settings_current.' WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"';
+$sql = 'SELECT variable FROM '.$tbl_settings_current.'
+		WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"';
 
 $rs = Database::query($sql);
 while($row = Database::fetch_array($rs)){
 	$listActiveServices[] = $row['variable'];
 }
 
-$javascript_service_displayed = '';
-if(isset($_GET['display'])){
+/*$javascript_service_displayed = '';
+if (isset($_GET['display'])) {
 	$javascript_service_displayed = 'document.getElementById("extension_content_'.$_GET['display'].'").style.display = "block"';
-}
+}*/
 
 // javascript to handle accordion behaviour
 $javascript_message = '';
@@ -223,8 +222,6 @@ $nameTool = get_lang('ConfigureExtensions');
 Display::display_header($nameTool);
 
 ?>
-
-
 <div id="message" style="display: none">
 	<?php
 	if(!empty($message))
@@ -299,7 +296,7 @@ Display::display_header($nameTool);
 	</div>
 
  */ ?>
-    
+
 	<!-- PPT2LP -->
 	<div id="main_ppt2lp">
 		<div id="extension_header_ppt2lp" class="accordion_header">
@@ -441,7 +438,7 @@ Display::display_header($nameTool);
 	</div>
 	*/
     /*
-   
+
 	<!-- SEARCH -->
 	<div id="main_search">
 		<div id="extension_header_search" class="accordion_header">

+ 8 - 6
main/admin/configure_homepage.php

@@ -36,9 +36,11 @@ function home_tabs($file_logged_in)
 			$data_logged_in[] = $line;
 		}
 		//tabs file for logged out users
-		$fp = fopen($file_logged_out, 'w');
-		fputs($fp, implode("\n", $data_logged_out));
-		fclose($fp);
+		if (file_exists($file_logged_out)) {
+			$fp = fopen($file_logged_out, 'w');
+			fputs($fp, implode("\n", $data_logged_out));
+			fclose($fp);
+		}
 		//tabs file for logged in users
 		$fp = fopen($file_logged_in, 'w');
 		fputs($fp, implode("\n", $data_logged_in));
@@ -864,12 +866,12 @@ switch ($action) {
 
 		if ($action == 'edit_link' && (empty($link_url) || $link_url == 'http://' || $link_url == 'https://')) {
 			$default['link_html'] = isset($_POST['link_html']) ? $_POST['link_html'] : $link_html;
-			$form->add_html_editor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
+			$form->addHtmlEditor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
 			$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
 		} else {
 			if (in_array($action, array('edit_tabs','insert_tabs'))) {
 				$default['link_html'] = isset($_POST['link_html']) ? $_POST['link_html'] : (!empty($link_html) ? $link_html : '');
-				$form->add_html_editor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
+				$form->addHtmlEditor('link_html', get_lang('Content'), false, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
 			}
 			$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'), array('id' => 'all_langs'));
 			$form->addElement('html','<table id="table_langs" style="margin-left:159px;"><tr>');
@@ -941,7 +943,7 @@ switch ($action) {
 		}
 
 		$default[$name] = str_replace('{rel_path}', api_get_path(REL_PATH), $open);
-		$form->add_html_editor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
+		$form->addHtmlEditor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
 		$form->addElement('checkbox', 'all_langs', null, get_lang('ApplyAllLanguages'),array('id' => 'all_langs'));
 		$form->addElement('html','<table id="table_langs" style="margin-left:5px;"><tr>');
 

+ 5 - 5
main/admin/configure_inscription.php

@@ -243,16 +243,16 @@ if ($display_all_form) {
 
     //	EXTENDED FIELDS
     if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration','mycomptetences') == 'true') {
-        $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration','mydiplomas') == 'true') {
-        $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration','myteach') == 'true') {
-        $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration','mypersonalopenarea') == 'true') {
-        $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true') {
         if (api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true') {
@@ -356,7 +356,7 @@ switch ($action){
         $renderer->setRequiredNoteTemplate('');
         $form->addElement('hidden', 'formSent', '1');
         $default[$name] = str_replace('{rel_path}', api_get_path(REL_PATH), $open);
-        $form->add_html_editor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
+        $form->addHtmlEditor($name, '', true, false, array('ToolbarSet' => 'PortalHomePage', 'Width' => '100%', 'Height' => '400'));
         $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
         $form->setDefaults($default);
         $form->display();

+ 59 - 32
main/admin/configure_plugin.php

@@ -1,44 +1,44 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-	@author Julio Montoya <gugli100@gmail.com> BeezNest 2012
-*	@package chamilo.admin
-*/
+ * @author Julio Montoya <gugli100@gmail.com> BeezNest 2012
+ * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ * @package chamilo.admin
+ */
+use \ChamiloSession as Session;
 
 // name of the language file that needs to be included
-$language_file = array ('registration','admin');
+$language_file = array('registration', 'admin');
 $cidReset = true;
 require_once '../inc/global.inc.php';
 
 // Access restrictions
 api_protect_admin_script();
 
-$plugin_name = $_GET['name'];
+$pluginName = $_GET['name'];
 
-$plugin_obj = new AppPlugin();
-$plugin_info = $plugin_obj->getPluginInfo($plugin_name, true);
+$appPlugin = new AppPlugin();
+$installedPlugins = $appPlugin->get_installed_plugins();
+$pluginInfo = $appPlugin->getPluginInfo($pluginName, true);
 
-if (empty($plugin_info)) {
-    api_not_allowed();
-}
-
-$installed_plugins = $plugin_obj->get_installed_plugins();
-
-if (!in_array($plugin_name, $installed_plugins)) {
-    api_not_allowed();
+if (!in_array($pluginName, $installedPlugins) || empty($pluginInfo)) {
+    api_not_allowed(true);
 }
 
 global $_configuration;
+
 $message = null;
 $content = null;
 
-if (isset($plugin_info['settings_form'])) {
-    $form = $plugin_info['settings_form'];
+$currentUrl = api_get_self() . "?name=$pluginName";
+
+if (isset($pluginInfo['settings_form'])) {
+    $form = $pluginInfo['settings_form'];
     if (isset($form)) {
         //We override the form attributes
-        $attributes = array('action'=>api_get_self().'?name='.$plugin_name, 'method'=>'POST');
+        $attributes = array('action' => $currentUrl, 'method' => 'POST');
         $form->updateAttributes($attributes);
-        $content = Display::page_header($plugin_info['title']);
+        $content = Display::page_header($pluginInfo['title']);
         $content .= $form->toHtml();
     }
 } else {
@@ -49,19 +49,28 @@ 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 <> ?' =>
-                                    array('Plugins', $access_url_id, $plugin_name, 'setting', "status")));
+        //api_delete_category_settings_by_subkey($pluginName);
+        $accessUrlId = api_get_current_access_url_id();
+
+        api_delete_settings_params(
+            array(
+                'category = ? AND access_url = ? AND subkey = ? AND type = ? and variable <> ?' => array(
+                    'Plugins',
+                    $accessUrlId,
+                    $pluginName,
+                    'setting',
+                    "status"
+                )
+            )
+        );
+
         foreach ($values as $key => $value) {
-            $key = Database::escape_string($plugin_name.'_'.$key);
             api_add_setting(
-                $value,
-                $key,
-                $plugin_name,
+                $value, Database::escape_string($pluginName . '_' . $key),
+                $pluginName,
                 'setting',
                 'Plugins',
-                $plugin_name,
+                $pluginName,
                 null,
                 null,
                 null,
@@ -70,17 +79,35 @@ if (isset($form)) {
             );
         }
         if (isset($values['show_main_menu_tab'])) {
-            $objPlugin = $plugin_info['plugin_class']::create();
+            $objPlugin = $pluginInfo['plugin_class']::create();
             $objPlugin->manageTab($values['show_main_menu_tab']);
         }
+
         $message = Display::return_message(get_lang('Updated'), 'success');
+
+        Session::write('message', $message);
+
+        header("Location: $currentUrl");
+        exit;
     }
 }
 
-$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'admin/index.php', 'name' => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins', 'name' => get_lang('Plugins'));
+if (Session::has('message')) {
+    $message = Session::read('message');
+}
+
+$interbreadcrumb[] = array(
+    'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
+    'name' => get_lang('PlatformAdmin')
+);
+$interbreadcrumb[] = array(
+    'url' => api_get_path(WEB_CODE_PATH) . 'admin/settings.php?category=Plugins',
+    'name' => get_lang('Plugins')
+);
 
-$tpl = new Template($plugin_name, true, true, false, true, false);
+$tpl = new Template($pluginName, true, true, false, true, false);
 $tpl->assign('message', $message);
 $tpl->assign('content', $content);
 $tpl->display_one_col_template();
+
+Session::erase('message');

+ 5 - 7
main/admin/course_add.php

@@ -5,8 +5,6 @@
  *	@package chamilo.admin
  */
 
-/* INITIALIZATION SECTION */
-
 // Language files that need to be included.
 $language_file = array('admin', 'create_course');
 
@@ -46,12 +44,12 @@ $form = new FormValidator('update_course');
 $form->addElement('header', $tool_name);
 
 // Title
-$form->add_textfield('title', get_lang('Title'), true, array ('class' => 'span6'));
+$form->addText('title', get_lang('Title'), true, array ('class' => 'span6'));
 $form->applyFilter('title', 'html_filter');
 $form->applyFilter('title', 'trim');
 
 // Code
-$form->add_textfield('visual_code', array(get_lang('CourseCode'), get_lang('OnlyLettersAndNumbers')) , false, array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE));
+$form->addText('visual_code', array(get_lang('CourseCode'), get_lang('OnlyLettersAndNumbers')) , false, array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE));
 
 $form->applyFilter('visual_code', 'api_strtoupper');
 $form->applyFilter('visual_code', 'html_filter');
@@ -75,12 +73,12 @@ $form->addElement(
 );
 
 // Course department
-$form->add_textfield('department_name', get_lang('CourseDepartment'), false, array ('size' => '60'));
+$form->addText('department_name', get_lang('CourseDepartment'), false, array ('size' => '60'));
 $form->applyFilter('department_name', 'html_filter');
 $form->applyFilter('department_name', 'trim');
 
 // Department URL
-$form->add_textfield('department_url', get_lang('CourseDepartmentURL'), false, array ('size' => '60'));
+$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array ('size' => '60'));
 $form->applyFilter('department_url', 'html_filter');
 
 $form->addElement('select_language', 'course_language', get_lang('CourseLanguage'));
@@ -126,7 +124,7 @@ $(function() {
 </script>';
 
 $form->add_progress_bar();
-$form->addElement('style_submit_button', 'submit', get_lang('CreateCourse'), 'class="add"');
+$form->addButtonCreate(get_lang('CreateCourse'));
 
 // Set some default values.
 $values['course_language']  = api_get_setting('platformLanguage');

+ 3 - 3
main/admin/course_category.php

@@ -72,7 +72,7 @@ if ($action == 'add' || $action == 'edit') {
         echo '<div class="actions">';
         echo Display::url(
             Display::return_icon('folder_up.png', get_lang("Back"), '', ICON_SIZE_MEDIUM),
-            api_get_path(WEB_CODE_PATH).'admin/course_category.php?category='.$category
+            api_get_path(WEB_CODE_PATH).'admin/course_category.php?category='.Security::remove_XSS($category)
         );
         echo '</div>';
 
@@ -80,7 +80,7 @@ if ($action == 'add' || $action == 'edit') {
         if (!empty($category)) {
             $form_title .= ' ' . get_lang('Into') . ' ' . Security::remove_XSS($category);
         }
-        $url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.$category;
+        $url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.Security::remove_XSS($category);
         $form = new FormValidator('course_category', 'post', $url);
         $form->addElement('header', '', $form_title);
         $form->addElement('hidden', 'formSent', 1);
@@ -128,7 +128,7 @@ if ($action == 'add' || $action == 'edit') {
     if (empty($parentInfo) || $parentInfo['auth_cat_child'] == 'TRUE') {
         echo Display::url(
             Display::return_icon('new_folder.png', get_lang("AddACategory"), '', ICON_SIZE_MEDIUM),
-            api_get_path(WEB_CODE_PATH).'admin/course_category.php?action=add&category='.$category
+            api_get_path(WEB_CODE_PATH).'admin/course_category.php?action=add&category='.Security::remove_XSS($category)
         );
     }
 

+ 69 - 94
main/admin/course_edit.php

@@ -17,34 +17,40 @@ $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript
 $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
 $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
 
-$course_code = isset($_GET['course_code']) ? $_GET['course_code'] : $_POST['code'];
-$noPHP_SELF = true;
+$courseId = isset($_GET['id']) ? $_GET['id'] : null;
+
+if (empty($courseId)) {
+    api_not_allowed(true);
+}
+
+$courseInfo = api_get_course_info_by_id($courseId);
+
+if (empty($courseInfo)) {
+    api_not_allowed(true);
+}
+
 $tool_name = get_lang('ModifyCourseInfo');
 $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
 $interbreadcrumb[] = array("url" => "course_list.php", "name" => get_lang('CourseList'));
 
 // Get all course categories
 $table_user = Database :: get_main_table(TABLE_MAIN_USER);
-
-//Get the course infos
-$sql = "SELECT * FROM $course_table WHERE code='" . Database::escape_string($course_code) . "'";
-$result = Database::query($sql);
-if (Database::num_rows($result) != 1) {
-    header('Location: course_list.php');
-    exit();
-}
-$course = Database::fetch_array($result, 'ASSOC');
-
-$course_info = api_get_course_info($course_code);
+$course_code = $courseInfo['code'];
 
 // Get course teachers
 $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
 $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
-$sql = "SELECT user.user_id,lastname,firstname FROM $table_user as user,$table_course_user as course_user WHERE course_user.status='1' AND course_user.user_id=user.user_id AND course_user.course_code='" . $course_code . "'" . $order_clause;
+$sql = "SELECT user.user_id,lastname,firstname
+        FROM $table_user as user,$table_course_user as course_user
+        WHERE
+            course_user.status='1' AND
+            course_user.user_id=user.user_id AND
+            course_user.course_code='" . $course_code . "'" .
+        $order_clause;
 $res = Database::query($sql);
 $course_teachers = array();
 while ($obj = Database::fetch_object($res)) {
-    $course_teachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
+    $course_teachers[] = $obj->user_id;
 }
 
 // Get all possible teachers without the course teachers
@@ -54,16 +60,18 @@ if (api_is_multiple_url_enabled()) {
             FROM $table_user as u
             INNER JOIN $access_url_rel_user_table url_rel_user
             ON (u.user_id=url_rel_user.user_id)
-            WHERE url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND status=1" . $order_clause;
+            WHERE
+                url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND
+                status=1" . $order_clause;
 } else {
     $sql = "SELECT user_id, lastname, firstname
             FROM $table_user WHERE status='1'" . $order_clause;
 }
+$courseInfo['tutor_name'] = null;
 
 $res = Database::query($sql);
 $teachers = array();
 $allTeachers = array();
-
 $platform_teachers[0] = '-- ' . get_lang('NoManager') . ' --';
 while ($obj = Database::fetch_object($res)) {
     $allTeachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
@@ -71,8 +79,10 @@ while ($obj = Database::fetch_object($res)) {
         $teachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
     }
 
-    if (isset($course_teachers[$obj->user_id]) && $course['tutor_name'] == $course_teachers[$obj->user_id]) {
-        $course['tutor_name'] = $obj->user_id;
+    if (isset($course_teachers[$obj->user_id]) &&
+        $courseInfo['tutor_name'] == $course_teachers[$obj->user_id]
+    ) {
+        $courseInfo['tutor_name'] = $obj->user_id;
     }
     // We add in the array platform teachers
     $platform_teachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
@@ -83,16 +93,16 @@ if (count($course_teachers) == 0) {
     $sql = 'SELECT tutor_name FROM ' . $course_table . ' WHERE code="' . $course_code . '"';
     $res = Database::query($sql);
     $tutor_name = Database::result($res, 0, 0);
-    $course['tutor_name'] = array_search($tutor_name, $platform_teachers);
+    $courseInfo['tutor_name'] = array_search($tutor_name, $platform_teachers);
 }
 
 // Build the form
-$form = new FormValidator('update_course');
-$form->addElement('header', get_lang('Course') . '  #' . $course_info['real_id'] . ' ' . $course_code);
+$form = new FormValidator('update_course', 'post', api_get_self().'?id='.$courseId);
+$form->addElement('header', get_lang('Course') . '  #' . $courseInfo['real_id'] . ' ' . $course_code);
 $form->addElement('hidden', 'code', $course_code);
 
 //title
-$form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6'));
+$form->addText('title', get_lang('Title'), true, array('class' => 'span6'));
 $form->applyFilter('title', 'html_filter');
 $form->applyFilter('title', 'trim');
 
@@ -101,53 +111,30 @@ $element = $form->addElement('text', 'real_code', array(get_lang('CourseCode'),
 $element->freeze();
 
 // Visual code
-$form->add_textfield('visual_code', array(get_lang('VisualCode'), get_lang('OnlyLettersAndNumbers'), get_lang('ThisValueIsUsedInTheCourseURL')), true, array('class' => 'span4'));
+$form->addText('visual_code', array(get_lang('VisualCode'), get_lang('OnlyLettersAndNumbers'), get_lang('ThisValueIsUsedInTheCourseURL')), true, array('class' => 'span4'));
 
 $form->applyFilter('visual_code', 'strtoupper');
 $form->applyFilter('visual_code', 'html_filter');
 
-$group = array(
-    $form->createElement('select', 'platform_teachers', '', $teachers, ' id="platform_teachers" multiple=multiple size="4" style="width:300px;"'),
-    $form->createElement('select', 'course_teachers', '',   $course_teachers, ' id="course_teachers" multiple=multiple size="4" style="width:300px;"')
-);
-
-$element_template = <<<EOT
-    <div class="control-group">
-        <label>
-            <!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
-        </label>
-        <div class="controls">
-            <table cellpadding="0" cellspacing="0">
-                <tr>
-                    <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error -->	<td>{element}</td>
-                </tr>
-            </table>
-        </div>
-    </div>
-EOT;
-
-$renderer = $form->defaultRenderer();
-$renderer->setElementTemplate($element_template, 'group');
-$form->addGroup($group, 'group', get_lang('CourseTeachers'), '</td><td width="80" align="center">' .
-    '<input class="arrowr" style="width:30px;height:30px;padding-right:12px" type="button" onclick="moveItem(document.getElementById(\'platform_teachers\'), document.getElementById(\'course_teachers\'))"><br><br>'.
-    '<input class="arrowl" style="width:30px;height:30px;padding-left:13px" type="button" onclick="moveItem(document.getElementById(\'course_teachers\'), document.getElementById(\'platform_teachers\'))"></td><td>'
-);
-
-if (array_key_exists('add_teachers_to_sessions_courses', $course)) {
+$form->addElement('advmultiselect', 'course_teachers', get_lang('CourseTeachers'), $allTeachers);
+
+$courseInfo['course_teachers'] = $course_teachers;
+
+if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) {
     $form->addElement('checkbox', 'add_teachers_to_sessions_courses', null, get_lang('TeachersWillBeAddedAsCoachInAllCourseSessions'));
 }
 
-$coursesInSession = SessionManager::get_session_by_course($course['code']);
+$coursesInSession = SessionManager::get_session_by_course($courseInfo['code']);
 if (!empty($coursesInSession)) {
     foreach ($coursesInSession as $session) {
         $sessionId = $session['id'];
-        $coaches = SessionManager::getCoachesByCourseSession($sessionId, $course['code']);
+        $coaches = SessionManager::getCoachesByCourseSession($sessionId, $courseInfo['code']);
         $teachers = $allTeachers;
 
         $sessionTeachers = array();
         foreach ($coaches as $coachId) {
             $userInfo = api_get_user_info($coachId);
-            $sessionTeachers[$coachId] = $userInfo['complete_name'];
+            $sessionTeachers[] = $coachId;
 
             if (isset($teachers[$coachId])) {
                 unset($teachers[$coachId]);
@@ -161,23 +148,17 @@ if (!empty($coursesInSession)) {
         $platformTeacherName = 'platform_teachers_by_session';
         $coachName = 'coaches_by_session';
 
-        $group = array(
-            $form->createElement('select', $platformTeacherName, '', $teachers, ' id="' . $platformTeacherId . '" multiple=multiple size="4" style="width:300px;"'),
-            $form->createElement('select', $coachName, '', $sessionTeachers, ' id="' . $coachId . '" multiple=multiple size="4" style="width:300px;"')
-        );
-
-        $renderer = $form->defaultRenderer();
-        $renderer->setElementTemplate($element_template, $groupName);
         $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=' . $sessionId;
-        $form->addGroup($group, $groupName,
-            Display::url($session['name'], $sessionUrl, array('target' => '_blank')) . ' - ' . get_lang('Coaches'),
-            '</td>
-            <td width="80" align="center">
-                <input class="arrowr" style="width:30px;height:30px;padding-right:12px" type="button" onclick="moveItem(document.getElementById(\'' . $platformTeacherId . '\'), document.getElementById(\'' . $coachId . '\'));">
-                <br><br>
-                <input class="arrowl" style="width:30px;height:30px;padding-left:13px" type="button" onclick="moveItem(document.getElementById(\'' . $coachId . '\'), document.getElementById(\'' . $platformTeacherId . '\'));">
-            </td><td>'
+        $form->addElement(
+            'advmultiselect',
+            $groupName,
+            Display::url(
+                $session['name'], $sessionUrl, array('target' => '_blank')
+            ) . ' - ' . get_lang('Coaches'),
+            $allTeachers
         );
+        $courseInfo[$groupName] = $sessionTeachers;
+
     }
 }
 
@@ -191,12 +172,11 @@ if (!empty($course['category_code'])) {
 
 $form->addElement('select_ajax', 'category_code', get_lang('CourseFaculty'), null, array('url' => $url, 'defaults' => $categoryList));
 
-
-$form->add_textfield('department_name', get_lang('CourseDepartment'), false, array('size' => '60'));
+$form->addText('department_name', get_lang('CourseDepartment'), false, array('size' => '60'));
 $form->applyFilter('department_name', 'html_filter');
 $form->applyFilter('department_name', 'trim');
 
-$form->add_textfield('department_url', get_lang('CourseDepartmentURL'), false, array('size' => '60'));
+$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array('size' => '60'));
 $form->applyFilter('department_url', 'html_filter');
 $form->applyFilter('department_url', 'trim');
 
@@ -252,21 +232,19 @@ $extra = $extra_field->addElements($form, $course_code);
 
 $htmlHeadXtra[] = '
 <script>
-
 $(function() {
     ' . $extra['jquery_ready_content'] . '
 });
 </script>';
 
-$form->addElement('style_submit_button', 'button', get_lang('ModifyCourseInfo'), 'onclick="valide()"; class="save"');
+$form->addButton('submit', get_lang('ModifyCourseInfo'), 'pencil', 'primary');
 
 // Set some default values
-$course['disk_quota'] = round(DocumentManager::get_course_quota($course_code) / 1024 / 1024, 1);
-$course['title'] = api_html_entity_decode($course['title'], ENT_QUOTES, $charset);
-$course['real_code'] = $course['code'];
-$course['add_teachers_to_sessions_courses'] = isset($course['add_teachers_to_sessions_courses']) ? $course['add_teachers_to_sessions_courses'] : 0;
+$courseInfo['disk_quota'] = round(DocumentManager::get_course_quota($courseInfo['code']) / 1024 / 1024, 1);
+$courseInfo['real_code'] = $courseInfo['code'];
+$courseInfo['add_teachers_to_sessions_courses'] = isset($courseInfo['add_teachers_to_sessions_courses']) ? $courseInfo['add_teachers_to_sessions_courses'] : 0;
 
-$form->setDefaults($course);
+$form->setDefaults($courseInfo);
 
 // Validate form
 if ($form->validate()) {
@@ -281,8 +259,8 @@ if ($form->validate()) {
         $_configuration[$urlId]['hosting_limit_active_courses'] > 0
     ) {
         // Check if
-        if ($course_info['visibility'] == COURSE_VISIBILITY_HIDDEN &&
-            $visibility != $course_info['visibility']
+        if ($courseInfo['visibility'] == COURSE_VISIBILITY_HIDDEN &&
+            $visibility != $courseInfo['visibility']
         ) {
             $num = CourseManager::countActiveCourses($urlId);
             if ($num >= $_configuration[$urlId]['hosting_limit_active_courses']) {
@@ -296,7 +274,6 @@ if ($form->validate()) {
         }
     }
 
-    $course_code = $course['code'];
     $visual_code = $course['visual_code'];
     $visual_code = CourseManager::generate_course_code($visual_code);
 
@@ -317,7 +294,7 @@ if ($form->validate()) {
 
     $tutor_id = isset($course['tutor_name']) ? $course['tutor_name'] : null;
     $tutor_name = isset($platform_teachers[$tutor_id]) ? $platform_teachers[$tutor_id] : null;
-    $teachers = $course['group']['course_teachers'];
+    $teachers = $course['course_teachers'];
 
     $title = $course['title'];
     $category_code = $course['category_code'];
@@ -329,7 +306,6 @@ if ($form->validate()) {
     $subscribe = $course['subscribe'];
     $unsubscribe = $course['unsubscribe'];
     $course['course_code'] = $course_code;
-    $courseId = $course['id'];
 
     if (!stristr($department_url, 'http://')) {
         $department_url = 'http://' . $department_url;
@@ -352,7 +328,6 @@ if ($form->validate()) {
     // update the extra fields
     $courseFieldValue = new ExtraFieldValue('course');
     $courseFieldValue->save_field_values($course);
-
     $addTeacherToSessionCourses = isset($course['add_teachers_to_sessions_courses']) && !empty($course['add_teachers_to_sessions_courses']) ? 1 : 0;
 
     // Updating teachers
@@ -368,16 +343,16 @@ if ($form->validate()) {
             }
         }
 
-        CourseManager::updateTeachers($course_code, $teachers, false, true, false);
+        CourseManager::updateTeachers($courseId, $teachers, false, true, false);
     } else {
         // Normal behaviour
-        CourseManager::updateTeachers($course_code, $teachers, true, false);
+        CourseManager::updateTeachers($courseId, $teachers, true, false);
 
         // Updating session coaches
         $sessionCoaches = $course['session_coaches'];
         if (!empty($sessionCoaches)) {
-            foreach ($sessionCoaches as $sessionId => $teacherInfo) {
-                $coachesToSubscribe = isset($teacherInfo['coaches_by_session']) ? $teacherInfo['coaches_by_session'] : null;
+            foreach ($sessionCoaches as $sessionId => $coachesToSubscribe) {
+                //$coachesToSubscribe = isset($teacherInfo['coaches_by_session']) ? $teacherInfo['coaches_by_session'] : null;
                 if (!empty($coachesToSubscribe)) {
                     SessionManager::updateCoaches(
                         $sessionId,
@@ -400,13 +375,13 @@ if ($form->validate()) {
                 user_course_cat='0'";
     Database::query($sql);
 
-    if (array_key_exists('add_teachers_to_sessions_courses', $course_info)) {
+    if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) {
         $sql = "UPDATE $course_table SET add_teachers_to_sessions_courses = '$addTeacherToSessionCourses'
-                WHERE id = " . $course_info['real_id'];
+                WHERE id = " . $courseInfo['real_id'];
         Database::query($sql);
     }
 
-    $course_id = $course_info['real_id'];
+    $course_id = $courseInfo['real_id'];
     /* $forum_config_table = Database::get_course_table(TOOL_FORUM_CONFIG_TABLE);
       $sql = "UPDATE ".$forum_config_table." SET default_lang='".Database::escape_string($course_language)."' WHERE c_id = $course_id "; */
     if ($visual_code_is_used) {
@@ -421,7 +396,7 @@ Display::display_header($tool_name);
 
 echo '<div class="actions">';
 echo Display::url(Display::return_icon('back.png', get_lang('Back')), api_get_path(WEB_CODE_PATH).'admin/course_list.php');
-echo Display::url(Display::return_icon('course_home.png', get_lang('CourseHome')), $course_info['course_public_url'], array('target' => '_blank'));
+echo Display::url(Display::return_icon('course_home.png', get_lang('CourseHome')), $courseInfo['course_public_url'], array('target' => '_blank'));
 echo '</div>';
 
 echo "<script>

+ 7 - 7
main/admin/course_list.php

@@ -219,7 +219,7 @@ function modify_filter($code)
         //'<a href="../course_home/course_home.php?cidReq='.$code.'">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>&nbsp;'. // This is not the preferable way to go to the homepage.
         '<a href="'.api_get_path(WEB_COURSE_PATH).$icourse['path'].'/index.php">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>&nbsp;'.
         '<a href="../tracking/courseLog.php?cidReq='.$code.'">'.Display::return_icon('statistics.gif', get_lang('Tracking')).'</a>&nbsp;'.
-        '<a href="course_edit.php?course_code='.$code.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;'.
+        '<a href="course_edit.php?id='.$icourse['real_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;'.
         '<a href="../coursecopy/backup.php?cidReq='.$code.'">'.Display::return_icon('backup.gif', get_lang('CreateBackup')).'</a>&nbsp;'.
         '<a href="course_list.php?delete_course='.$code.'"  onclick="javascript: if (!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
 }
@@ -278,8 +278,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
     //api_display_tool_title($tool_name);
     $form = new FormValidator('advanced_course_search', 'get');
     $form->addElement('header', $tool_name);
-    $form->add_textfield('keyword_code', get_lang('CourseCode'), false);
-    $form->add_textfield('keyword_title', get_lang('Title'), false);
+    $form->addText('keyword_code', get_lang('CourseCode'), false);
+    $form->addText('keyword_title', get_lang('Title'), false);
 
     // Category code
     $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
@@ -308,7 +308,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
     $form->addElement('radio', 'keyword_unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1);
     $form->addElement('radio', 'keyword_unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0);
     $form->addElement('radio', 'keyword_unsubscribe', null, get_lang('All'), '%');
-    $form->addElement('style_submit_button', 'submit', get_lang('SearchCourse'), 'class="btn"');
+    $form->addButtonSearch(get_lang('SearchCourse'));
     $defaults['keyword_language'] = '%';
     $defaults['keyword_visibility'] = '%';
     $defaults['keyword_subscribe'] = '%';
@@ -340,13 +340,13 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
 
     }
     // Create a search-box
-    $form = new FormValidator('search_simple', 'get', '', '', array('class'=>'form-search'), false);
+    $form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
     $form->addElement('text', 'keyword', null);
-    $form->addElement('style_submit_button', 'submit', get_lang('SearchCourse'), 'class="btn"');
+    $form->addButtonSearch(get_lang('SearchCourse'));
     $form->addElement('static', 'search_advanced_link', null, '<a href="course_list.php?search=advanced">'.get_lang('AdvancedSearch').'</a>');
 
     // Create a filter by session
-    $sessionFilter = new FormValidator('course_filter', 'get', '', '', array('class'=> 'form-search'), false);
+    $sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
     $url = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_session';
     $sessionList = array();
     if (!empty($sessionId)) {

+ 1 - 1
main/admin/course_request_accepted.php

@@ -148,7 +148,7 @@ $form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
 $renderer = $form->defaultRenderer();
 $renderer->setElementTemplate('<span>{element}</span> ');
 $form->addElement('text', 'keyword', get_lang('keyword'));
-$form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
+$form->addButtonSearch(get_lang('Search'));
 
 // The action bar.
 echo '<div style="float: right; margin-top: 5px; margin-right: 5px;">';

+ 2 - 2
main/admin/course_request_edit.php

@@ -72,13 +72,13 @@ if ($course_validation_feature) {
         );
 
         // Course code.
-        $form->add_textfield('wanted_code', get_lang('Code'), false, array('size' => '$maxlength', 'maxlength' => $maxlength));
+        $form->addText('wanted_code', get_lang('Code'), false, array('size' => '$maxlength', 'maxlength' => $maxlength));
         $form->applyFilter('wanted_code', 'html_filter');
         $form->addRule('wanted_code', get_lang('Max'), 'maxlength', $maxlength);
         $form->addRule('wanted_code', get_lang('ThisFieldIsRequired'), 'required');
 
         // The teacher.
-        $titular = $form->add_textfield('tutor_name', get_lang('Professor'), null, array('size' => '60', 'disabled' => 'disabled'));
+        $titular = $form->addText('tutor_name', get_lang('Professor'), null, array('size' => '60', 'disabled' => 'disabled'));
 
         // Description of the requested course.
         $form->addElement('textarea', 'description', get_lang('Description'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116'));

+ 1 - 1
main/admin/course_request_rejected.php

@@ -181,7 +181,7 @@ $form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
 $renderer = $form->defaultRenderer();
 $renderer->setElementTemplate('<span>{element}</span> ');
 $form->addElement('text', 'keyword', get_lang('keyword'));
-$form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
+$form->addButtonSearch(get_lang('Search'));
 
 // The action bar.
 echo '<div style="float: right; margin-top: 5px; margin-right: 5px;">';

+ 1 - 1
main/admin/course_request_review.php

@@ -229,7 +229,7 @@ $form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
 $renderer = $form->defaultRenderer();
 $renderer->setElementTemplate('<span>{element}</span> ');
 $form->addElement('text', 'keyword', get_lang('keyword'));
-$form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
+$form->addButtonSearch(get_lang('Search'));
 
 // The action bar.
 echo '<div style="float: right; margin-top: 5px; margin-right: 5px;">';

+ 0 - 390
main/admin/course_virtual.php

@@ -1,390 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * @author Roan Embrechts - initial admin interface
- * @package chamilo.admin
- * @deprecated
- */
-/**
- * INIT SECTION
- */
-
-// name of the language file that needs to be included
-$language_file = 'admin';
-$extra_lang_file = "create_course";
-
-// global settings initialisation
-// also provides access to main api (inc/lib/main_api.lib.php)
-include("../inc/global.inc.php");
-$this_section=SECTION_PLATFORM_ADMIN;
-
-api_protect_admin_script();
-
-if (isset($extra_lang_file)) include(api_get_path(INCLUDE_PATH)."../lang/english/".$extra_lang_file.".inc.php");
-if (isset($extra_lang_file)) include(api_get_path(INCLUDE_PATH)."../lang/".$language_interface."/".$extra_lang_file.".inc.php");
-
-/*
-	Constants
-*/
-
-define ("CREATE_VIRTUAL_COURSE_OPTION", "create_virtual_course");
-define ("DISPLAY_VIRTUAL_COURSE_LIST_OPTION", "display_virtual_course_list");
-
-define ("FORM_ELEMENT_CODE_SIZE", "20");
-define ("FORM_ELEMENT_TEXT_SIZE", "60");
-define ("SELECT_BOX_SIZE", "10");
-
-define ("COURSE_TITLE_FORM_NAME", "course_title");
-define ("LANGUAGE_SELECT_FORM_NAME" , "course_language");
-define ("REAL_COURSE_SELECT_FORM_NAME" , "real_course_code");
-define ("WANTED_COURSE_CODE_FORM_NAME" , "wanted_course_code");
-define ("COURSE_CATEGORY_FORM_NAME" , "course_category");
-
-/*
------------------------------------------------------------
-	Header
------------------------------------------------------------
-*/
-
-$tool_name = get_lang('AdminManageVirtualCourses'); // title of the page (should come from the language file)
-
-$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
-
-Display::display_header($tool_name);
-
-/*
-==============================================================================
-		DISPLAY FUNCTIONS
-==============================================================================
-*/
-
-function make_strong($text)
-{
-	return "<strong>" . $text . "</strong>";
-}
-
-
-/**
-*	Return a list of language directories.
-*	@todo function does not belong here, move to code library,
-*	also see infocours.php and index.php which contain a similar function
-*/
-function get_language_folder_list($dirname)
-{
-	if($dirname[strlen($dirname)-1]!='/') $dirname.='/';
-	$handle=opendir($dirname);
-	while ($entries = readdir($handle))
-	{
-		if ($entries=='.' || $entries=='..' || $entries=='CVS') continue;
-		if (is_dir($dirname.$entries))
-		{
-			$language_list[] = $entries;
-		}
-	}
-	closedir($handle);
-	return $language_list;
-}
-
-/**
-* Displays a select element (drop down menu) so the user can select
-* the course language.
-* @todo function does not belong here, move to (display?) library,
-* @todo language display used apparently no longer existing array, converted to english for now.
-* but we should switch to display the real language names.
-*/
-function display_language_select($element_name)
-{
-	global $platformLanguage;
-
-	//get language list
-	$dirname = api_get_path(SYS_PATH)."main/lang/";
-	$language_list = get_language_folder_list($dirname);
-	sort($language_list);
-
-	//build array with strings to display
-	foreach ($language_list as $this_language)
-	{
-		$language_to_display[$this_language] = $this_language;
-	}
-
-	//sort alphabetically
-	//warning: key,value association needs to be maintained --> asort instead of sort
-	asort($language_to_display);
-
-	$user_selected_language = $_SESSION["user_language_choice"];
-	if (! isset($user_selected_language) ) $user_selected_language = $platformLanguage;
-
-	//display
-	echo "<select name=\"$element_name\">";
-	foreach ($language_to_display as $key => $value)
-	{
-		if ($key == $user_selected_language) $option_end = "selected >";
-		else $option_end = ">";
-		echo "<option value=\"$key\" $option_end";
-
-		echo $value;
-		echo "</option>\n";
-	}
-	echo "</select>";
-}
-
-/**
-*	This code creates a select form element to let the user
-*	choose a real course to link to.
-*
-*	We display the course code, but internally store the course id.
-*/
-function display_real_course_code_select($element_name)
-{
-	$real_course_list = CourseManager::get_real_course_list();
-
-	echo "<select name=\"$element_name\" size=\"".SELECT_BOX_SIZE."\" >\n";
-	foreach($real_course_list as $real_course)
-	{
-		$course_code = $real_course["code"];
-		echo "<option value=\"". $course_code ."\">";
-		echo $course_code;
-		echo "</option>\n";
-	}
-	echo "</select>\n";
-}
-
-
-function display_create_virtual_course_form()
-{
-	global $charset;
-
-	$category_table = Database::get_main_table(TABLE_MAIN_CATEGORY);
-
-	$message = make_strong(get_lang('AdminCreateVirtualCourse')) . "<br/>" . get_lang('AdminCreateVirtualCourseExplanation') . "<br/>This feature is in development phase, bug reports welcome.";
-	?>
-	<p><?php echo $message;	?></p>
-	<b><?php echo get_lang('MandatoryFields') ?></b>
-	<form method="post" action="<?php echo api_get_self(); ?>">
-	<table>
-	<tr valign="top">
-	<td colspan="2">
-
-	</td>
-	</tr>
-
-	<tr valign="top">
-	<td align="right">
-		<?php
-			echo make_strong(get_lang('CourseTitle')) . "&nbsp;";
-			echo "</td>";
-			echo "<td valign=\"top\">";
-			echo "<input type=\"Text\" name=\"".COURSE_TITLE_FORM_NAME."\" size=\"".FORM_ELEMENT_TEXT_SIZE."\" value=\"$valueIntitule\"/><br />".get_lang('Ex') ;
-		?>
-	</td>
-	</tr>
-
-	<tr valign="top">
-	<td align="right"><?php echo make_strong(get_lang('CourseFaculty')) . "&nbsp;"; ?> </td>
-	<td>
-		<?php
-			echo "<select name=\"".COURSE_CATEGORY_FORM_NAME."\">";
-
-			$sql_query = "SELECT code, name
-									FROM $category_table
-									WHERE auth_course_child ='TRUE'
-									ORDER BY tree_pos";
-			$category_result = Database::query($sql_query);
-
-			while ($current_category = Database::fetch_array($category_result))
-			{
-				echo "<option value=\"", $current_category["code"], "\"";
-				echo ">(", $current_category["code"], ") ", $current_category["name"];
-				echo "</option>\n";
-			}
-		?>
-	</select>
-	<br /><?php echo make_strong(get_lang('TargetFac'))  . "&nbsp;" ?>
-	</td>
-	</tr>
-
-	<tr valign="top">
-	<td align="right"><?php echo make_strong(get_lang('Code'))  . "&nbsp;" ?> </td>
-	<td>
-	<?php
-	echo "<input type=\"Text\" name=\"".WANTED_COURSE_CODE_FORM_NAME."\" maxlength=\"".FORM_ELEMENT_CODE_SIZE."\" value=\"$valuePublicCode\"/>
-	<br/>" . get_lang('Max');
-	?>
-	</td>
-	</tr>
-
-	<tr valign="top">
-	<td align="right">
-	<?php echo make_strong(get_lang('RealCourseCode'))  . "&nbsp;" ?>
-	</td>
-	<td>
-		<?php
-			display_real_course_code_select(REAL_COURSE_SELECT_FORM_NAME);
-			//echo "<input type=\"Text\" name=\"real_course_code\" maxlength=\"".FORM_ELEMENT_CODE_SIZE."\" value=\"" . api_htmlentities($valueTitular, ENT_COMPAT, $charset) . "\"/>";
-		?>
-	</td>
-	</tr>
-
-	<tr valign="top">
-	<td align="right">
-		<?php
-			echo make_strong(get_lang('CourseLanguage')) . "&nbsp;";
-		?>
-	</td>
-	<td> <?php  display_language_select(LANGUAGE_SELECT_FORM_NAME); ?>
-
-	</td>
-	</tr>
-	<tr valign="top">
-	<td>
-	</td>
-	<td>
-	<input type="Submit" name="submit_create_virtual_course" value="<?php echo get_lang('Ok')?>"/>
-	</td>
-	</tr>
-	</table>
-	</form>
-	<?php
-}
-
-function display_main_options()
-{
-	$message = "<ul><li><a href=\"?action=".CREATE_VIRTUAL_COURSE_OPTION."\">".get_lang('CreateVirtualCourse')."</a></li>";
-	$message .= "<li><a href=\"?action=".DISPLAY_VIRTUAL_COURSE_LIST_OPTION."\">".get_lang('DisplayListVirtualCourses')."</a></li></ul>";
-	echo $message;
-}
-
-function display_virtual_course_list()
-{
-	$course_list = CourseManager::get_virtual_course_list();
-	if (! is_array($course_list) )
-	{
-		//there are no virtual courses
-		echo "<i>".get_lang('ThereAreNoVirtualCourses')."</i>";
-		return;
-	}
-
-	$column_header[] = array(get_lang('Title'),true);
-	$column_header[] = array(get_lang('Code'),true);
-	$column_header[] = array(get_lang('VisualCode'),true);
-	$column_header[] = array(get_lang('LinkedCourseTitle'),true);
-	$column_header[] = array(get_lang('LinkedCourseCode'),true);
-	$table_data = array();
-	for($i = 0; $i < count($course_list); $i++)
-	{
-		$course_list[$i] = Database::generate_abstract_course_field_names($course_list[$i]);
-		$target_course_code = $course_list[$i]["target_course_code"];
-		$real_course_info = Database::get_course_info($target_course_code);
-
-		$row = array();
-		$row[] = $course_list[$i]["title"];
-		$row[] = $course_list[$i]["system_code"];
-		$row[] = $course_list[$i]["visual_code"];
-		$row[] = $real_course_info["title"];
-		$row[]= $real_course_info["system_code"];
-		$table_data[] = $row;
-	}
-	Display::display_sortable_table($column_header,$table_data,array(),array(),array('action'=>$_GET['action']));
-}
-
-
-/*
-==============================================================================
-		TOOL LOGIC FUNCTIONS
-==============================================================================
-*/
-
-/**
-*	Checks all parameters needed to create a virtual course.
-*	If they are all set, the virtual course creation procedure is called.
-*	Call this function instead of create_virtual_course
-*/
-function attempt_create_virtual_course($real_course_code, $course_title, $wanted_course_code, $course_language, $course_category)
-{
-	//better: create parameter list, check the entire list, when false display errormessage
-	CourseManager::check_parameter_or_fail($real_course_code, "Unspecified parameter: real course id.");
-	CourseManager::check_parameter_or_fail($course_title, "Unspecified parameter: course title.");
-	CourseManager::check_parameter_or_fail($wanted_course_code, "Unspecified parameter: wanted course code.");
-	CourseManager::check_parameter_or_fail($course_language, "Unspecified parameter: course language.");
-	CourseManager::check_parameter_or_fail($course_category, "Unspecified parameter: course category.");
-
-	$message = get_lang('AttemptedCreationVirtualCourse') . "<br/>";
-	$message .= get_lang('CourseTitle') . " " . $course_title . "<br/>";
-	$message .= get_lang('WantedCourseCode') . " " . $wanted_course_code . "<br/>";
-	$message .= get_lang('CourseLanguage') . " " . $course_language . "<br/>";
-	$message .= get_lang('CourseFaculty') . " " . $course_category . "<br/>";
-	$message .= get_lang('LinkedToRealCourseCode') . " " . $real_course_code . "<br/>";
-
-	Display::display_normal_message($message);
-
-	$creation_success = CourseManager::create_virtual_course( $real_course_code, $course_title, $wanted_course_code, $course_language, $course_category );
-
-	if ($creation_success)
-	{
-		Display::display_normal_message( $course_title . " - " . get_lang('CourseCreationSucceeded') );
-		return true;
-	}
-	return false;
-}
-
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
-
-$action = $_GET["action"];
-$attempt_create_virtual_course = $_POST["submit_create_virtual_course"];
-
-//api_display_tool_title($tool_name);
-
-if ( isset($attempt_create_virtual_course) && $attempt_create_virtual_course )
-{
-	$real_course_code = $_POST[REAL_COURSE_SELECT_FORM_NAME];
-	$course_title = $_POST[COURSE_TITLE_FORM_NAME];
-	$wanted_course_code = $_POST[WANTED_COURSE_CODE_FORM_NAME];
-	$course_language = $_POST[LANGUAGE_SELECT_FORM_NAME];
-	$course_category = $_POST[COURSE_CATEGORY_FORM_NAME];
-
-	$message = get_lang('AttemptedCreationVirtualCourse') . "<br/>";
-	$message .= get_lang('CourseTitle') . " " . $course_title . "<br/>";
-	$message .= get_lang('WantedCourseCode') . " " . $wanted_course_code . "<br/>";
-	$message .= get_lang('CourseLanguage') . " " . $course_language . "<br/>";
-	$message .= get_lang('CourseFaculty') . " " . $course_category . "<br/>";
-	$message .= get_lang('LinkedToRealCourseCode') . " " . $real_course_code . "<br/>";
-
-	Display::display_normal_message($message);
-
-	$creation_success = CourseManager::attempt_create_virtual_course($real_course_code, $course_title, $wanted_course_code, $course_language, $course_category);
-
-	if ($creation_success)
-	{
-		Display::display_normal_message( $course_title . " - " . get_lang('CourseCreationSucceeded') );
-	}
-	else
-	{
-		//should display error message
-	}
-	echo "<br/>";
-}
-
-
-display_main_options();
-
-switch($action)
-{
-	case CREATE_VIRTUAL_COURSE_OPTION:
-							display_create_virtual_course_form();
-							break;
-	case DISPLAY_VIRTUAL_COURSE_LIST_OPTION:
-							display_virtual_course_list();
-							break;
-}
-
-/*
-==============================================================================
-		FOOTER
-==============================================================================
-*/
-Display::display_footer();
-?>

+ 1 - 1
main/admin/dashboard_add_courses_to_user.php

@@ -61,7 +61,7 @@ function search_courses($needle, $type)
 {
     global $_configuration, $tbl_course, $tbl_course_rel_access_url,$user_id;
 
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas

+ 1 - 1
main/admin/dashboard_add_sessions_to_user.php

@@ -62,7 +62,7 @@ function search_sessions($needle, $type)
 {
     global $_configuration, $tbl_session_rel_access_url, $tbl_session, $user_id;
 
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas

+ 1 - 1
main/admin/dashboard_add_users_to_user.php

@@ -67,7 +67,7 @@ function search_users($needle,$type)
 {
     global $tbl_access_url_rel_user,  $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
 
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas

+ 2 - 2
main/admin/group_add.php

@@ -10,7 +10,7 @@ $language_file = array('admin', 'registration', 'userInfo');
 $cidReset = true;
 
 // Including necessary libraries.
-require '../inc/global.inc.php';
+require_once '../inc/global.inc.php';
 $libpath = api_get_path(LIBRARY_PATH);
 
 // Section for the tabs
@@ -96,7 +96,7 @@ $defaults['status'] = GROUP_PERMISSION_OPEN;
 $form->setDefaults($defaults);
 
 // Submit button
-$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
+$form->addButtonCreate(get_lang('Add'));
 
 // Validate form
 if( $form->validate()) {

+ 1 - 1
main/admin/group_edit.php

@@ -86,7 +86,7 @@ $status[GROUP_PERMISSION_CLOSED]	= get_lang('Closed');
 $form->addElement('select', 'visibility', get_lang('GroupPermissions'), $status, array());
 
 // Submit button
-$form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
+$form->addButtonUpdate(get_lang('ModifyInformation'));
 
 // Set default values
 $form->setDefaults($group_data);

+ 7 - 8
main/admin/group_list.php

@@ -263,11 +263,11 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
     //api_display_tool_title($tool_name);
     $form = new FormValidator('advanced_search', 'get');
     $form->addElement('header', '', $tool_name);
-    $form->add_textfield('keyword_firstname', get_lang('FirstName'), false);
-    $form->add_textfield('keyword_lastname', get_lang('LastName'), false);
-    $form->add_textfield('keyword_username', get_lang('LoginName'), false);
-    $form->add_textfield('keyword_email', get_lang('Email'), false);
-    $form->add_textfield('keyword_officialcode', get_lang('OfficialCode'), false);
+    $form->addText('keyword_firstname', get_lang('FirstName'), false);
+    $form->addText('keyword_lastname', get_lang('LastName'), false);
+    $form->addText('keyword_username', get_lang('LoginName'), false);
+    $form->addText('keyword_email', get_lang('Email'), false);
+    $form->addText('keyword_officialcode', get_lang('OfficialCode'), false);
     $status_options = array();
     $status_options['%'] = get_lang('All');
     $status_options[STUDENT] = get_lang('Student');
@@ -278,7 +278,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
     $active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active'));
     $active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive'));
     $form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false);
-    $form->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
+    $form->addButtonSearch(get_lang('SearchUsers'));
     $defaults['keyword_active'] = 1;
     $defaults['keyword_inactive'] = 1;
     $form->setDefaults($defaults);
@@ -355,8 +355,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
     $renderer = & $form->defaultRenderer();
     $renderer->setElementTemplate('<span>{element}</span> ');
     $form->addElement('text', 'keyword', get_lang('keyword'));
-    $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
-    //$form->addElement('static','search_advanced_link',null,'<a href="user_list.php?search=advanced">'.get_lang('AdvancedSearch').'</a>');
+    $form->addButtonSearch(get_lang('Search'));
     echo '<div class="actions" style="width:100%;">';
     if (api_is_platform_admin()) {
         echo '<span style="float:right;">'.

+ 0 - 1
main/admin/inactive_user_list.php

@@ -14,7 +14,6 @@ $language_file = array ('registration','admin');
 $cidReset = true;
 require_once '../inc/global.inc.php';
 
-$tbl_stats_access 		= Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
 $this_section = SECTION_PLATFORM_ADMIN;
 api_protect_admin_script(true);
 

+ 23 - 50
main/admin/index.php

@@ -4,9 +4,6 @@
  * Index page of the admin tools
  * @package chamilo.admin
  */
-/**
- * Code
- */
 
 // Language files that need to be included.
 $language_file = array('admin', 'tracking','coursebackup');
@@ -32,7 +29,6 @@ if (api_is_multiple_url_enabled()) {
         $urlInfo = api_get_access_url($accessUrlId);
         $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
         $cleanUrl = str_replace('/', '-', $url);
-
         $adminExtraContentDir = api_get_path(SYS_PATH) . "home/$cleanUrl/admin/";
     }
 } else {
@@ -43,11 +39,6 @@ if (api_is_multiple_url_enabled()) {
 $message = '';
 
 if (api_is_platform_admin()) {
-    /* deprecated since 2014-10-30 (all main/install/ files were checked against direct execution)
-    if (is_dir(api_get_path(SYS_CODE_PATH).'install/') && is_readable(api_get_path(SYS_CODE_PATH).'install/index.php')) {
-        $message = Display::return_message(get_lang('InstallDirAccessibleSecurityThreat'),'warning');
-    }
-    */
     if (is_dir(api_get_path(SYS_ARCHIVE_PATH)) && !is_writable(api_get_path(SYS_ARCHIVE_PATH))) {
         $message = Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'), 'warning');
     }
@@ -103,9 +94,11 @@ if (api_is_platform_admin()) {
     $blocks['users']['editable'] = true;
 
     $search_form = '
-            <form method="get" class="form-search" action="user_list.php">
-                <input class="span3" type="text" name="keyword" value="">
-                <button class="btn" type="submit">'.get_lang('Search').'</button>
+            <form method="get" class="form-inline" action="user_list.php">
+                <div class="form-group">
+                <input class="form-control" type="text" name="keyword" value="">
+                <button class="btn btn-default" type="submit">'.get_lang('Search').'</button>
+                </div>
             </form>';
     $blocks['users']['search_form'] = $search_form;
     $items = array(
@@ -115,11 +108,9 @@ if (api_is_platform_admin()) {
         array('url'=>'user_import.php', 'label' => get_lang('ImportUserListXMLCSV')),
         array('url'=>'user_update_import.php', 'label' => get_lang('EditUserListCSV')),
     );
+    $items[] = array('url'=>'group_add.php', 	'label' => get_lang('AddGroups'));
+    $items[] = array('url'=>'group_list.php', 	'label' => get_lang('GroupList'));
 
-    if (api_get_setting('allow_social_tool') == 'true') {
-        $items[] = array('url'=>'group_add.php', 	'label' => get_lang('AddGroups'));
-        $items[] = array('url'=>'group_list.php', 	'label' => get_lang('GroupList'));
-    }
     if (isset($extAuthSource) && isset($extAuthSource['extldap']) && count($extAuthSource['extldap']) > 0) {
         $items[] = array('url'=>'ldap_users_list.php', 	'label' => get_lang('ImportLDAPUsersIntoPlatform'));
     }
@@ -150,9 +141,11 @@ if (api_is_platform_admin()) {
         $blocks['courses']['extraContent'] = file_get_contents($coursesBlockExtraFile);
     }
 
-    $search_form = ' <form method="get" class="form-search" action="course_list.php">
-							<input class="span3" type="text" name="keyword" value="">
-							<button class="btn" type="submit">'.get_lang('Search').'</button>
+    $search_form = ' <form method="get" class="form-inline" action="course_list.php">
+                            <div class="form-group">
+							<input class="form-control" type="text" name="keyword" value="">
+							<button class="btn btn-default" type="submit">'.get_lang('Search').'</button>
+							</div>
 	            		</form>';
     $blocks['courses']['search_form'] = $search_form;
 
@@ -199,10 +192,12 @@ if (api_is_platform_admin()) {
         $blocks['platform']['extraContent'] = file_get_contents($platformBlockExtraFile);
     }
 
-    $search_form = ' <form method="get" action="settings.php" class="form-search">
-							<input class="span3" type="text" name="search_field" value="" >
+    $search_form = ' <form method="get" action="settings.php" class="form-inline">
+                            <div class="form-group">
+							<input class="form-control" type="text" name="search_field" value="" >
                             <input type="hidden" value="search_setting" name="category">
-							<button class="btn" type="submit">'.get_lang('Search').'</button>
+							<button class="btn btn-default" type="submit">'.get_lang('Search').'</button>
+							</div>
 	            		</form>';
 	$blocks['platform']['search_form'] = $search_form;
 
@@ -258,9 +253,11 @@ if (api_is_platform_admin()) {
     $blocks['sessions']['editable'] = true;
 }
 
-$search_form = ' <form method="GET" class="form-search" action="session_list.php">
-                    <input class="span3" type="text" name="keyword" value="">
-                    <button class="btn" type="submit">'.get_lang('Search').'</button>
+$search_form = ' <form method="GET" class="form-inline" action="session_list.php">
+                    <div class="form-group">
+                    <input class="form-control" type="text" name="keyword" value="">
+                    <button class="btn btn-default" type="submit">'.get_lang('Search').'</button>
+                    </div>
                 </form>';
 $blocks['sessions']['search_form'] = $search_form;
 $items = array();
@@ -287,7 +284,6 @@ $items[] = array('url'=>'extra_fields.php?type=session', 	'label' => get_lang('M
 $blocks['sessions']['items'] = $items;
 $blocks['sessions']['extra'] = null;
 
-
 /* Settings */
 if (api_is_platform_admin()) {
 
@@ -326,24 +322,7 @@ if (api_is_platform_admin()) {
 
     $blocks['settings']['search_form'] = null;
 
-    /* Extensions */
-    /*
-    $blocks['extensions']['icon']  = Display::return_icon('visio_meeting.gif', get_lang('ConfigureExtensions'), array(), ICON_SIZE_SMALL, false);
-    $blocks['extensions']['label'] = api_ucfirst(get_lang('ConfigureExtensions'));
-    $blocks['extensions']['class'] = 'block-admin-extensions';
-
-
-    $items = array();
-    $items[] = array('url'=>'configure_extensions.php?display=visio', 	'label' => get_lang('Visioconf'));
-    $items[] = array('url'=>'configure_extensions.php?display=ppt2lp', 	'label' => get_lang('Ppt2lp'));
-    //$items[] = array('url'=>'configure_extensions.php?display=ephorus', 	'label' => get_lang('EphorusPlagiarismPrevention'));
-    $items[] = array('url'=>'configure_extensions.php?display=search', 	'label' => get_lang('SearchEngine'));
-    $items[] = array('url'=>'configure_extensions.php?display=serverstats', 	'label' => get_lang('ServerStatistics'));
-    $items[] = array('url'=>'configure_extensions.php?display=bandwidthstats', 	'label' => get_lang('BandWidthStatistics'));
-    $blocks['extensions']['items'] = $items;
-    */
-
-    //Skills
+    // Skills
     if (api_get_setting('allow_skills_tool') == 'true') {
         $blocks['skills']['icon']  = Display::return_icon('logo.png', get_lang('Skills'), array(), ICON_SIZE_SMALL, false);
         $blocks['skills']['label'] = get_lang('Skills');
@@ -369,7 +348,6 @@ if (api_is_platform_admin()) {
     $blocks['chamilo']['label'] = 'Chamilo.org';
     $blocks['chamilo']['class'] = 'block-admin-chamilo';
 
-
     $items = array();
     $items[] = array('url'=>'http://www.chamilo.org/', 	'label' => get_lang('ChamiloHomepage'));
     $items[] = array('url'=>'http://www.chamilo.org/forum', 	'label' => get_lang('ChamiloForum'));
@@ -386,11 +364,6 @@ if (api_is_platform_admin()) {
     $blocks['chamilo']['extra'] = null;
     $blocks['chamilo']['search_form'] = null;
 
-    // Try to display a maximum before we check the chamilo version and all that.
-    //session_write_close(); //close session to avoid blocking concurrent access
-    //flush(); //send data to client as much as allowed by the web server
-    //ob_flush();
-
     //Version check
     $blocks['version_check']['icon']  = Display::return_icon('logo.png', 'Chamilo.org', array(), ICON_SIZE_SMALL, false);
     $blocks['version_check']['label'] = get_lang('VersionCheck');

+ 5 - 5
main/admin/ldap_users_list.php

@@ -171,16 +171,16 @@ if (isset ($_POST['action']))
 }
 
 $form = new FormValidator('advanced_search','get');
-$form->add_textfield('keyword_username',get_lang('LoginName'),false);
+$form->addText('keyword_username',get_lang('LoginName'),false);
 if (api_is_western_name_order())
 {
-	$form->add_textfield('keyword_firstname', get_lang('FirstName'), false);
-	$form->add_textfield('keyword_lastname', get_lang('LastName'), false);
+	$form->addText('keyword_firstname', get_lang('FirstName'), false);
+	$form->addText('keyword_lastname', get_lang('LastName'), false);
 }
 else
 {
-	$form->add_textfield('keyword_lastname',get_lang('LastName'),false);
-	$form->add_textfield('keyword_firstname',get_lang('FirstName'),false);
+	$form->addText('keyword_lastname',get_lang('LastName'),false);
+	$form->addText('keyword_firstname',get_lang('FirstName'),false);
 }
 if (isset($_GET['id_session']))
 	$form->addElement('hidden','id_session',$_GET['id_session']);

+ 1 - 1
main/admin/legal_add.php

@@ -99,7 +99,7 @@ if (isset($_POST['language'])) {
 
 	$form->addElement('static', Security::remove_XSS($_POST['language']));
 	$form->addElement('hidden', 'language',Security::remove_XSS($_POST['language']));
-	$form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'terms_and_conditions', 'Width' => '100%', 'Height' => '250'));
+	$form->addHtmlEditor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'terms_and_conditions', 'Width' => '100%', 'Height' => '250'));
 
 	$form->addElement('radio', 'type', '', get_lang('HTMLText') ,'0');
 	$form->addElement('radio', 'type', '', get_lang('PageLink') ,'1');

+ 6 - 8
main/admin/session_add.php

@@ -34,7 +34,7 @@ $tbl_user		= Database::get_main_table(TABLE_MAIN_USER);
 function search_coachs($needle) {
 	global $tbl_user;
 
-	$xajax_response = new XajaxResponse();
+	$xajax_response = new xajaxResponse();
 	$return = '';
 
 	if(!empty($needle)) {
@@ -271,9 +271,9 @@ if (intval($countUsers) < 50) {
 }
 
 $form->addRule('coach_username', get_lang('ThisFieldIsRequired'), 'required');
-$form->add_html('<div id="ajax_list_coachs"></div>');
+$form->addHtml('<div id="ajax_list_coachs"></div>');
 
-$form->add_select('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
+$form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
     'id' => 'session_category',
     'class' => 'chzn-select',
     'style' => 'width:370px;'
@@ -364,9 +364,7 @@ $(function() {
 });
 </script>';
 
-$form->addElement('button', 'submit', get_lang('NextStep'), array(
-    'class' => 'save'
-));
+$form->addButtonNext(get_lang('NextStep'));
 
 $formDefaults = array(
     'nb_days_acess_before' => $nb_days_acess_before,
@@ -394,8 +392,8 @@ if ($form->validate()) {
     $coach_username = $params['coach_username'];
     $id_session_category = $params['session_category'];
     $id_visibility = $params['session_visibility'];
-    $end_limit = isset($params['end_limit']) ? true : false;
-    $start_limit = isset($params['start_limit']) ? true : false;
+    $end_limit = isset($params['end_limit']);
+    $start_limit = isset($params['start_limit']);
     $duration = isset($params['duration']) ? $params['duration'] : null;
     $description = $params['description'];
     $showDescription = isset($params['show_description']) ? 1: 0;

+ 1 - 2
main/admin/session_category_list.php

@@ -57,8 +57,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
     $active_group[] = $form->createElement('checkbox', 'active', '', get_lang('Active'));
     $active_group[] = $form->createElement('checkbox', 'inactive', '', get_lang('Inactive'));
     $form->addGroup($active_group, '', get_lang('ActiveSession'), '<br/>', false);
-
-    $form->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
+    $form->addButtonSearch(get_lang('SearchUsers'));
     $defaults['active'] = 1;
     $defaults['inactive'] = 1;
     $form->setDefaults($defaults);

+ 8 - 13
main/admin/session_edit.php

@@ -4,9 +4,6 @@
  * Sessions edition script
  * @package chamilo.admin
  */
-/**
- * Code
- */
 
 // name of the language file that needs to be included
 $language_file ='admin';
@@ -72,7 +69,7 @@ $monthsOption = array();
 
 for ($i = 1; $i <= 12; $i++) {
     $month = sprintf("%02d", $i);
-    
+
     $monthsOption[$month] = $month;
 }
 
@@ -92,13 +89,13 @@ foreach ($coaches as $coach) {
     $coachesOption[$coach['user_id']] = "$personName ({$coach['username']})";
 }
 
-$Categories = SessionManager::get_all_session_category();
+$categoriesList = SessionManager::get_all_session_category();
 
 $categoriesOption = array(
     '0' => get_lang('None')
 );
 
-if ($Categories != false) {
+if ($categoriesList != false) {
     foreach ($categoriesList as $categoryItem) {
         $categoriesOption[$categoryItem['id']] = $categoryItem['name'];
     }
@@ -130,7 +127,7 @@ $form->addElement('select', 'id_coach', get_lang('CoachName'), $coachesOption, a
 ));
 $form->addRule('id_coach', get_lang('ThisFieldIsRequired'), 'required');
 
-$form->add_select('session_category', get_lang('SessionCategory'), $categoriesOption, array(
+$form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOption, array(
     'id' => 'session_category',
     'class' => 'chzn-select',
     'style' => 'width:370px;'
@@ -253,9 +250,7 @@ $(function() {
 });
 </script>';
 
-$form->addElement('button', 'submit', get_lang('ModifyThisSession'), array(
-    'class' => 'save'
-));
+$form->addButtonUpdate(get_lang('ModifyThisSession'));
 
 $formDefaults = array(
     'id_coach' => $infos['id_coach'],
@@ -295,10 +290,10 @@ if ($form->validate()) {
     $description = $params['description'];
     $showDescription = isset($params['show_description']) ? 1: 0;
 
-    $end_limit = $params['end_limit'];
-    $start_limit = $params['start_limit'];
+    $end_limit = isset($params['end_limit']);
+    $start_limit = isset($params['start_limit']);
 
-    if (empty($end_limit) && empty($start_limit)) {
+    if (!$end_limit && !$start_limit) {
         $nolimit = 1;
     } else {
         $nolimit = null;

+ 1 - 1
main/admin/session_list.php

@@ -43,7 +43,7 @@ if (!empty($error_message)) {
     Display::display_normal_message($error_message, false);
 }
 
-$sessionFilter = new FormValidator('course_filter', 'get', '', '', array('class'=> 'form-search'), false);
+$sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
 $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course';
 $courseList = array();
 $courseId = isset($_GET['course_id']) ? $_GET['course_id'] : null;

+ 1 - 1
main/admin/settings.lib.php

@@ -895,7 +895,7 @@ function add_edit_template() {
     $form->addElement('header', '', $title);
 
     // Setting the form elements: the title of the template.
-    $form->add_textfield('title', get_lang('Title'), false);
+    $form->addText('title', get_lang('Title'), false);
 
     // Setting the form elements: the content of the template (wysiwyg editor).
     $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400'));

+ 1 - 1
main/admin/skills_profile.php

@@ -35,7 +35,7 @@ $form = new FormValidator('profile_search');
 
 $form->addElement('header', get_lang('SearchSkills'));
 $form->addElement('select', 'skills', null, null, array('id'=>'skills'));
-$form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="btn"');
+$form->addButtonSearch(get_lang('Search'));
 
 $profiles = $skill_profile->get_all();
 

+ 1 - 1
main/admin/special_exports.php

@@ -66,7 +66,7 @@ if ((isset ($_POST['action']) && $_POST['action'] == 'course_select_form') || (i
 			$Resource = $_POST['resource'];
 
 			foreach ($Resource as $Code_course => $Sessions) {
-				$_course 		= Database::get_course_info($Code_course);
+				$_course 		= api_get_course_info($Code_course);
 				$tbl_document 	= Database::get_course_table(TABLE_DOCUMENT);
 				$tbl_property 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
 				$course_id 		= $_course['real_id'];

+ 2 - 2
main/admin/system_announcements.php

@@ -133,7 +133,7 @@ if ($action_todo) {
     }
     $form = new FormValidator('system_announcement');
     $form->addElement('header', '', $form_title);
-    $form->add_textfield('title', get_lang('Title'), true, array('class'=>'span4'));
+    $form->addText('title', get_lang('Title'), true, array('class'=>'span4'));
     $language_list = api_get_languages();
     $language_list_with_keys = array();
     $language_list_with_keys['all'] = get_lang('All');
@@ -142,7 +142,7 @@ if ($action_todo) {
     }
 
     $form->addElement('select', 'lang',get_lang('Language'), $language_list_with_keys);
-    $form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'PortalNews', 'Width' => '100%', 'Height' => '300'));
+    $form->addHtmlEditor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'PortalNews', 'Width' => '100%', 'Height' => '300'));
     $form->addDateRangePicker('range', get_lang('StartTimeWindow'), true, array('id' => 'date_range'));
 
     $group = array();

+ 0 - 5
main/admin/teacher_time_report.php

@@ -51,11 +51,6 @@ $sessionsList = SessionManager::get_sessions_list(array(), array('name'));
 
 $teacherList = UserManager::getTeachersList();
 
-$htmlHeadXtra[] = '
-<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/daterange/moment.min.js"></script>
-<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/daterange/daterangepicker-bs2.css">
-<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/daterange/daterangepicker.js"></script>';
-
 $withFilter = false;
 
 $reportTitle = get_lang('TimeReportIncludingAllCoursesAndSessionsByTeacher');

+ 52 - 11
main/admin/user_add.php

@@ -235,7 +235,14 @@ $form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), '&nbsp;');
 $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
 $group = array ();
 $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
-$group[] = $form->createElement('DatePicker', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
+$group[] = $form->createElement(
+    'DatePicker',
+    'expiration_date',
+    null,
+    array(
+        'onchange' => 'javascript: enable_expiration_date();'
+    )
+);
 $form->addGroup($group, 'max_member_group', null, '', false);
 // Active account or inactive account
 $form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
@@ -258,20 +265,18 @@ $defaults['admin']['platform_admin'] = 0;
 $defaults['mail']['send_mail'] = 1;
 $defaults['password']['password_auto'] = 1;
 $defaults['active'] = 1;
-$defaults['expiration_date'] = array();
 $days = api_get_setting('account_valid_duration');
-$time = strtotime('+'.$days.' day');
-$defaults['expiration_date']['d'] = date('d', $time);
-$defaults['expiration_date']['F'] = date('m', $time);
-$defaults['expiration_date']['Y'] = date('Y', $time);
+$defaults['expiration_date'] = date('Y-m-d', api_strtotime('+'.$days.' day'));
+
 $defaults['radio_expiration_date'] = 0;
 $defaults['status'] = STUDENT;
 $defaults = array_merge($defaults, $extra_data);
 $form->setDefaults($defaults);
 
 // Submit button
-$html_results_enabled[] = $form-> createElement ('style_submit_button', 'submit_plus', get_lang('Add').'+', 'class="add"');
-$html_results_enabled[] = $form-> createElement ('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
+$html_results_enabled[] = $form->createElement('button', 'submit', get_lang('Add'), 'plus', 'primary');
+$html_results_enabled[] = $form->createElement('button', 'submit_plus', get_lang('Add').'+');
+
 $form->addGroup($html_results_enabled);
 
 // Validate form
@@ -303,7 +308,7 @@ if( $form->validate()) {
 		if ($user['radio_expiration_date'] == '1') {
 			$expiration_date = $user['expiration_date'];
 		} else {
-			$expiration_date = '0000-00-00 00:00:00';
+			$expiration_date = null;
 		}
 
 		$active = intval($user['active']);
@@ -319,7 +324,25 @@ if( $form->validate()) {
             }
         }
 
-		$user_id = UserManager::create_user($firstname, $lastname, $status, $email, $username, $password, $official_code, $language, $phone, null, $auth_source, $expiration_date, $active, $hr_dept_id, $extra, null, $send_mail);
+        $user_id = UserManager::create_user(
+            $firstname,
+            $lastname,
+            $status,
+            $email,
+            $username,
+            $password,
+            $official_code,
+            $language,
+            $phone,
+            null,
+            $auth_source,
+            $expiration_date,
+            $active,
+            $hr_dept_id,
+            $extra,
+            null,
+            $send_mail
+        );
 
 		Security::clear_token();
 		$tok = Security::get_token();
@@ -334,7 +357,25 @@ if( $form->validate()) {
 		} else {
  			if (!empty($picture['name'])) {
 				$picture_uri = UserManager::update_user_picture($user_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
-				UserManager::update_user($user_id, $firstname, $lastname, $username, $password, $auth_source, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active, null, $hr_dept_id, null, $language);
+                UserManager::update_user(
+                    $user_id,
+                    $firstname,
+                    $lastname,
+                    $username,
+                    $password,
+                    $auth_source,
+                    $email,
+                    $status,
+                    $official_code,
+                    $phone,
+                    $picture_uri,
+                    $expiration_date,
+                    $active,
+                    null,
+                    $hr_dept_id,
+                    null,
+                    $language
+                );
 			}
 
 			foreach ($extra as $key => $value) {

+ 29 - 29
main/admin/user_edit.php

@@ -25,7 +25,6 @@ $htmlHeadXtra[] = '
 <script>
 var is_platform_id = "'.$is_platform_admin.'";
 
-<!--
 function enable_expiration_date() {
 	document.user_edit.radio_expiration_date[0].checked=false;
 	document.user_edit.radio_expiration_date[1].checked=true;
@@ -69,7 +68,6 @@ function confirmation(name) {
         return false;
     }
 }
-//-->
 </script>';
 
 $libpath = api_get_path(LIBRARY_PATH);
@@ -81,7 +79,9 @@ $interbreadcrumb[] = array('url' => "user_list.php","name" => get_lang('UserList
 
 $table_user = Database::get_main_table(TABLE_MAIN_USER);
 $table_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
-$sql = "SELECT u.*, a.user_id AS is_admin FROM $table_user u LEFT JOIN $table_admin a ON a.user_id = u.user_id WHERE u.user_id = '".$user_id."'";
+$sql = "SELECT u.*, a.user_id AS is_admin FROM $table_user u
+        LEFT JOIN $table_admin a ON a.user_id = u.user_id
+        WHERE u.user_id = '".$user_id."'";
 $res = Database::query($sql);
 if (Database::num_rows($res) != 1) {
     header('Location: user_list.php');
@@ -94,8 +94,7 @@ $user_data['send_mail'] = 0;
 $user_data['old_password'] = $user_data['password'];
 //Convert the registration date of the user
 
-//@todo remove the date_default_timezone_get() see UserManager::create_user function
-$user_data['registration_date'] = api_get_local_time($user_data['registration_date'], null, date_default_timezone_get());
+$user_data['registration_date'] = api_get_local_time($user_data['registration_date']);
 unset($user_data['password']);
 $extra_data = UserManager :: get_extra_user_data($user_id, true);
 $user_data = array_merge($user_data, $extra_data);
@@ -203,14 +202,24 @@ $form->addGroup($group, 'password', null, '', false);
 
 // Status
 $status = array();
-$status[COURSEMANAGER] 	= get_lang('Teacher');
-$status[STUDENT] 		= get_lang('Learner');
-$status[DRH] 			= get_lang('Drh');
-$status[SESSIONADMIN] 	= get_lang('SessionsAdmin');
-$status[STUDENT_BOSS] 	= get_lang('RoleStudentBoss');
-$status[INVITEE] 	= get_lang('Invitee');
-
-$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();','class'=>'chzn-select'));
+$status[COURSEMANAGER] = get_lang('Teacher');
+$status[STUDENT] = get_lang('Learner');
+$status[DRH] = get_lang('Drh');
+$status[SESSIONADMIN] = get_lang('SessionsAdmin');
+$status[STUDENT_BOSS] = get_lang('RoleStudentBoss');
+$status[INVITEE] = get_lang('Invitee');
+
+$form->addElement(
+    'select',
+    'status',
+    get_lang('Profile'),
+    $status,
+    array(
+        'id' => 'status_select',
+        'onchange' => 'javascript: display_drh_list();',
+        'class' => 'chzn-select'
+    )
+);
 
 $display = isset($user_data['status']) && ($user_data['status'] == STUDENT || (isset($_POST['status']) && $_POST['status'] == STUDENT)) ? 'block' : 'none';
 
@@ -263,7 +272,7 @@ if (!$user_data['platform_admin']) {
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
 	$group = array ();
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
-	$group[] = $form->createElement('DatePickerDate', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
+	$group[] = $form->createElement('DatePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
 	$form->addGroup($group, 'max_member_group', null, '', false);
 
 	// Active account or inactive account
@@ -286,26 +295,17 @@ $(document).ready(function(){
 // Submit button
 $form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
 
+
 // Set default values
 $user_data['reset_password'] = 0;
 $expiration_date = $user_data['expiration_date'];
 
-if ($expiration_date == '0000-00-00 00:00:00') {
+if (empty($expiration_date)) {
 	$user_data['radio_expiration_date'] = 0;
-	$user_data['expiration_date'] = array();
-	$user_data['expiration_date']['d'] = date('d');
-	$user_data['expiration_date']['F'] = date('m');
-	$user_data['expiration_date']['Y'] = date('Y');
+	$user_data['expiration_date'] = date('Y-m-d');
 } else {
 	$user_data['radio_expiration_date'] = 1;
-
-	$user_data['expiration_date'] = array();
-	$user_data['expiration_date']['d'] = substr($expiration_date, 8, 2);
-	$user_data['expiration_date']['F'] = substr($expiration_date, 5, 2);
-	$user_data['expiration_date']['Y'] = substr($expiration_date, 0, 4);
-
-    $user_data['expiration_date']['H'] = substr($expiration_date, 11, 2);
-    $user_data['expiration_date']['i'] = substr($expiration_date, 14, 2);
+	$user_data['expiration_date'] = $expiration_date;
 }
 $form->setDefaults($user_data);
 
@@ -345,9 +345,9 @@ if ($form->validate()) {
 		$language = $user['language'];
 
 		if ($user['radio_expiration_date'] == '1' && !$user_data['platform_admin']) {
-            $expiration_date = return_datetime_from_array($user['expiration_date']);
+            $expiration_date = $user['expiration_date'];
 		} else {
-			$expiration_date = '0000-00-00 00:00:00';
+			$expiration_date = null;
 		}
 
 		$active = $user_data['platform_admin'] ? 1 : intval($user['active']);

+ 50 - 27
main/admin/user_list.php

@@ -7,7 +7,7 @@
 */
 
 // name of the language file that needs to be included
-$language_file = array ('registration','admin');
+$language_file = array('registration','admin');
 $cidReset = true;
 require_once '../inc/global.inc.php';
 
@@ -446,6 +446,10 @@ function get_user_data($from, $number_of_items, $column, $direction) {
     $from 	= intval($from);
     $number_of_items = intval($number_of_items);
 
+    if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users')  == 'true') {
+        $sql .= " WHERE u.creator_id = ".api_get_user_id();
+    }
+
 	$sql .= " ORDER BY col$column $direction ";
 	$sql .= " LIMIT $from,$number_of_items";
 
@@ -462,7 +466,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 		} else {
 			$photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" /></center>';
 		}
-        if ($user[7] == 1 && $user[10] != '0000-00-00 00:00:00') {
+        if ($user[7] == 1 && !empty($user[10])) {
             // check expiration date
             $expiration_time = convert_sql_date($user[10]);
             // if expiration date is passed, store a special value for active field
@@ -470,9 +474,23 @@ function get_user_data($from, $number_of_items, $column, $direction) {
         	   $user[7] = '-1';
             }
         }
+
         // forget about the expiration date field
-        $users[] = array($user[0], $photo, $user[1],$user[2], $user[3], $user[4], $user[5], $user[6], $user[7], api_get_local_time($user[9]), $user[0]);
+        $users[] = array(
+            $user[0],
+            $photo,
+            $user[1],
+            $user[2],
+            $user[3],
+            $user[4],
+            $user[5],
+            $user[6],
+            $user[7],
+            api_get_local_time($user[9]),
+            $user[0]
+        );
 	}
+
 	return $users;
 }
 
@@ -631,7 +649,10 @@ function modify_filter($user_id, $url_params, $row) {
     if (api_is_platform_admin()) {
         $result .= ' <a href="'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&amp;user_id='.$user_id.'" class="agenda_opener">'.Display::return_icon('month.png', get_lang('FreeBusyCalendar'), array(), ICON_SIZE_SMALL).'</a>';
         if ($delete_user_available) {
-            if ($user_id != api_get_user_id() && !$user_is_anonymous && api_global_admin_can_edit_admin($user_id)) {
+            if ($user_id != api_get_user_id() &&
+                !$user_is_anonymous &&
+                api_global_admin_can_edit_admin($user_id)
+            ) {
                 // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
                 $result .= ' <a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
             } else {
@@ -648,26 +669,28 @@ function modify_filter($user_id, $url_params, $row) {
  * lock = the user can no longer use this account
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  * @param int $active the current state of the account
- * @param int $user_id The user id
- * @param string $url_params
+ * @param string $params
+ * @param array $row
  * @return string Some HTML-code with the lock/unlock button
  */
-function active_filter($active, $url_params, $row) {
+function active_filter($active, $params, $row)
+{
 	global $_user;
 
-	if ($active=='1') {
-		$action='Lock';
-		$image='accept';
-	} elseif ($active=='-1') {
-    	$action='edit';
-        $image='warning';
-    } elseif ($active=='0') {
-		$action='Unlock';
-		$image='error';
+    if ($active == '1') {
+        $action = 'Lock';
+        $image = 'accept';
+    } elseif ($active == '-1') {
+        $action = 'edit';
+        $image = 'warning';
+    } elseif ($active == '0') {
+        $action = 'Unlock';
+        $image = 'error';
+    }
 
-	}
     $result = '';
-    if ($action=='edit') {
+
+    if ($action == 'edit') {
         $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16);
     } elseif ($row['0']<>$_user['user_id']) {
     	// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
@@ -775,11 +798,11 @@ if (!empty($action)) {
 }
 
 // Create a search-box
-$form = new FormValidator('search_simple', 'get', '', '', array('class' => 'form-search'), false);
+$form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
 $renderer = & $form->defaultRenderer();
 $renderer->setElementTemplate('<span>{element}</span> ');
-$form->addElement('text','keyword', get_lang('keyword'), 'size="25"');
-$form->addElement('style_submit_button', 'submit', get_lang('Search'),'class="btn"');
+$form->addElement('text','keyword', get_lang('keyword'));
+$form->addButtonSearch(get_lang('Search'));
 $form->addElement(
     'static',
     'search_advanced_link',
@@ -832,20 +855,20 @@ $form->addElement('header', get_lang('AdvancedSearch'));
 $form->addElement('html', '<table>');
 
 $form->addElement('html', '<tr><td>');
-$form->add_textfield('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px'));
+$form->addText('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px'));
 $form->addElement('html', '</td><td width="200px;">');
-$form->add_textfield('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px'));
+$form->addText('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px'));
 $form->addElement('html', '</td></tr>');
 
 $form->addElement('html', '<tr><td>');
-$form->add_textfield('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px'));
+$form->addText('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px'));
 $form->addElement('html', '</td>');
 $form->addElement('html', '<td>');
-$form->add_textfield('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px'));
+$form->addText('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px'));
 $form->addElement('html', '</td></tr>');
 
 $form->addElement('html', '<tr><td>');
-$form->add_textfield('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px'));
+$form->addText('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px'));
 $form->addElement('html', '</td><td>');
 
 $status_options = array();
@@ -882,7 +905,7 @@ if (!empty($extra_data)) {
 
     $form->addElement('select', 'keyword_extra_data', get_lang('ExtraData'), $extra_options, array('id'=>'input_select_extra_data', 'style'=>'margin-left:17px', 'onchange'=>'if(this.value!=0){document.getElementById(\'extra_data_text\').style.display=\'block\';document.getElementById(\'input_extra_text\').value = "";}else{document.getElementById(\'extra_data_text\').style.display=\'none\';}'));
     $form->addElement('html', '<div id="extra_data_text" style="display:none;">');
-    $form->add_textfield('keyword_extra_data_text', '', false, array('style'=>'margin-left:17px', 'id'=>'input_extra_text'));
+    $form->addText('keyword_extra_data_text', '', false, array('style'=>'margin-left:17px', 'id'=>'input_extra_text'));
     $form->addElement('html', '</div>');
 } else {
     $form->addElement('html', '<div id="extra_data_text" style="display:none;">');

+ 27 - 20
main/admin/user_move_stats.php

@@ -116,7 +116,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 $course_info = api_get_course_info($origin_course_code);
                 $course_id = $course_info['real_id'];
 
-                $TABLETRACK_EXERCICES       = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
+                $TABLETRACK_EXERCICES       = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
                 $TBL_TRACK_ATTEMPT          = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
                 $TBL_TRACK_E_COURSE_ACCESS  = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
                 $TBL_TRACK_E_LAST_ACCESS    = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
@@ -135,7 +135,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 //ORIGINAL COURSE
 
                 $sql = "SELECT * FROM $TABLETRACK_EXERCICES
-                        WHERE exe_cours_id = '$origin_course_code' AND  session_id = $origin_session_id AND exe_user_id = $user_id ";
+                        WHERE c_id = $course_id AND  session_id = $origin_session_id AND exe_user_id = $user_id ";
                 $res = Database::query($sql);
                 $list = array();
                 while($row = Database::fetch_array($res,'ASSOC')) {
@@ -162,7 +162,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 if (!$update_database) {
 
                     $sql = "SELECT * FROM $TABLETRACK_EXERCICES
-                            WHERE exe_cours_id = '$origin_course_code' AND  session_id = $new_session_id AND exe_user_id = $user_id ";
+                            WHERE c_id = $course_id AND  session_id = $new_session_id AND exe_user_id = $user_id ";
                     $res = Database::query($sql);
                     $list = array();
                     while($row = Database::fetch_array($res,'ASSOC')) {
@@ -190,7 +190,7 @@ if (isset($_REQUEST['load_ajax'])) {
 
                 //3. track_e_course_access
                 $sql = "SELECT * FROM $TBL_TRACK_E_COURSE_ACCESS
-                        WHERE c_id  = '$course_id' AND session_id = $origin_session_id  AND user_id = $user_id ";
+                        WHERE c_id  = $course_id AND session_id = $origin_session_id  AND user_id = $user_id ";
                 $res = Database::query($sql);
                 $list = array();
                 while($row = Database::fetch_array($res,'ASSOC')) {
@@ -200,7 +200,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 if (!empty($list))
                     foreach ($list as $id => $data) {
                         if ($update_database) {
-                            $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = '$new_session_id' WHERE course_access_id = $id";
+                            $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = $new_session_id WHERE course_access_id = $id";
                             if ($debug) echo $sql;
                             $res = Database::query($sql);
                             if ($debug) var_dump($res);
@@ -210,7 +210,9 @@ if (isset($_REQUEST['load_ajax'])) {
                 //4. track_e_lastaccess
 
                 $sql = "SELECT access_id FROM $TBL_TRACK_E_LAST_ACCESS
-                        WHERE c_id = '$course_id' AND access_session_id = $origin_session_id  AND access_user_id = $user_id ";
+                        WHERE c_id = $course_id
+                        AND access_session_id = $origin_session_id
+                        AND access_user_id = $user_id ";
                 $res = Database::query($sql);
                 $list = array();
                 while($row = Database::fetch_array($res,'ASSOC')) {
@@ -219,7 +221,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 if (!empty($list))
                     foreach ($list as $id) {
                         if ($update_database) {
-                            $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = '$new_session_id' WHERE access_id = $id";
+                            $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = $new_session_id WHERE access_id = $id";
                             if ($debug) echo $sql;
                             $res = Database::query($sql);
                             if ($debug) var_dump($res);
@@ -249,7 +251,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 if (!empty($list))
                     foreach ($list as $id=>$data) {
                         if ($update_database) {
-                            $sql = "UPDATE $TBL_LP_VIEW SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id ";
+                            $sql = "UPDATE $TBL_LP_VIEW SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
                             if ($debug) var_dump($sql);
                             $res = Database::query($sql);
                             if ($debug) var_dump($res);
@@ -297,7 +299,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 while($row = Database::fetch_array($res,'ASSOC')) {
                     $id = $row['ref'];
                     if ($update_database) {
-                        $sql = "UPDATE $TBL_AGENDA SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id ";
+                        $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
                         if ($debug) var_dump($sql);
                         $res_update = Database::query($sql);
                         if ($debug) var_dump($res_update);
@@ -361,7 +363,7 @@ if (isset($_REQUEST['load_ajax'])) {
                                     //Creating directory
                                     $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
                                         "url         = '".$created_dir."',
-	                                       c_id        = '".$course_id."',
+	                                       c_id        = $course_id,
 	                                       title        = '".$parent_data['title']."',
 	                                       description  = '".$parent_data['description']." folder_moved_from_session_id_$origin_session_id ',
 	                                       author       = '',
@@ -424,15 +426,15 @@ if (isset($_REQUEST['load_ajax'])) {
                                 //Creating a new work
                                 $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
                                     "url         = '" . $new_url . "',
-                                               c_id        = '".$course_id."',
+                                               c_id        = $course_id,
                                                title       = '" . $data['title']. "',
                                                description = '" . $data['description'] . " file moved',
                                                author      = '" . $data['author'] . "',
                                                active       = '" . $data['active']. "',
                                                accepted     = '" . $data['accepted']. "',
-                                               post_group_id = '" . $data['post_group_id'] . "',
+                                               post_group_id = " . $data['post_group_id'] . ",
                                                sent_date    =  '".$data['sent_date'] ."',
-                                               parent_id    =  '".$new_parent_id ."' ,
+                                               parent_id    =  ".$new_parent_id ." ,
                                                session_id = ".$new_session_id;
 
                                 if ($debug) echo $sql_add_publication;
@@ -472,12 +474,12 @@ if (isset($_REQUEST['load_ajax'])) {
                 while($row = Database::fetch_array($res,'ASSOC')) {
                     $id = $row['id'];
                     if ($update_database) {
-                        $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id";
+                        $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id";
                         if ($debug) var_dump($sql);
                         $res = Database::query($sql);
                         if ($debug) var_dump($res);
 
-                        $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = '$new_session_id' WHERE file_id = $id";
+                        $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id";
                         if ($debug)
                             var_dump($sql);
                         $res = Database::query($sql);
@@ -496,7 +498,7 @@ if (isset($_REQUEST['load_ajax'])) {
                 while($row = Database::fetch_array($res,'ASSOC')) {
                     $id = $row['notebook_id'];
                     if ($update_database) {
-                        $sql = "UPDATE $TBL_NOTEBOOK SET session_id = '$new_session_id' WHERE c_id = $course_id AND notebook_id = $id";
+                        $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id";
                         if ($debug) var_dump($sql);
                         $res = Database::query($sql);
                         if ($debug) var_dump($res);
@@ -581,11 +583,11 @@ $htmlHeadXtra[] = '<script type="text/javascript">
  </script>';
 
 function get_courses_list_by_user_id_based_in_exercises($user_id) {
-    $TABLETRACK_EXERCICES       = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
+    $TABLETRACK_EXERCICES       = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
     $user_id = intval($user_id);
-    //$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, exe_cours_id ORDER by exe_user_id, exe_cours_id ASC";
-    $sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session
-            FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id ORDER by exe_user_id, exe_cours_id ASC";
+    //$sql = "SELECT DISTINCT exe_user_id, c_id, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, c_id ORDER by exe_user_id, c_id ASC";
+    $sql = "SELECT DISTINCT exe_user_id, c_id, session_id as id_session
+            FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id ORDER by exe_user_id, c_id ASC";
 
     $res = Database::query($sql);
     $course_list = array();
@@ -655,6 +657,11 @@ if (!empty($user_list)) {
             if (empty($course_reg['id_session'])) {
                 $course_reg['id_session'] = 0;
             }
+            // Recover the code for historical reasons. If it can be proven
+            // that the code can be safely replaced by c_id in the following
+            // PHP code, feel free to do so
+            $courseInfo = api_get_course_info_by_id($course_reg['c_id']);
+            $course_reg['code'] = $courseInfo['code'];
             $new_course_list[] = $course_reg['code'].'_'.$course_reg['id_session'];
         }
 

+ 2 - 2
main/admin/usergroups.php

@@ -107,7 +107,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'add') {
     $form->addElement('header', get_lang('Add'));
     $form->addElement('text', 'name', get_lang('name'), array('size' => '70', 'id' => 'name'));
     //$form->applyFilter('note_title', 'html_filter');
-    $form->add_html_editor('description', get_lang('Description'), false, false, array('Width' => '95%', 'Height' => '250'));
+    $form->addHtmlEditor('description', get_lang('Description'), false, false, array('Width' => '95%', 'Height' => '250'));
     $form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
 
     // Setting the rules
@@ -147,7 +147,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'add') {
     $form->addElement('header', '', get_lang('Modify'));
     $form->addElement('hidden', 'id', intval($_GET['id']));
     $form->addElement('text', 'name', get_lang('Name'), array('size' => '70'));
-    $form->add_html_editor('description', get_lang('Description'), false, false, array('Width' => '95%', 'Height' => '250'));
+    $form->addHtmlEditor('description', get_lang('Description'), false, false, array('Width' => '95%', 'Height' => '250'));
     $form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
 
     // Setting the defaults

+ 3 - 6
main/announcements/announcements.php

@@ -311,7 +311,7 @@ switch ($action) {
 
         $form->addElement('text', 'title', get_lang('EmailTitle'));
         $form->addElement('hidden', 'id');
-        $form->add_html_editor(
+        $form->addHtmlEditor(
             'content',
             get_lang('Description'),
             false,
@@ -460,7 +460,6 @@ if (!empty($group_id)) {
     $interbreadcrumb[] = array("url"=>"../group/group_space.php?".api_get_cidreq(), "name"=> get_lang('GroupSpace').' '.$group_properties['name']);
 }
 
-
 if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
     //we are not in the learning path
     Display::display_header($nameTools,get_lang('Announcements'));
@@ -478,7 +477,7 @@ if ((api_is_allowed_to_edit(false,true) OR
     (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath')
 ) {
     echo '<div class="actions">';
-    if (isset($_GET['action']) && in_array($_GET['action'], array('add', 'modify','view'))) {
+    if (in_array($action, array('add', 'modify','view'))) {
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
             Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM)."</a>";
     } else {
@@ -487,7 +486,7 @@ if ((api_is_allowed_to_edit(false,true) OR
     }
     $show_actions = true;
 } else {
-    if (in_array($_GET['action'], array('view'))) {
+    if (in_array($action, array('view'))) {
         echo '<div class="actions">';
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
             Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM)."</a>";
@@ -513,8 +512,6 @@ Display::showFlash();
 
 echo $content;
 
-
-/*		FOOTER		*/
 if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
     //we are not in learnpath tool
     Display::display_footer();

+ 3 - 3
main/attendance/attendance_add.php

@@ -28,9 +28,9 @@ $form = new FormValidator('attendance_add','POST','index.php?action=attendance_a
 $form->addElement('header', '', get_lang('CreateANewAttendance'));
 $form->addElement('hidden', 'sec_token', $token);
 
-$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
+$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
 $form->applyFilter('title','html_filter');
-$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));
+$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));
 
 // Adavanced Parameters
 
@@ -54,5 +54,5 @@ if ((api_get_session_id() != 0 && Gradebook::is_active()) || api_get_session_id(
 
     $form->addElement('html','</div>');
 }
-$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+$form->addButtonCreate(get_lang('Save'));
 $form->display();

+ 6 - 5
main/attendance/attendance_calendar.php

@@ -38,12 +38,12 @@ if (!empty($message_information)) {
     Display::display_normal_message($message, false);
 }
 
-if ($error_repeat_date) {
+if (isset($error_repeat_date) && $error_repeat_date) {
     $message = get_lang('EndDateMustBeMoreThanStartDate');
     Display::display_error_message($message, false);
 }
 
-if ($error_checkdate) {
+if (isset($error_checkdate) && $error_checkdate) {
     $message = get_lang('InvalidDate');
     Display::display_error_message($message, false);
 }
@@ -70,13 +70,14 @@ if (isset($action) && $action == 'calendar_add') {
         )
     );
 
-    $defaults['repeat'] = $repeat;
+    $defaults['repeat'] = isset($repeat) ? $repeat : null;
 
-    if ($repeat) {
+    if ($defaults['repeat']) {
         $form->addElement('html', '<div id="repeat-date-attendance" style="display:block">');
     } else {
         $form->addElement('html', '<div id="repeat-date-attendance" style="display:none">');
     }
+
     $a_repeat_type = array(
         'daily' => get_lang('RepeatDaily'),
         'weekly' => get_lang('RepeatWeekly'),
@@ -90,7 +91,7 @@ if (isset($action) && $action == 'calendar_add') {
 
     $defaults['repeat_type'] = 'weekly';
 
-    $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+    $form->addButtonCreate(get_lang('Save'));
     $form->setDefaults($defaults);
     $form->display();
 } else {

+ 3 - 3
main/attendance/attendance_edit.php

@@ -31,9 +31,9 @@ $form->addElement('header', '', get_lang('Edit'));
 $form->addElement('hidden', 'sec_token',$token);
 $form->addElement('hidden', 'attendance_id', $attendance_id);
 
-$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
+$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
 $form->applyFilter('title','html_filter');
-$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
+$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
 
 // Adavanced Parameters
 
@@ -61,7 +61,7 @@ if (Gradebook::is_active()) {
 
     $form->addElement('html','</div>');
 }
-$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+$form->addButtonUpdate(get_lang('Save'));
 
 // set default values
 $default['title'] = Security::remove_XSS($title);

+ 2 - 0
main/attendance/attendance_list.php

@@ -30,6 +30,8 @@ if ($attendance->get_number_of_attendances() == 0) {
     $attendance->set_description(get_lang('Attendances'));
     $attendance->attendance_add();
 }
+$default_column = isset($default_column) ? $default_column : null;
+$parameters = isset($parameters) ? $parameters : null;
 $table = new SortableTable(
     'attendance_list',
     array('Attendance', 'get_number_of_attendances'),

+ 4 - 2
main/attendance/attendance_sheet.php

@@ -30,7 +30,8 @@ if (api_is_allowed_to_edit(null, true) ||
         'post',
         'index.php?action=attendance_sheet_list&' . api_get_cidreq() . $param_gradebook . '&attendance_id=' . $attendance_id,
         null,
-        array('class' => 'form-search pull-left')
+        array(),
+        FormValidator::LAYOUT_INLINE
     );
 
     $values = array(
@@ -57,7 +58,7 @@ if (api_is_allowed_to_edit(null, true) ||
     }
 
     $form->addElement('select', 'filter', get_lang('Filter'), $values, array('id' => 'filter_id'));
-    $form->addElement('style_submit_button', null, get_lang('Filter'), 'class="filter"');
+    $form->addButtonFilter(get_lang('Filter'));
 
     if (isset($_REQUEST['filter'])) {
         if (in_array($_REQUEST['filter'], array_keys($values))) {
@@ -232,6 +233,7 @@ if (api_is_allowed_to_edit(null, true) ||
                 echo '<div class="divTableWithFloatingHeader attendance-calendar-table" style="margin:0px;padding:0px;float:left;width:55%;overflow:auto;overflow-y:hidden;">';
                 echo '<table class="tableWithFloatingHeader data_table" width="100%">';
                 echo '<thead>';
+                $result = null;
                 if (count($attendant_calendar) > 0 ) {
                     foreach ($attendant_calendar as $calendar) {
                         $date = $calendar['date'];

+ 0 - 1
main/attendance/index.php

@@ -10,7 +10,6 @@
  */
 // name of the language file that needs to be included
 $language_file = array(
-    'course_description',
     'course_info',
     'userInfo',
     'admin',

+ 5 - 5
main/auth/inscription.php

@@ -182,22 +182,22 @@ if ($user_already_registered_show_terms == false) {
     if (api_get_setting('extended_profile') == 'true' &&
         api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true'
     ) {
-        $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' &&
         api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true'
     ) {
-        $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' &&
         api_get_setting('extendedprofile_registration', 'myteach') == 'true'
     ) {
-        $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true' &&
         api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true'
     ) {
-        $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
+        $form->addHtmlEditor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
     }
     if (api_get_setting('extended_profile') == 'true') {
         if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' &&
@@ -365,7 +365,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
     }
 }
 
-$form->addElement('button', 'submit', get_lang('RegisterUser'), array('class' => 'btn btn-primary btn-large'));
+$form->addButtonCreate(get_lang('RegisterUser'));
 
 if ($form->validate()) {
     $values = $form->getSubmitValues(1);

+ 1 - 1
main/auth/lostPassword.php

@@ -84,7 +84,7 @@ if (isset($_GET['reset']) && isset($_GET['id'])) {
 	$form = new FormValidator('lost_password');
     $form->addElement('header', $tool_name);
 	$form->addElement('text', 'user', array(get_lang('LoginOrEmailAddress'), get_lang('EnterEmailUserAndWellSendYouPassword')), array('size'=>'40'));
-	$form->addElement('style_submit_button', 'submit', get_lang('Send'),'class="btn"');
+	$form->addButtonSend(get_lang('Send'));
 
 	// Setting the rules
 	$form->addRule('user', get_lang('ThisFieldIsRequired'), 'required');

+ 3 - 2
main/auth/openid/login.php

@@ -20,9 +20,10 @@ require_once 'xrds.lib.php';
 
 function openid_form() {
     //get_lang('OpenIdAuthentication')
+
     $form = new FormValidator('openid_login', 'post', null, null, array('class' => 'form-vertical form_login'));
-    $form->addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
-    $form->addElement('button', 'submit', get_lang('Login'));
+    $form -> addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
+    $form -> addElement('button', 'submit', get_lang('Login'));
     return $form->return_form();
     /*
       return '<label for="openid_url">'.get_lang('OpenIDURL').' <a href="main/auth/openid/whatis.php" title="'.get_lang('OpenIDWhatIs').'">'.Display::return_icon('info3.gif',get_lang('Info')).'</a></label>

+ 8 - 8
main/auth/profile.php

@@ -219,7 +219,7 @@ if (api_get_setting('profile', 'language') !== 'true') {
 
 //THEME
 if (is_profile_editable() && api_get_setting('user_selected_theme') == 'true') {
-    $form->addElement('select_theme', 'theme', get_lang('Theme'));
+    $form->addElement('SelectTheme', 'theme', get_lang('Theme'));
     if (api_get_setting('profile', 'theme') !== 'true') {
         $form->freeze('theme');
     }
@@ -233,11 +233,11 @@ if (api_get_setting('extended_profile') == 'true') {
     //$form->addElement('html', '<a href="javascript: void(0);" onclick="javascript: show_extend();"> show_extend_profile</a>');
     //$form->addElement('static', null, '<em>'.get_lang('OptionalTextFields').'</em>');
     //    MY COMPETENCES
-    $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
+    $form->addHtmlEditor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
     //    MY DIPLOMAS
-    $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
+    $form->addHtmlEditor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
     //    WHAT I AM ABLE TO TEACH
-    $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
+    $form->addHtmlEditor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130'));
 
     //    MY PRODUCTIONS
     $form->addElement('file', 'production', get_lang('MyProductions'));
@@ -245,7 +245,7 @@ if (api_get_setting('extended_profile') == 'true') {
         $form->addElement('static', 'productions_list', null, $production_list);
     }
     //    MY PERSONAL OPEN AREA
-    $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '350'));
+    $form->addHtmlEditor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '350'));
     $form->applyFilter(array('competences', 'diplomas', 'teach', 'openarea'), 'stripslashes');
     $form->applyFilter(array('competences', 'diplomas', 'teach'), 'trim'); // openarea is untrimmed for maximum openness
 
@@ -287,7 +287,7 @@ if (api_get_setting('profile', 'apikeys') == 'true') {
 }
 //    SUBMIT
 if (is_profile_editable()) {
-    $form->addElement('style_submit_button', 'apply_change', get_lang('SaveSettings'), 'class="save"');
+    $form->addButtonUpdate(get_lang('SaveSettings'), 'apply_change');
 } else {
     $form->freeze();
 }
@@ -725,10 +725,10 @@ $show_delete_account_button = api_get_setting('platform_unsubscribe_allowed') ==
 
 if (api_get_setting('allow_social_tool') == 'true') {
     echo '<div class="row-fluid">';
-        echo '<div class="span3">';
+        echo '<div class="col-md-3">';
         echo SocialManager::show_social_menu('home', null, api_get_user_id(), false, $show_delete_account_button);
         echo '</div>';
-        echo '<div class="span9">';
+        echo '<div class="col-md-9">';
         $form->display();
     echo '</div>';
 } else {

+ 1 - 1
main/calendar/agenda.inc.php

@@ -257,7 +257,7 @@ function get_calendar_items($select_month, $select_year, $select_day = false)
 
     //Check my personal calendar items
     if (api_get_setting('allow_personal_agenda') == 'true' && empty($_SESSION['user']) && empty($_SESSION['group'])) {
-        $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+        $tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
         // 1. creating the SQL statement for getting the personal agenda items in MONTH view
         $sql = "SELECT id, title, text as content , date as start_date, enddate as end_date, parent_event_id FROM ".$tbl_personal_agenda."
                 WHERE user='".api_get_user_id()."' ".$show_all_current_personal;

+ 1 - 1
main/calendar/agenda_js.php

@@ -138,7 +138,7 @@ $tpl->assign('button_text',
 
 //see http://docs.jquery.com/UI/Datepicker/$.datepicker.formatDate
 
-$tpl->assign('js_format_date', 'D d M yy');
+$tpl->assign('js_format_date', 'll');
 $region_value = api_get_language_isocode();
 
 if ($region_value == 'en') {

+ 1 - 1
main/calendar/agenda_list.php

@@ -17,7 +17,7 @@ $interbreadcrumb[] = array(
 
 $agenda = new Agenda();
 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
-$agenda->type = $type;
+$agenda->setType($type);
 $events = $agenda->get_events(
     null,
     null,

+ 5 - 5
main/calendar/myagenda.inc.php

@@ -331,7 +331,7 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) {
  */
 function store_personal_item($day, $month, $year, $hour, $minute, $title, $content, $id = "") {
 
-	$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+	$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 
 	//constructing the date
 	$date = $year."-".$month."-".$day." ".$hour.":".$minute.":00";
@@ -415,7 +415,7 @@ function get_courses_of_user() {
  * This function retrieves all the personal agenda items and add them to the agenda items found by the other functions.
  */
 function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) {
-	$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+	$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 	$user_id = intval($user_id);
 
 	// 1. creating the SQL statement for getting the personal agenda items in MONTH view
@@ -517,7 +517,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "
  * @return 	array	The results of the database query, or null if not found
  */
 function get_personal_agenda_item($id) {
-	$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+	$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 	$id = intval($id);
 	// make sure events of the personal agenda can only be seen by the user himself
 	$user = api_get_user_id();
@@ -537,7 +537,7 @@ function get_personal_agenda_item($id) {
 function show_personal_agenda() {
 	global $MonthsLong, $charset;
 
-	$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+	$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 
 	// The SQL statement that retrieves all the personal agenda items of this user
 	$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ORDER BY date DESC";
@@ -641,7 +641,7 @@ function show_personal_agenda() {
 function show_simple_personal_agenda($user_id) {
 	global $MonthsLong, $charset;
 
-	$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+	$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 
 	// The SQL statement that retrieves all the personal agenda items of this user
 	$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' ORDER BY date DESC";

+ 1 - 1
main/calendar/myagenda.php

@@ -62,7 +62,7 @@ $TABLECOURS 		= Database :: get_main_table(TABLE_MAIN_COURSE);
 $TABLECOURSUSER 	= Database :: get_main_table(TABLE_MAIN_COURSE_USER);
 $TABLEAGENDA 		= Database :: get_course_table(TABLE_AGENDA);
 $TABLE_ITEMPROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
-$tbl_personal_agenda= Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
+$tbl_personal_agenda= Database :: get_main_table(TABLE_PERSONAL_AGENDA);
 
 // the variables for the days and the months
 // Defining the shorts for the days

+ 3 - 3
main/course_description/add.php

@@ -52,10 +52,10 @@ $form = new FormValidator('course_description','POST','index.php?action=add&'.ap
 $form->addElement('header', '', $header);
 $form->addElement('hidden', 'description_type',$description_type);
 $form->addElement('hidden', 'sec_token',$token);
-$form->add_textfield('title', get_lang('Title'), true, array('size'=>'width: 350px;'));
+$form->addText('title', get_lang('Title'), true, array('size'=>'width: 350px;'));
 $form->applyFilter('title','html_filter');
-$form->add_html_editor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
-$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+$form->addHtmlEditor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
+$form->addButtonCreate(get_lang('Save'));
 
 // display default questions
 if (isset ($question[$description_type])) {

+ 62 - 62
main/course_description/course_description.class.php

@@ -3,42 +3,42 @@
 namespace CourseDescription;
 
 /**
- * Object Model for the "Course Description" database table. Allows to 
- * 
+ * Object Model for the "Course Description" database table. Allows to
+ *
  *      - query database
  *      - create/insert new course descriptions
  *      - update/edit course descriptions
  *      - delete course descriptions
- * 
- * Course descriptions used to provide descriptions for course/sessions. 
+ *
+ * Course descriptions used to provide descriptions for course/sessions.
  * A course/session can have several descriptions associated to it from various types.
  * Course descriptions are primarily made primarily of
- * 
+ *
  *      - a title
  *      - some content
  *      - a type (for ex: info, objectives, etc)
- * 
+ *
  * Usage:
- *      
+ *
  *      Create
- * 
+ *
  *      $des = new CourseDescription();
  *      $des->set_title('...');
  *      $des->set_content('...');
  *      $des->set_description_type(...);
  *      $des->insert();
- * 
+ *
  *      Update
- * 
+ *
  *      $des = CourseDescription::get_by_id(..., ...);
  *      $des->set_title('...');
  *      $des->update();
- * 
+ *
  *      Delete
- * 
+ *
  *      $des = CourseDescription::get_by_id(..., ...);
  *      $des->delete();
- * 
+ *
  * @package chamilo.course_description
  * @author Christian Fasanando <christian1827@gmail.com>
  * @author Laurent Opprecht <laurent@opprecht.info> for the University of Geneva
@@ -49,8 +49,8 @@ class CourseDescription
 
     /**
      * Return the repository.
-     * 
-     * @return \CourseDescription\CourseDescriptionRepository 
+     *
+     * @return \CourseDescription\CourseDescriptionRepository
      */
     public static function repository()
     {
@@ -59,7 +59,7 @@ class CourseDescription
 
     /**
      * Returns the list of all available types
-     * 
+     *
      * @return array
      */
     public static function get_types()
@@ -69,7 +69,7 @@ class CourseDescription
 
 //    /**
 //     * Deprecated (still used by web services)
-//     * 
+//     *
 //     * @param int Course id
 //     * @deprecated use get_descriptions_by_course
 //     * @return array Array of CourseDescriptions
@@ -153,7 +153,7 @@ class CourseDescription
 
 //    /**
 //     * Insert the course description object into the course_description table.
-//     * 
+//     *
 //     * @return bool True on success, false on failure
 //     */
 //    public function insert()
@@ -168,11 +168,11 @@ class CourseDescription
 //
 //        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
 //        $sql = "INSERT IGNORE INTO $table SET
-//				c_id 				= $course_id, 
-//				description_type	= $description_type, 
-//				title 				= '$title', 
-//				content 			= '$content', 
-//				progress 			= $progress, 
+//				c_id 				= $course_id,
+//				description_type	= $description_type,
+//				title 				= '$title',
+//				content 			= '$content',
+//				progress 			= $progress,
 //				session_id          = $session_id";
 //
 //        Database::query($sql);
@@ -184,7 +184,7 @@ class CourseDescription
 //        $this->id = $id;
 //
 //        /**
-//         * @todo: course info should come from c_id 
+//         * @todo: course info should come from c_id
 //         */
 //        api_item_property_update(api_get_course_info(), TOOL_COURSE_DESCRIPTION, $id, 'CourseDescriptionAdded', api_get_user_id());
 //
@@ -192,13 +192,13 @@ class CourseDescription
 //    }
 //    /**
 //     * Insert a row like history inside track_e_item_property table
-//     * 
+//     *
 //     * @param 	int 	description type
 //     * @return  int		affected rows
 //     */
 //    public function insert_stats($description_type)
 //    {
-//        $tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
+//        $tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
 //        $description_id = $this->get_id_by_description_type($description_type);
 //        $course_id = api_get_real_course_id();
 //        $course_code = api_get_course_id();
@@ -219,7 +219,7 @@ class CourseDescription
 //    }
 //    /**
 //     * Update a course description object to the database.
-//     * 
+//     *
 //     * @return bool True on success, false on failure.
 //     */
 //    public function update()
@@ -234,11 +234,11 @@ class CourseDescription
 //        $session_id = $this->get_session_id();
 //
 //        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
-//        $sql = "UPDATE $table SET  
-//						title       = '$title', 
-//						content     = '$content', 
-//						progress    = $progress 
-//				WHERE 	id          = $id AND 
+//        $sql = "UPDATE $table SET
+//						title       = '$title',
+//						content     = '$content',
+//						progress    = $progress
+//				WHERE 	id          = $id AND
 //						c_id = $course_id ";
 //
 //        Database::query($sql);
@@ -247,7 +247,7 @@ class CourseDescription
 //        if ($result) {
 //            //insert into item_property
 //            /**
-//             * @todo: course info should come from c_id 
+//             * @todo: course info should come from c_id
 //             */
 //            api_item_property_update(api_get_course_info(), TOOL_COURSE_DESCRIPTION, $this->id, 'CourseDescriptionUpdated', api_get_user_id());
 //        }
@@ -255,7 +255,7 @@ class CourseDescription
 //    }
 //    /**
 //     * Delete a course description object from the database.
-//     * 
+//     *
 //     * @return bool True on success false on failure
 //     */
 //    public function delete()
@@ -269,7 +269,7 @@ class CourseDescription
 //        $result = (bool) Database::affected_rows();
 //        if ($result) {
 //            /**
-//             * @todo: should get course info from $this->c_id 
+//             * @todo: should get course info from $this->c_id
 //             */
 //            api_item_property_update(api_get_course_info(), TOOL_COURSE_DESCRIPTION, $this->id, 'CourseDescriptionDeleted', api_get_user_id());
 //        }
@@ -341,8 +341,8 @@ class CourseDescription
 //    }
 
     /**
-     * The course id. 
-     * 
+     * The course id.
+     *
      * @see get_course() property to get access to the course object
      * @return int
      */
@@ -361,7 +361,7 @@ class CourseDescription
 
     /**
      * The id of the object.
-     * 
+     *
      * @return int
      */
     public function get_id()
@@ -370,7 +370,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_id($value)
@@ -380,7 +380,7 @@ class CourseDescription
 
     /**
      * The title of the course description.
-     * 
+     *
      * @return string
      */
     public function get_title()
@@ -389,7 +389,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_title($title)
@@ -407,7 +407,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_content($content)
@@ -417,7 +417,7 @@ class CourseDescription
 
     /**
      * The session id the object is associated with.
-     * 
+     *
      * @return int
      */
     public function get_session_id()
@@ -426,7 +426,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_session_id($value)
@@ -437,7 +437,7 @@ class CourseDescription
     /**
      * The type of the course description. Should match one of the id returns
      * by CourseDescription::get_types().
-     * 
+     *
      * @return int
      */
     public function get_description_type()
@@ -446,7 +446,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_description_type($value)
@@ -464,7 +464,7 @@ class CourseDescription
     }
 
     /**
-     * 
+     *
      * @return void
      */
     public function set_progress($value)
@@ -474,8 +474,8 @@ class CourseDescription
 
     /**
      * Return one type from its id
-     * 
-     * @return \CourseDescription\CourseDescriptionType 
+     *
+     * @return \CourseDescription\CourseDescriptionType
      */
     public function get_type()
     {
@@ -504,7 +504,7 @@ class CourseDescription
 
     /**
      * The item property this object is associated with.
-     * 
+     *
      * @return \Model\ItemProperty
      */
     public function get_item_property()
@@ -521,12 +521,12 @@ class CourseDescription
 
 //
 ///**
-// * The common routes (urls) for course description objects: 
-// * 
+// * The common routes (urls) for course description objects:
+// *
 // *      - create new course description
 // *      - edit course description
-// *      - delete course description 
-// * 
+// *      - delete course description
+// *
 // * @author Laurent Opprecht <laurent@opprecht.info> for the University of Geneva
 // * @licence /license.txt
 // */
@@ -535,7 +535,7 @@ class CourseDescription
 //
 //    /**
 //     *
-//     * @return CourseDescriptionRoutes 
+//     * @return CourseDescriptionRoutes
 //     */
 //    public static function instance()
 //    {
@@ -553,7 +553,7 @@ class CourseDescription
 //
 //    /**
 //     * Returns the url used to create a new course description from a specific type.
-//     * 
+//     *
 //     * @param CourseDescriptionType $type
 //     * @param bool $html True to html escape the url, false otherwise.
 //     * @return string
@@ -573,10 +573,10 @@ class CourseDescription
 //
 //    /**
 //     * The url to edit a course description object
-//     * 
+//     *
 //     * @param CourseDescription $description
 //     * @param bool $html True to html escape the url, false otherwise.
-//     * @return string  
+//     * @return string
 //     */
 //    function edit($description, $html = true)
 //    {
@@ -592,9 +592,9 @@ class CourseDescription
 //
 //    /**
 //     * The index route to list all course descriptions for the current course/session
-//     * 
+//     *
 //     * @param bool $html True to html escape the url, false otherwise.
-//     * @return type 
+//     * @return type
 //     */
 //    function index($html = true)
 //    {
@@ -605,10 +605,10 @@ class CourseDescription
 //
 //    /**
 //     * Url to delete a course description object.
-//     * 
+//     *
 //     * @param CourseDescription $description
 //     * @param bool $html True to html escape the url, false otherwise.
-//     * @return string  
+//     * @return string
 //     */
 //    function delete($description, $html = true)
 //    {

+ 3 - 3
main/course_description/course_description_form.class.php

@@ -74,10 +74,10 @@ class CourseDescriptionForm extends \FormValidator
         $this->addHidden('description_type', $description->get_description_type());
         $this->addHidden('c_id', $description->c_id);
         $this->addHidden('id', $description->id);
-        $this->add_textfield('title', get_lang('Title'), true, array('size' => 'width: 350px;'));
+        $this->addText('title', get_lang('Title'), true, array('size' => 'width: 350px;'));
         $this->applyFilter('title', 'html_filter');
-        $this->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
-        $this->addButton('save', get_lang('Save'), 'class="save"');
+        $this->addHtmlEditor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
+        $this->addButton('save', get_lang('Save'));
 
         $this->setDefaults($defaults);
     }

+ 3 - 3
main/course_description/edit.php

@@ -56,10 +56,10 @@ $form->addElement('header','',$header);
 $form->addElement('hidden', 'id', $original_id);
 $form->addElement('hidden', 'description_type',$description_type);
 $form->addElement('hidden', 'sec_token',$token);
-$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
+$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
 $form->applyFilter('title','html_filter');
-$form->add_html_editor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
-$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
+$form->addHtmlEditor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
+$form->addButtonCreate(get_lang('Save'));
 
 // Set some default values
 if (!empty($description_title)) {

+ 4 - 3
main/course_description/listing.php

@@ -53,7 +53,8 @@ $user_info = api_get_user_info();
 if (isset($descriptions) && count($descriptions) > 0) {
 	foreach ($descriptions as $id => $description) {
         if (!empty($description)) {
-            echo '<div class="sectiontitle">';
+            echo '<div class="panel panel-info">';
+            echo '<div class="panel-heading">';
 
             if (api_is_allowed_to_edit(null,true) && !$history) {
                 if (api_get_session_id() == $description['session_id']) {
@@ -75,9 +76,9 @@ if (isset($descriptions) && count($descriptions) > 0) {
 
             echo $description['title'];
             echo '</div>';
-            echo '<div class="sectioncomment">';
+            echo '<div class="panel-body">';
             echo $description['content'];
-            echo '</div>';
+            echo '</div></div>';
         }
     }
 } else {

+ 3 - 3
main/course_description/upload_file_form.class.php

@@ -36,11 +36,11 @@ class UploadFileForm extends \FormValidator
         $this->addHeader($form_name);
 
         $label = get_lang('File');
-        $this->add_file('file', $label);
+        $this->addFile('file', $label);
         $this->addRule('file', get_lang('ThisFieldIsRequired'), 'required');
         //$this->add_checkbox('replace', '', get_lang('ReplaceExistingEntries'));
 
-        $this->addButton('save', get_lang('Save'), array('class' => 'btn save'));
+        $this->addButton('save', get_lang('Save'));
 
 //        $label = get_lang('CSVMustLookLike');
 //        $label = "<h4>$label</h4>";
@@ -51,7 +51,7 @@ class UploadFileForm extends \FormValidator
 //                    "http://mail.google.com";"Google";"";"_self";"Google";""
 //                    </pre>';
 //
-//        $this->add_html($label . $help);
+//        $this->addHtml($label . $help);
     }
 
     /**

+ 5 - 5
main/course_home/activity.php

@@ -66,12 +66,12 @@ if ($enabled == 'true') {
 
 // Start of tools for CourseAdmins (teachers/tutors)
 if ($session_id == 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) {
-    $content .=  '<div class="courseadminview" style="border:0px; margin-top: 0px;padding:0px;">
+    $content .=  '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">
 		<div class="normal-message" id="id_normal_message" style="display:none">';
     $content .=  '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
     $content .=  get_lang('PleaseStandBy');
     $content .=  '</div>
-		<div class="confirmation-message" id="id_confirmation_message" style="display:none"></div>
+		<div class="alert alert-success" id="id_confirmation_message" style="display:none"></div>
 	</div>';
 
     $content .= $pluginExtra;
@@ -190,9 +190,9 @@ if ($session_id == 0 && api_is_course_admin() && api_is_allowed_to_edit(null, tr
 function return_block($title, $content, $class = null)
 {
     $html = '<div class="row course-title-tools">
-                <div class="span12">
-                    <div class="page-header">
-                        <h3>'.$title.'</h3>
+                <div class="col-md-12">
+                    <div class="title-header-tools">
+                        <h4>'.$title.'</h4>
                     </div>
                 </div>
             </div>

+ 6 - 6
main/course_info/infocours.php

@@ -125,18 +125,18 @@ 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->addText('title', get_lang('Title'), true, array('class' => 'span6'));
 $form->applyFilter('title', 'html_filter');
 $form->applyFilter('title', 'trim');
 
 $form->addElement('select', 'category_code', get_lang('Fac'), $categories, array('style'=>'width:350px', 'class'=>'chzn-select', 'id'=>'category_code'));
 $form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang')));
 
-$form->add_textfield('department_name', get_lang('Department'), false, array('class' => 'span5'));
+$form->addText('department_name', get_lang('Department'), false, array('class' => 'span5'));
 $form->applyFilter('department_name', 'html_filter');
 $form->applyFilter('department_name', 'trim');
 
-$form->add_textfield('department_url', get_lang('DepartmentUrl'), false, array('class' => 'span5'));
+$form->addText('department_url', get_lang('DepartmentUrl'), false, array('class' => 'span5'));
 $form->applyFilter('department_url', 'html_filter');
 
 // Picture
@@ -148,7 +148,7 @@ $form->addElement('checkbox', 'delete_picture', null, get_lang('DeletePicture'))
 
 if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
     $url =  PDF::get_watermark($course_code);
-    $form->add_textfield('pdf_export_watermark_text', get_lang('PDFExportWatermarkTextTitle'), false, array('size' => '60'));
+    $form->addText('pdf_export_watermark_text', get_lang('PDFExportWatermarkTextTitle'), false, array('size' => '60'));
     $form->addElement('file', 'pdf_export_watermark_path', get_lang('AddWaterMark'));
     if ($url != false) {
         $delete_url = '<a href="?delete_watermark">'.Display::return_icon('delete.png',get_lang('DelImage')).'</a>';
@@ -158,7 +158,7 @@ if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
 }
 
 $group = array();
-$group[]=$form->createElement('select_theme', 'course_theme', null, array('class'=>' ', 'id'=>'course_theme_id'));
+$group[]=$form->createElement('SelectTheme', 'course_theme', null, array('class'=>' ', 'id'=>'course_theme_id'));
 $form->addGroup($group, '', array(get_lang("Stylesheets")), '');
 
 $form->addElement('label', get_lang('DocumentQuota'), format_file_size(DocumentManager::get_course_quota()));
@@ -195,7 +195,7 @@ $group[]=$form->createElement('radio', 'unsubscribe', get_lang('Unsubscription')
 $group[]=$form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0);
 $form->addGroup($group, '', array(get_lang("Unsubscription")), '');
 
-$form->add_textfield('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60'));
+$form->addText('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60'));
 
 $form->addElement('checkbox', 'activate_legal', array(null, get_lang('ShowALegalNoticeWhenEnteringTheCourse')), get_lang('ActivateLegal'));
 $form->addElement('textarea', 'legal', get_lang('CourseLegalAgreement'), array('class'=>'span6', 'rows' => 8));

+ 2 - 2
main/course_progress/thematic.php

@@ -252,8 +252,8 @@ if ($action == 'thematic_list') {
 		$form->addElement('hidden', 'thematic_id',$thematic_id);
 	}
 
-	$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
-	$form->add_html_editor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
+	$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
+	$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
 	$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
 
     $show_form = true;

+ 3 - 4
main/course_progress/thematic_advance.php

@@ -47,7 +47,7 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
         $form->addElement('html', '<div id="div_custom_datetime" style="display:none">');
     }
 
-    $form->addElement('DatePicker', 'custom_start_date', get_lang('StartDate'), array('form_name'=>'thematic_advance'));
+    $form->addElement('DatePicker', 'custom_start_date', get_lang('StartDate'));
     $form->addElement('html', '</div>');
 
     if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) {
@@ -70,9 +70,9 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
 
     $form->addElement('html', '</div>');
 
-    $form->add_textfield('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3','id'=>'duration_in_hours_element', 'autofocus' => 'autofocus'));
+    $form->addText('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3','id'=>'duration_in_hours_element', 'autofocus' => 'autofocus'));
 
-    $form->add_html_editor('content', get_lang('Content'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
+    $form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
     //$form->addElement('textarea', 'content', get_lang('Content'));
 
     if ($action == 'thematic_advance_add') {
@@ -99,7 +99,6 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
             } else {
                 echo '<script> datetime_by_attendance("'.$attendance_select_item_id.'", 0); </script>';
             }
-
         }
     }
 

+ 4 - 4
main/course_progress/thematic_plan.php

@@ -40,8 +40,8 @@ if ($action == 'thematic_plan_list') {
 
         foreach ($default_thematic_plan_title as $id => $title) {
             $form->addElement('hidden', 'description_type['.$id.']', $id);
-            $form->add_textfield('title['.$id.']', get_lang('Title'), false, array('size'=>'50'));
-            $form->add_html_editor('description['.$id.']', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
+            $form->addText('title['.$id.']', get_lang('Title'), false, array('size'=>'50'));
+            $form->addHtmlEditor('description['.$id.']', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
             //$form->addElement('textarea', 'description['.$id.']', get_lang('Description'));
             if (!empty($thematic_simple_list) && in_array($id, $thematic_simple_list)) {
                 $thematic_plan = $new_thematic_plan_data[$id];
@@ -82,8 +82,8 @@ if ($action == 'thematic_plan_list') {
 		$form->addElement('hidden', 'description_type', $description_type);
 	}
 
-	$form->add_textfield('title', get_lang('Title'), true, array('size'=>'50'));
-	$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
+	$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
+	$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
 	//$form->addElement('html','<div class="clear" style="margin-top:50px;"></div>');
 	$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
 

+ 1 - 1
main/coursecopy/classes/CourseBuilder.class.php

@@ -1055,7 +1055,7 @@ class CourseBuilder
     {
         $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
         $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
-        $list_course = Database::get_course_list();
+        $list_course = CourseManager::get_course_list();
         $list = array();
         foreach($list_course as $_course) {
             $this->course = new Course();

+ 14 - 15
main/coursecopy/classes/CourseRestorer.class.php

@@ -1131,7 +1131,7 @@ class CourseRestorer
 			$table = Database :: get_course_table(TABLE_AGENDA);
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_EVENT] as $id => $event) {
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $event->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $event->content,
                     $this->course->code,
@@ -1208,7 +1208,7 @@ class CourseRestorer
 					$course_destination=$this->course->destination_path;
 				}
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $description_content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $cd->content,
                     $this->course->code,
@@ -1240,7 +1240,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_ANNOUNCEMENT] as $id => $announcement) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $announcement->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $announcement->content,
                     $this->course->code,
@@ -1342,7 +1342,7 @@ class CourseRestorer
 				}
 
 				if ($id != -1) {
-					// check resources inside html from fckeditor tool and copy correct urls into recipient course
+					// check resources inside html from ckeditor tool and copy correct urls into recipient course
                     $quiz->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                         $quiz->description,
                         $this->course->code,
@@ -1438,7 +1438,7 @@ class CourseRestorer
 			$table_ans 		= Database::get_course_table(TABLE_QUIZ_ANSWER);
             $table_options	= Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
 
-			// check resources inside html from fckeditor tool and copy correct urls into recipient course
+			// check resources inside html from ckeditor tool and copy correct urls into recipient course
             $question->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                 $question->description,
                 $this->course->code,
@@ -1513,7 +1513,7 @@ class CourseRestorer
                 $correct_answers = array();
 				foreach ($question->answers as $index => $answer) {
 
-					// check resources inside html from fckeditor tool and copy correct urls into recipient course
+					// check resources inside html from ckeditor tool and copy correct urls into recipient course
                     $answer['answer'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                         $answer['answer'],
                         $this->course->code,
@@ -1717,7 +1717,7 @@ class CourseRestorer
 
 				$result_check = Database::query($sql_check);
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $survey->title = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $survey->title,
                     $this->course->code,
@@ -1823,7 +1823,6 @@ class CourseRestorer
 						case FILE_OVERWRITE:
 							// Delete the existing survey with the same code and language and import the one of the source course
 							// getting the information of the survey (used for when the survey is shared)
-							require_once(api_get_path(SYS_CODE_PATH).'survey/survey.lib.php');
 
 							$sql_select_existing_survey = "SELECT * FROM $table_sur WHERE c_id = ".$this->destination_course_id." AND survey_id='".self::DBUTF8escapestring(Database::result($result_check,0,0))."'";
 							$result = Database::query($sql_select_existing_survey);
@@ -1902,7 +1901,7 @@ class CourseRestorer
 			$table_que = Database :: get_course_table(TABLE_SURVEY_QUESTION);
 			$table_ans = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
 
-			// check resources inside html from fckeditor tool and copy correct urls into recipient course
+			// check resources inside html from ckeditor tool and copy correct urls into recipient course
             $question->survey_question = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                 $question->survey_question,
                 $this->course->code,
@@ -1927,7 +1926,7 @@ class CourseRestorer
 			$new_id = Database::insert_id();
 			foreach ($question->answers as $index => $answer) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $answer['option_text'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $answer['option_text'],
                     $this->course->code,
@@ -2376,7 +2375,7 @@ class CourseRestorer
     				$condition_session = " , session_id = '$session_id' ";
     			}
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $glossary->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $glossary->description,
                     $this->course->code,
@@ -2429,7 +2428,7 @@ class CourseRestorer
 			foreach ($resources[RESOURCE_WIKI] as $id => $wiki) {
 				// the sql statement to insert the groups from the old course to the new course
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $wiki->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $wiki->content,
                     $this->course->code,
@@ -2478,7 +2477,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_THEMATIC] as $id => $thematic) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $thematic->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $thematic->content,
                     $this->course->code,
@@ -2533,7 +2532,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_ATTENDANCE] as $id => $obj) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $obj->params['description'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $obj->params['description'],
                     $this->course->code,
@@ -2576,7 +2575,7 @@ class CourseRestorer
             $resources = $this->course->resources;
             foreach ($resources[RESOURCE_WORK] as $obj) {
 
-                // check resources inside html from fckeditor tool and copy correct urls into recipient course
+                // check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $obj->params['description'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $obj->params['description'],
                     $this->course->code,

+ 1 - 1
main/coursecopy/classes/DummyCourseCreator.class.php

@@ -43,7 +43,7 @@ class DummyCourseCreator
 		$this->default_property['start_visible'] = '0000-00-00 00:00:00';
 		$this->default_property['end_visible'] =  '0000-00-00 00:00:00';
 
-		$course = Database::get_course_info($course_code);
+		$course = api_get_course_info($course_code);
 		$this->course = new Course();
 		$tmp_path = api_get_path(SYS_COURSE_PATH).$course['directory'].'/document/tmp_'.uniqid('');
 		@mkdir($tmp_path, api_get_permissions_for_new_directories(), true);

+ 1 - 1
main/coursecopy/copy_course_session.php

@@ -138,7 +138,7 @@ function display_form()
 function search_courses($id_session, $type)
 {
     global $tbl_course, $tbl_session_rel_course, $course_list;
-    $xajax_response = new XajaxResponse();
+    $xajax_response = new xajaxResponse();
     $select_destination = '';
     $return = null;
 

+ 1 - 1
main/coursecopy/copy_course_session_selected.php

@@ -195,7 +195,7 @@ function displayForm()
 
 function searchCourses($idSession, $type)
 {
-    $xajaxResponse = new XajaxResponse();
+    $xajaxResponse = new xajaxResponse();
     $return = null;
     $courseCode = api_get_course_id();
 

+ 2 - 2
main/create_course/add_course.php

@@ -98,7 +98,7 @@ $form->addElement(
 );
 
 // Course code
-$form->add_textfield('wanted_code', array(get_lang('Code'), get_lang('OnlyLettersAndNumbers')), '', array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE));
+$form->addText('wanted_code', array(get_lang('Code'), get_lang('OnlyLettersAndNumbers')), '', array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE));
 $form->applyFilter('wanted_code', 'html_filter');
 $form->addRule('wanted_code', get_lang('Max'), 'maxlength', CourseManager::MAX_COURSE_LENGTH_CODE);
 
@@ -156,7 +156,7 @@ $obj->fill_grade_model_select_in_form($form);
 $form->addElement('html','</div>');
 
 // Submit button.
-$form->addElement('button', 'submit', $course_validation_feature ? get_lang('CreateThisCourseRequest') : get_lang('CreateCourseArea'), 'class="add"');
+$form->addButtonCreate($course_validation_feature ? get_lang('CreateThisCourseRequest') : get_lang('CreateCourseArea'));
 
 // The progress bar of this form.
 $form->add_progress_bar();

+ 94 - 0
main/cron/create_course_sessions.php

@@ -0,0 +1,94 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ * Create course sessions procedure. It creates sessions for courses that haven't it yet.
+ * If today is greater than OFFSET, it will create them also for the next month.
+ * @package chamilo.cron
+ * @author Imanol Losada <imanol.losada@beeznest.com>
+ */
+
+/**
+ * Initialization
+ */
+if (php_sapi_name() != 'cli') {
+    exit; //do not run from browser
+}
+
+require_once __DIR__ . "/../inc/global.inc.php";
+
+// First day of the current month to create sessions and add courses for the next month (e.g. "07")
+define("OFFSET", "15");
+/**
+ * If no $initialDate is supplied, returns an array with the first and last days of the current
+ * month. Otherwise, returns an array with the first and last days of the $initialDate month .
+ * @param   array   First day of the month
+ * @return  array   First and last days of the month
+ */
+function getMonthFirstAndLastDates($initialDate = null) {
+    $startDate = $initialDate ? $initialDate : date("Y-m-01");
+    $nextMonthStartDate = date("Y-m-d", api_strtotime($startDate." + 1 month"));
+    $endDate = date("Y-m-d", api_strtotime($nextMonthStartDate." - 1 minute"));
+    return array('startDate' => $startDate, 'endDate' => $endDate);
+}
+
+/**
+ * Creates one session per course with $administratorId as the creator and
+ * adds it to the session starting on $startDate and finishing on $endDate
+ * @param   array   Courses
+ * @param   int     Administrator id
+ * @param   date    First day of the month
+ * @param   date    Last day of the month
+ * @return  void
+ */
+function createCourseSessions($courses, $administratorId, $startDate, $endDate) {
+    echo "\n";
+    echo $courses ?
+        "Creating sessions and adding courses for the period between ".$startDate." and ".$endDate :
+        "Every course is already in session for the period between ".$startDate." and ".$endDate;
+    echo "\n=====================================================================================\n\n";
+    // Loop through courses creating one session per each and adding them
+    foreach ($courses as $course) {
+        $sessionName = $course['title']." (".date("M Y", api_strtotime($startDate)).")";
+        $sessionId = SessionManager::create_session(
+            $sessionName,
+            $startDate,
+            $endDate,
+            0,
+            0,
+            null,
+            $administratorId,
+            0,
+            SESSION_INVISIBLE
+        );
+        SessionManager::add_courses_to_session($sessionId, array($course['code']));
+        echo "Session '".$sessionName."' created.\nCourse '".$course['title']."' added.\n\n";
+    }
+}
+
+// Starts the script
+
+// Get first active administrator
+$administrators = array_reverse(UserManager::get_all_administrators());
+$lastingAdministrators = count($administrators);
+while (!$administrators[$lastingAdministrators - 1]['active'] && $lastingAdministrators > 0) {
+    $lastingAdministrators--;
+}
+if (!$lastingAdministrators) {
+    echo "There are no active administrators. Process halted.\n";
+    exit;
+}
+$administratorId = intval($administrators[$lastingAdministrators - 1]['user_id']);
+
+// Creates course sessions for the current month
+$dates = getMonthFirstAndLastDates();
+// Get courses that don't have any session
+$courses = CourseManager::getCoursesWithoutSession();
+createCourseSessions($courses, $administratorId, $dates['startDate'], $dates['endDate']);
+
+// Creates course sessions for the following month
+if (date("Y-m-d") >= date("Y-m-".OFFSET)) {
+    $dates = getMonthFirstAndLastDates(date("Y-m-d", api_strtotime(date("Y-m-01")." + 1 month")));
+    // Get courses that don't have any session the next month
+    $courses = CourseManager::getCoursesWithoutSession($dates['startDate'], $dates['endDate']);
+    createCourseSessions($courses, $administratorId, $dates['startDate'], $dates['endDate']);
+}

+ 2 - 2
main/cron/import_csv.php

@@ -941,9 +941,9 @@ class ImportCsv
                     $addTeacherToSession = isset($courseInfo['add_teachers_to_sessions_courses']) && !empty($courseInfo['add_teachers_to_sessions_courses']) ? true : false;
 
                     if ($addTeacherToSession) {
-                        CourseManager::updateTeachers($courseInfo['id'], $row['teachers'], false, true, false);
+                        CourseManager::updateTeachers($courseInfo['real_id'], $row['teachers'], false, true, false);
                     } else {
-                        CourseManager::updateTeachers($courseInfo['id'], $row['teachers'], false, false);
+                        CourseManager::updateTeachers($courseInfo['real_id'], $row['teachers'], false, false);
                     }
 
                     if ($result) {

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

@@ -1,543 +0,0 @@
-/*
- *  File:         demo_table.css
- *  CVS:          $Id$
- *  Description:  CSS descriptions for DataTables demo pages
- *  Author:       Allan Jardine
- *  Created:      Tue May 12 06:47:22 BST 2009
- *  Modified:     $Date$ by $Author$
- *  Language:     CSS
- *  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
- *
- * The styles given here are suitable for the demos that are used with the standard DataTables
- * distribution (see www.datatables.net). You will most likely wish to modify these styles to
- * meet the layout requirements of your site.
- *
- * Common issues:
- *   'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
- *     no conflict between the two pagination types. If you want to use full_numbers pagination
- *     ensure that you either have "example_alt_pagination" as a body class name, or better yet,
- *     modify that selector.
- *   Note that the path used for Images is relative. All images are by default located in
- *     images/dataTable/ - relative to this CSS file.
- */
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables features
- */
-
-.dataTables_wrapper {
-	position: relative;
-	min-height: 302px;
-	clear: both;
-	_height: 302px;
-	zoom: 1; /* Feeling sorry for IE */
-}
-
-.dataTables_processing {
-	position: absolute;
-	top: 50%;
-	left: 50%;
-	width: 250px;
-	height: 30px;
-	margin-left: -125px;
-	margin-top: -15px;
-	padding: 14px 0 2px 0;
-	border: 1px solid #ddd;
-	text-align: center;
-	color: #999;
-	font-size: 14px;
-	background-color: white;
-}
-
-.dataTables_length {
-	width: 40%;
-	float: left;
-}
-
-.dataTables_filter {
-	width: 50%;
-	float: right;
-	text-align: right;
-}
-
-.dataTables_info {
-	width: 60%;
-	float: left;
-}
-
-.dataTables_paginate {
-	width: 44px;
-	* width: 50px;
-	float: right;
-	text-align: right;
-}
-
-/* Pagination nested */
-.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
-	height: 19px;
-	width: 19px;
-	margin-left: 3px;
-	float: left;
-}
-
-.paginate_disabled_previous {
-	background-image: url('images/dataTale/back_disabled.jpg');
-}
-
-.paginate_enabled_previous {
-	background-image: url('images/dataTable/back_enabled.jpg');
-}
-
-.paginate_disabled_next {
-	background-image: url('images/dataTable/forward_disabled.jpg');
-}
-
-.paginate_enabled_next {
-	background-image: url('images/dataTable/forward_enabled.jpg');
-}
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables display
- */
-table.display {
-	margin: 0 auto;
-	clear: both;
-	width: 100%;
-	
-	/* Note Firefox 3.5 and before have a bug with border-collapse
-	 * ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) 
-	 * border-spacing: 0; is one possible option. Conditional-css.com is
-	 * useful for this kind of thing
-	 *
-	 * Further note IE 6/7 has problems when calculating widths with border width.
-	 * It subtracts one px relative to the other browsers from the first column, and
-	 * adds one to the end...
-	 *
-	 * If you want that effect I'd suggest setting a border-top/left on th/td's and 
-	 * then filling in the gaps with other borders.
-	 */
-}
-
-table.display thead th {
-	padding: 3px 18px 3px 10px;
-	border-bottom: 1px solid black;
-	font-weight: bold;
-	cursor: pointer;
-	* cursor: hand;
-}
-
-table.display tfoot th {
-	padding: 3px 18px 3px 10px;
-	border-top: 1px solid black;
-	font-weight: bold;
-}
-
-table.display tr.heading2 td {
-	border-bottom: 1px solid #aaa;
-}
-
-table.display td {
-	padding: 3px 10px;
-}
-
-table.display td.center {
-	text-align: center;
-}
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables sorting
- */
-
-.sorting_asc {
-	background: url('images/dataTable/sort_asc.png') no-repeat center right;
-}
-
-.sorting_desc {
-	background: url('images/dataTable/sort_desc.png') no-repeat center right;
-}
-
-.sorting {
-	background: url('images/dataTable/sort_both.png') no-repeat center right;
-}
-
-.sorting_asc_disabled {
-	background: url('images/dataTable/sort_asc_disabled.png') no-repeat center right;
-}
-
-.sorting_desc_disabled {
-	background: url('images/dataTable/sort_desc_disabled.png') no-repeat center right;
-}
-
-
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * DataTables row classes
- */
-table.display tr.odd.gradeA {
-	background-color: #ddffdd;
-}
-
-table.display tr.even.gradeA {
-	background-color: #eeffee;
-}
-
-table.display tr.odd.gradeC {
-	background-color: #ddddff;
-}
-
-table.display tr.even.gradeC {
-	background-color: #eeeeff;
-}
-
-table.display tr.odd.gradeX {
-	background-color: #ffdddd;
-}
-
-table.display tr.even.gradeX {
-	background-color: #ffeeee;
-}
-
-table.display tr.odd.gradeU {
-	background-color: #ddd;
-}
-
-table.display tr.even.gradeU {
-	background-color: #eee;
-}
-
-
-tr.odd {
-	background-color: #E2E4FF;
-}
-
-tr.even {
-	background-color: white;
-}
-
-
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Misc
- */
-.dataTables_scroll {
-	clear: both;
-}
-
-.dataTables_scrollBody {
-	*margin-top: -1px;
-}
-
-.top, .bottom {
-	padding: 15px;
-	background-color: #F5F5F5;
-	border: 1px solid #CCCCCC;
-}
-
-.top .dataTables_info {
-	float: none;
-}
-
-.clear {
-	clear: both;
-}
-
-.dataTables_empty {
-	text-align: center;
-}
-
-tfoot input {
-	margin: 0.5em 0;
-	width: 100%;
-	color: #444;
-}
-
-tfoot input.search_init {
-	color: #999;
-}
-
-td.group {
-	background-color: #d1cfd0;
-	border-bottom: 2px solid #A19B9E;
-	border-top: 2px solid #A19B9E;
-}
-
-td.details {
-	background-color: #d1cfd0;
-	border: 2px solid #A19B9E;
-}
-
-
-.example_alt_pagination div.dataTables_info {
-	width: 40%;
-}
-
-.paging_full_numbers {
-	width: 400px;
-	height: 22px;
-	line-height: 22px;
-}
-
-.paging_full_numbers span.paginate_button,
- 	.paging_full_numbers span.paginate_active {
-	border: 1px solid #aaa;
-	-webkit-border-radius: 5px;
-	-moz-border-radius: 5px;
-	padding: 2px 5px;
-	margin: 0 3px;
-	cursor: pointer;
-	*cursor: hand;
-}
-
-.paging_full_numbers span.paginate_button {
-	background-color: #ddd;
-}
-
-.paging_full_numbers span.paginate_button:hover {
-	background-color: #ccc;
-}
-
-.paging_full_numbers span.paginate_active {
-	background-color: #99B3FF;
-}
-
-table.display tr.even.row_selected td {
-	background-color: #B0BED9;
-}
-
-table.display tr.odd.row_selected td {
-	background-color: #9FAFD1;
-}
-
-
-/*
- * Sorting classes for columns
- */
-/* For the standard odd/even */
-tr.odd td.sorting_1 {
-	background-color: #D3D6FF;
-}
-
-tr.odd td.sorting_2 {
-	background-color: #DADCFF;
-}
-
-tr.odd td.sorting_3 {
-	background-color: #E0E2FF;
-}
-
-tr.even td.sorting_1 {
-	background-color: #EAEBFF;
-}
-
-tr.even td.sorting_2 {
-	background-color: #F2F3FF;
-}
-
-tr.even td.sorting_3 {
-	background-color: #F9F9FF;
-}
-
-
-/* For the Conditional-CSS grading rows */
-/*
- 	Colour calculations (based off the main row colours)
-  Level 1:
-		dd > c4
-		ee > d5
-	Level 2:
-	  dd > d1
-	  ee > e2
- */
-tr.odd.gradeA td.sorting_1 {
-	background-color: #c4ffc4;
-}
-
-tr.odd.gradeA td.sorting_2 {
-	background-color: #d1ffd1;
-}
-
-tr.odd.gradeA td.sorting_3 {
-	background-color: #d1ffd1;
-}
-
-tr.even.gradeA td.sorting_1 {
-	background-color: #d5ffd5;
-}
-
-tr.even.gradeA td.sorting_2 {
-	background-color: #e2ffe2;
-}
-
-tr.even.gradeA td.sorting_3 {
-	background-color: #e2ffe2;
-}
-
-tr.odd.gradeC td.sorting_1 {
-	background-color: #c4c4ff;
-}
-
-tr.odd.gradeC td.sorting_2 {
-	background-color: #d1d1ff;
-}
-
-tr.odd.gradeC td.sorting_3 {
-	background-color: #d1d1ff;
-}
-
-tr.even.gradeC td.sorting_1 {
-	background-color: #d5d5ff;
-}
-
-tr.even.gradeC td.sorting_2 {
-	background-color: #e2e2ff;
-}
-
-tr.even.gradeC td.sorting_3 {
-	background-color: #e2e2ff;
-}
-
-tr.odd.gradeX td.sorting_1 {
-	background-color: #ffc4c4;
-}
-
-tr.odd.gradeX td.sorting_2 {
-	background-color: #ffd1d1;
-}
-
-tr.odd.gradeX td.sorting_3 {
-	background-color: #ffd1d1;
-}
-
-tr.even.gradeX td.sorting_1 {
-	background-color: #ffd5d5;
-}
-
-tr.even.gradeX td.sorting_2 {
-	background-color: #ffe2e2;
-}
-
-tr.even.gradeX td.sorting_3 {
-	background-color: #ffe2e2;
-}
-
-tr.odd.gradeU td.sorting_1 {
-	background-color: #c4c4c4;
-}
-
-tr.odd.gradeU td.sorting_2 {
-	background-color: #d1d1d1;
-}
-
-tr.odd.gradeU td.sorting_3 {
-	background-color: #d1d1d1;
-}
-
-tr.even.gradeU td.sorting_1 {
-	background-color: #d5d5d5;
-}
-
-tr.even.gradeU td.sorting_2 {
-	background-color: #e2e2e2;
-}
-
-tr.even.gradeU td.sorting_3 {
-	background-color: #e2e2e2;
-}
-
-
-/*
- * Row highlighting example
- */
-.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
-	background-color: #ECFFB3;
-}
-
-.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
-	background-color: #E6FF99;
-}
-
-.ex_highlight_row #example tr.even:hover {
-	background-color: #ECFFB3;
-}
-
-.ex_highlight_row #example tr.even:hover td.sorting_1 {
-	background-color: #DDFF75;
-}
-
-.ex_highlight_row #example tr.even:hover td.sorting_2 {
-	background-color: #E7FF9E;
-}
-
-.ex_highlight_row #example tr.even:hover td.sorting_3 {
-	background-color: #E2FF89;
-}
-
-.ex_highlight_row #example tr.odd:hover {
-	background-color: #E6FF99;
-}
-
-.ex_highlight_row #example tr.odd:hover td.sorting_1 {
-	background-color: #D6FF5C;
-}
-
-.ex_highlight_row #example tr.odd:hover td.sorting_2 {
-	background-color: #E0FF84;
-}
-
-.ex_highlight_row #example tr.odd:hover td.sorting_3 {
-	background-color: #DBFF70;
-}
-
-
-/*
- * KeyTable
- */
-table.KeyTable td {
-	border: 3px solid transparent;
-}
-
-table.KeyTable td.focus {
-	border: 3px solid #3366FF;
-}
-
-table.display tr.gradeA {
-	background-color: #eeffee;
-}
-
-table.display tr.gradeC {
-	background-color: #ddddff;
-}
-
-table.display tr.gradeX {
-	background-color: #ffdddd;
-}
-
-table.display tr.gradeU {
-	background-color: #ddd;
-}
-
-div.box {
-	height: 100px;
-	padding: 10px;
-	overflow: auto;
-	border: 1px solid #8080FF;
-	background-color: #E5E5FF;
-}

部分文件因为文件数量过多而无法显示