Laurent Opprecht 13 سال پیش
والد
کامیت
915c939be1
65فایلهای تغییر یافته به همراه1336 افزوده شده و 2176 حذف شده
  1. 8 1
      documentation/changelog.html
  2. 7 1
      documentation/credits.html
  3. 8 1
      documentation/dependencies.html
  4. 9 3
      documentation/license.html
  5. 7 1
      documentation/readme.html
  6. 5 0
      index.php
  7. 19 7
      main/admin/settings.php
  8. 8 1
      main/auth/external_login/ldap.inc.php
  9. 2 46
      main/css/academica/default.css
  10. 1 50
      main/css/baby_orange/default.css
  11. 146 5
      main/css/base.css
  12. 1 83
      main/css/base_chamilo.css
  13. 30 49
      main/css/blue_lagoon/default.css
  14. 1 19
      main/css/chamilo/default.css
  15. 32 81
      main/css/cool_blue/default.css
  16. 20 123
      main/css/corporate/default.css
  17. 8 53
      main/css/cosmic_campus/default.css
  18. 30 81
      main/css/delicious_bordeaux/default.css
  19. 29 65
      main/css/dokeos_blue/default.css
  20. 30 83
      main/css/empire_green/default.css
  21. 30 108
      main/css/fruity_orange/default.css
  22. 1 22
      main/css/kiddy/default.css
  23. 33 159
      main/css/medical/default.css
  24. 14 79
      main/css/public_admin/default.css
  25. 31 2
      main/css/responsive.css
  26. 34 83
      main/css/royal_purple/default.css
  27. 4 144
      main/css/silver_line/default.css
  28. 2 129
      main/css/sober_brown/default.css
  29. 31 78
      main/css/steel_grey/default.css
  30. 32 106
      main/css/tasty_olive/default.css
  31. 86 50
      main/exercice/exercise.class.php
  32. 2 1
      main/exercice/exercise_result.php
  33. 2 3
      main/exercice/exercise_show.php
  34. 56 78
      main/exercice/exercise_submit.php
  35. 8 2
      main/gradebook/gradebook_add_eval.php
  36. 6 0
      main/gradebook/gradebook_add_link.php
  37. 34 4
      main/gradebook/gradebook_edit_cat.php
  38. 8 1
      main/gradebook/gradebook_edit_eval.php
  39. 5 1
      main/gradebook/gradebook_edit_link.php
  40. 60 109
      main/gradebook/index.php
  41. 7 4
      main/gradebook/lib/be/category.class.php
  42. 4 4
      main/gradebook/lib/be/evaluation.class.php
  43. 43 9
      main/gradebook/lib/fe/catform.class.php
  44. 12 23
      main/gradebook/lib/fe/displaygradebook.php
  45. 44 22
      main/gradebook/lib/fe/evalform.class.php
  46. 24 12
      main/gradebook/lib/fe/gradebooktable.class.php
  47. 20 5
      main/gradebook/lib/fe/linkaddeditform.class.php
  48. 3 1
      main/gradebook/lib/gradebook_data_generator.class.php
  49. 12 3
      main/gradebook/lib/gradebook_functions.inc.php
  50. 32 14
      main/inc/ajax/exercise.ajax.php
  51. 16 12
      main/inc/ajax/social.ajax.php
  52. 4 6
      main/inc/lib/auth.lib.php
  53. 18 0
      main/inc/lib/display.lib.php
  54. 39 23
      main/inc/lib/events.lib.inc.php
  55. 13 4
      main/inc/lib/main_api.lib.php
  56. 20 21
      main/inc/lib/usermanager.lib.php
  57. 3 6
      main/inc/lib/userportal.lib.php
  58. 15 14
      main/install/configuration.dist.php
  59. 14 19
      main/install/db_main.sql
  60. 25 5
      main/install/db_stats.sql
  61. 6 2
      main/install/migrate-db-1.8.8-1.9.0-pre.sql
  62. 19 15
      main/social/friends.php
  63. 22 23
      main/template/default/auth/courses_categories.php
  64. 40 11
      main/template/default/layout/head.tpl
  65. 1 6
      main/template/default/layout/login_form.tpl

+ 8 - 1
documentation/changelog.html

@@ -32,7 +32,14 @@
     
 <h1>Chamilo&nbsp;Changelog</h1>
 
-<a href="index.html">Documentation</a> &gt; Changelog
+<ul class="breadcrumb">
+    <li>
+        <a href="index.html">Documentation</a>
+        <span class="divider">/</span>
+    </li>    
+    <li>Changelog</li>
+</ul>
+
 <div id="outerframe">
 <div id="main">
 

+ 7 - 1
documentation/credits.html

@@ -31,7 +31,13 @@
 </div>
     
 <h1>Chamilo Credits</h1>
-<a href="index.html">Documentation</a> &gt; Credits
+<ul class="breadcrumb">
+    <li>
+        <a href="index.html">Documentation</a>
+        <span class="divider">/</span>
+    </li>    
+    <li>Credits</li>
+</ul>
 
 <h1>Core developers</h1>
 <ol>

+ 8 - 1
documentation/dependencies.html

@@ -30,7 +30,14 @@
     </div>
 </div>
 <h1>Chamilo - Server Dependencies</h1>
-<a href="index.html">Documentation</a> &gt;Dependencies
+<ul class="breadcrumb">
+    <li>
+        <a href="index.html">Documentation</a>
+        <span class="divider">/</span>
+    </li>    
+    <li>Dependencies</li>
+</ul>
+
 <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 practical features. Some of this third-party software

+ 9 - 3
documentation/license.html

@@ -30,10 +30,16 @@
     </div>
 </div>
 <h1>Chamilo License</h1>
-<a href="index.html">Documentation</a> &gt; Gnu General Public License
+<ul class="breadcrumb">
+    <li>
+        <a href="index.html">Documentation</a>
+        <span class="divider">/</span>
+    </li>    
+    <li>Gnu General Public License</li>
+</ul>
+
 <div id="outerframe">
-  <div id="main">
-  
+  <div id="main">  
 
 <h3 style="text-align: left;">GNU GENERAL PUBLIC LICENSE</h3>
 <p style="text-align: left;">Version 3, 29 June 2007</p>

+ 7 - 1
documentation/readme.html

@@ -30,7 +30,13 @@
     </div>
 </div>
 <h1>About Chamilo</h1>
-<a href="index.html">Documentation</a> &gt; About Chamilo
+<ul class="breadcrumb">
+    <li>
+        <a href="index.html">Documentation</a>
+        <span class="divider">/</span>
+    </li>    
+    <li>About Chamilo</li>
+</ul>
 <div id="outerframe">
 <div id="main">
 <p>Chamilo is an elearning and course management web application,<br />

+ 5 - 0
index.php

@@ -134,6 +134,11 @@ if (api_get_setting('display_categories_on_homepage') == 'true') {
 	$controller->tpl->assign('content', $controller->return_anonymous_course_list());
 }
 
+// Facebook connexion, if activated
+if (api_is_facebook_auth_activated() && !api_get_user_id()) {
+    facebook_connect();
+}
+
 $controller->set_login_form();
 
 //@todo move this inside the IndexManager

+ 19 - 7
main/admin/settings.php

@@ -278,18 +278,30 @@ $action_images['extra']     	= 'wizard.png';
 $action_images['tracking']     	= 'statistics.png';
 $action_images['gradebook2']    = 'gradebook.png';
 
+$action_images['search']        = 'search.png';
+$action_images['stylesheets']   = 'stylesheets.png';
+$action_images['templates']     = 'template.png';
+$action_images['plugins']       = 'plugins.png';
+
 // Grabbing the categories.
 $resultcategories = api_get_settings_categories(array('stylesheets', 'Plugins', 'Templates', 'Search'));
 
-echo "<div class=\"actions\">";
+$action_array = array();
+
+$resultcategories[] = array('category' => 'search');
+$resultcategories[] = array('category' => 'stylesheets');
+$resultcategories[] = array('category' => 'templates');
+$resultcategories[] = array('category' => 'plugins');
 foreach ($resultcategories as $row) {
-    echo "<a href=\"".api_get_self()."?category=".$row['category']."\">".Display::return_icon($action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category'])),'',ICON_SIZE_MEDIUM)."</a>";
+    $url = array();    
+    $url['url'] = api_get_self()."?category=".$row['category'];
+    $url['content'] = Display::return_icon($action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category'])),'',ICON_SIZE_MEDIUM);    
+    if (strtolower($row['category']) == strtolower($_GET['category'])) {
+        $url['active'] = true;
+    }
+    $action_array[] = $url;
 }
-echo "<a href=\"".api_get_self()."?category=Search\">".Display::return_icon($action_images['search'], api_ucfirst(get_lang('Search')),'',ICON_SIZE_MEDIUM)."</a>";
-echo "<a href=\"".api_get_self()."?category=stylesheets\">".Display::return_icon($action_images['stylesheets'], api_ucfirst(get_lang('Stylesheets')),'',ICON_SIZE_MEDIUM)."</a>";
-echo "<a href=\"".api_get_self()."?category=Templates\">".Display::return_icon($action_images['templates'], api_ucfirst(get_lang('Templates')),'',ICON_SIZE_MEDIUM)."</a>";
-echo "<a href=\"".api_get_self()."?category=Plugins\">".Display::return_icon($action_images['plugins'], api_ucfirst(get_lang('Plugins')),'',ICON_SIZE_MEDIUM)."</a>";
-echo "</div>";
+echo Display::actions($action_array);
 
 $form_search = new FormValidator('search_settings', 'get', api_get_self() , null, array('class'=>'vertical'));
 $form_search->addElement('text', 'search_field');

+ 8 - 1
main/auth/external_login/ldap.inc.php

@@ -78,8 +78,11 @@ function extldap_connect()
  *
  * @return mixed false if user cannot authenticate on ldap, user ldap entry if tha succeeds
  * @author ndiechburg <noel@cblue.be>
+ * Modified by hubert.borderiou@grenet.fr 
+ * Add possibility to get user info from LDAP without check password (if CAS auth and LDAP profil update)
+ * 
  **/
-function extldap_authenticate($username, $password)
+function extldap_authenticate($username, $password, $in_auth_with_no_password=false)
 {
   global $extldap_config;
 
@@ -118,6 +121,10 @@ function extldap_authenticate($username, $password)
   $users = ldap_get_entries($ds,$sr);
   $user = $users[0];
 
+  // If we just want to have user info from LDAP and not to check password
+  if ($in_auth_with_no_password) {
+    return $user;
+  }
   //now we try to autenthicate the user in the ldap
   $ubind = @ldap_bind($ds, $user['dn'], $password);
   if($ubind !== false){

+ 2 - 46
main/css/academica/default.css

@@ -51,58 +51,14 @@ a:active {
 /* header 3 styles */
 .subnav {
 	border-bottom: 1px solid #aeaeae;	
-	font-weight: bold;
-	margin: 0;
-	padding: 0;	
-    width:100%;        
-}
-
-.subnav UL {
-	PADDING-RIGHT: 2px;
-	PADDING-LEFT: 10px;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav LI {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-	cursor: pointer;
-}
-.subnav a {	
-	float:left;
-	text-decoration:none;
-	cursor: pointer;
-	padding-right: 1px;
-	height:25px;
+	font-weight: bold;	
 }
+
 .subnav li a:hover {
 	float:left;
 	text-decoration:none;
 	cursor: pointer;
 }
-.subnav li a span {
-	float:left;
-	cursor: pointer;
-	padding-right: 10px;
-	padding-top: 5px;
-	height:20px;
-}
-.subnav li a:hover span {
-	float:left;
-	cursor: pointer;
-}
-.subnav #current a {	
-	float:left;
-	text-decoration:none;
-}
-.subnav #current a span {
-	float:left;
-}
 
 /* The tool shortcuts */
 #toolshortcuts {

+ 1 - 50
main/css/baby_orange/default.css

@@ -54,56 +54,7 @@ a:active {
 /* header 3 styles */
 .subnav {
 	border-bottom: 1px solid #aeaeae;	
-	font-weight: bold;
-	margin: 0;
-	padding: 0;	
-    width:100%;        
-}
-.subnav UL {
-	PADDING-RIGHT: 2px;
-	PADDING-LEFT: 10px;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav LI {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-	cursor: pointer;
-}
-.subnav a {
-	float:left;
-	text-decoration:none;
-	cursor: pointer;
-	padding-right: 1px;
-	height:25px;
-}
-.subnav li a:hover {
-	float:left;
-	text-decoration:none;
-	cursor: pointer;
-}
-.subnav li a span {
-	float:left;
-	cursor: pointer;
-	padding-right: 10px;
-	padding-top: 5px;
-	height:20px;
-}
-.subnav li a:hover span {
-	float:left;
-	cursor: pointer;
-}
-.subnav #current a {	
-	float:left;
-	text-decoration:none;
-}
-.subnav #current a span {
-	float:left;
+	font-weight: bold;	   
 }
 
 /* The tool shortcuts */

+ 146 - 5
main/css/base.css

@@ -29,11 +29,6 @@ form .label {
     border-radius: none;
 }
 
-.secondary-nav {
-    float:right !important;
-    margin-right: 0px !important;
-}
-
 legend {
     margin-bottom: 10px;
 }
@@ -3440,4 +3435,150 @@ a.forum_group_link {
 
 .exercise_overview_options {
     text-align: center;
+}
+
+
+
+.subnav-fixed {
+    position: fixed;
+    top: 0px;
+    left: 0;
+    right: 0;
+    z-index: 1030;
+    border-color: #d5d5d5;
+    border-width: 0 0 1px; /* drop the border on the fixed edges */
+    -webkit-border-radius: 0;
+        -moz-border-radius: 0;
+            border-radius: 0;
+    /*-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
+        -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
+            box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
+    */
+}
+
+
+/* Subnav */
+.subnav {
+  height: 36px;
+  
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  
+  /* default subnav color */
+  background-color: #eeeeee; /* Old browsers */
+  background-repeat: repeat-x; /* Repeat the gradient */
+  background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
+  background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
+  background-image: -ms-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* IE10+ */
+  background-image: -o-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Opera 11.10+ */
+  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
+  background-image: linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* W3C */
+  border: 1px solid #e5e5e5;
+  /* end default subnav background colors */
+}
+
+/* fixing gray border next the logout button */
+.subnav .nav-tabs .open .dropdown-toggle, .subnav .nav-pills .open .dropdown-toggle, .nav > .open.active > a:hover {
+    border-color: transparent;
+}
+
+.subnav .nav {
+    margin-bottom: 0;
+}
+
+.subnav .nav > li > a {
+  margin: 0;
+  padding-top:    11px;
+  padding-bottom: 11px;
+  border-left: 1px solid #f5f5f5;
+  border-right: 1px solid #e5e5e5;
+  -webkit-border-radius: 0;
+     -moz-border-radius: 0;
+          border-radius: 0;
+}
+.subnav .nav > #current > a,
+.subnav .nav > #current > a:hover {
+  padding-left: 13px;
+  color: #777;
+  background-color: #e9e9e9;
+  border-right-color: #ddd;
+  border-left: 0;
+  -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
+     -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
+          box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
+}
+.subnav .nav > #current > a .caret,
+.subnav .nav > #current > a:hover .caret {
+    border-top-color: #777;
+}
+.subnav .nav > li:first-child > a,
+.subnav .nav > li:first-child > a:hover {
+  border-left: 0;
+  padding-left: 12px;
+  -webkit-border-radius: 4px 0 0 4px;
+     -moz-border-radius: 4px 0 0 4px;
+          border-radius: 4px 0 0 4px;
+}
+.subnav .nav > li:last-child > a {
+    border-right: 0;
+}
+.subnav .dropdown-menu {
+  -webkit-border-radius: 0 0 4px 4px;
+     -moz-border-radius: 0 0 4px 4px;
+          border-radius: 0 0 4px 4px;
+}
+.subnav .nav > li:first-child > a,
+.subnav .nav > li:first-child > a:hover {
+    -webkit-border-radius: 0;
+        -moz-border-radius: 0;
+            border-radius: 0;
+}
+.subnav .nav > li > a:hover {
+    text-decoration: none;  
+}
+
+.new_actions {
+    background-color: #EEEEEE;
+    background-image: -moz-linear-gradient(center top , #F5F5F5 0%, #EEEEEE 100%);
+    background-repeat: repeat-x;
+    border: 1px solid #E5E5E5;
+    border-radius: 4px 4px 4px 4px;
+    height: 53px;    
+}
+
+.new_actions .nav > li > a {
+    border-left: 1px solid #F5F5F5;
+    border-radius: 0 0 0 0;
+    border-right: 1px solid #E5E5E5;
+    margin: 0;
+    padding-bottom: 11px;
+    padding-top: 11px;
+}
+
+.new_actions-fixed {
+    border-color: #D5D5D5;
+    border-radius: 0 0 0 0;
+    border-width: 0 0 1px;
+    left: 0;
+    position: fixed;
+    right: 0;
+    top: 38px;
+    z-index: 1030;
+}
+
+.new_actions .nav > .active > a, .new_actions .nav > .active > a:hover {
+    background-color: #E9E9E9;
+    border-left: 0 none;
+    border-right-color: #DDDDDD;
+    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.05) inset;
+    color: #777777;
+    padding-left: 13px;
+}
+
+
+.new_actions .nav-tabs > li > a, .new_actions .nav-pills > li > a {
+    padding-left: 10px;
+    padding-right: 10px;
 }

+ 1 - 83
main/css/base_chamilo.css

@@ -1863,90 +1863,8 @@ span.form_required  {
         -moz-border-radius: 0;
             border-radius: 0;
 }
-  
-/* Subnav */
-.subnav {
-  width:100%;  
-  height: 36px;
-  
-  -webkit-border-radius: 4px;
-     -moz-border-radius: 4px;
-          border-radius: 4px;
-  
-  /* default subnav color */
-  background-color: #eeeeee; /* Old browsers */
-  background-repeat: repeat-x; /* Repeat the gradient */
-  background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
-  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
-  background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
-  background-image: -ms-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* IE10+ */
-  background-image: -o-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Opera 11.10+ */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
-  background-image: linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* W3C */
-  border: 1px solid #e5e5e5;
-  /* end default subnav background colors */
-}
-
-/* fixing gray border next the logout button */
-.subnav .nav-tabs .open .dropdown-toggle, .subnav .nav-pills .open .dropdown-toggle, .nav > .open.active > a:hover {
-    border-color: transparent;
-}
-
-.subnav .nav {
-    margin-bottom: 0;
-}
 
-.subnav .nav > li > a {
-  margin: 0;
-  padding-top:    11px;
-  padding-bottom: 11px;
-  border-left: 1px solid #f5f5f5;
-  border-right: 1px solid #e5e5e5;
-  -webkit-border-radius: 0;
-     -moz-border-radius: 0;
-          border-radius: 0;
-}
-.subnav .nav > #current > a,
-.subnav .nav > #current > a:hover {
-  padding-left: 13px;
-  color: #777;
-  background-color: #e9e9e9;
-  border-right-color: #ddd;
-  border-left: 0;
-  -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
-     -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
-          box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
-}
-.subnav .nav > #current > a .caret,
-.subnav .nav > #current > a:hover .caret {
-  border-top-color: #777;
-}
-.subnav .nav > li:first-child > a,
-.subnav .nav > li:first-child > a:hover {
-  border-left: 0;
-  padding-left: 12px;
-  -webkit-border-radius: 4px 0 0 4px;
-     -moz-border-radius: 4px 0 0 4px;
-          border-radius: 4px 0 0 4px;
-}
-.subnav .nav > li:last-child > a {
-  border-right: 0;
-}
-.subnav .dropdown-menu {
-  -webkit-border-radius: 0 0 4px 4px;
-     -moz-border-radius: 0 0 4px 4px;
-          border-radius: 0 0 4px 4px;
-}
-.subnav .nav > li:first-child > a,
-.subnav .nav > li:first-child > a:hover {
--webkit-border-radius: 0;
-    -moz-border-radius: 0;
-        border-radius: 0;
-}
-.subnav .nav > li > a:hover {
-  text-decoration: none;
-  /*background-color: #eeeeee; */
-}
+
 
 /* Text resize icons in header */
 .resize_font { /* the canvas */

+ 30 - 49
main/css/blue_lagoon/default.css

@@ -400,66 +400,47 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 }
 
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	
-    padding-left:0px;
-    padding-right:0px; 
-    width: 100%;
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-	PADDING-TOP: 10px;
-	float: left;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {	
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
+    background-color: #32578B; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #32578B 0%, #3E6BAC 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#32578B), color-stop(100%,#3E6BAC)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #32578B 0%, #3E6BAC 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #32578B 0%,#3E6BAC 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #32578B 0%,#3E6BAC 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#32578B', endColorstr='#3E6BAC',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #32578B 0%, #3E6BAC 100%); /* W3C */
 }
 
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #32578B;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
+
 #logout {
 	display: inline;
 	float: right;

+ 1 - 19
main/css/chamilo/default.css

@@ -22,29 +22,11 @@ a:active {
     color : #3757f7;
 }
 
-.subnav-fixed {
-    position: fixed;
-    top: 0px;
-    left: 0;
-    right: 0;
-    z-index: 1030;
-    border-color: #d5d5d5;
-    border-width: 0 0 1px; /* drop the border on the fixed edges */
-    -webkit-border-radius: 0;
-        -moz-border-radius: 0;
-            border-radius: 0;
-    /*-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-        -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-            box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-    */
-}
-
 
 .subnav {  
   background-color: #00AAE3; /* Old browsers */
   background-repeat: repeat-x; /* Repeat the gradient */
-  background-image: -moz-linear-gradient(top, #028DC2 0%, #00AAE3 100%); /* FF3.6+ */
-  
+  background-image: -moz-linear-gradient(top, #028DC2 0%, #00AAE3 100%); /* FF3.6+ */  
   background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#028DC2), color-stop(100%,#00AAE3)); /* Chrome,Safari4+ */
   background-image: -webkit-linear-gradient(top, #028DC2 0%, #00AAE3 100%); /* Chrome 10+,Safari 5.1+ */
   background-image: -ms-linear-gradient(top, #028DC2 0%,#00AAE3 100%); /* IE10+ */

+ 32 - 81
main/css/cool_blue/default.css

@@ -337,103 +337,54 @@ a:active {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 }
 #my_courses {
 	float: right;
 }
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width:100%;    
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-}
-.subnav ul {	
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0 0 0 0;
-	padding: 0;
-	background-color: transparent;
-	border: none;
-	COLOR: rgb(39,84,175);
-	font-weight:bold;
-	display: inline;
-	background:  url(../../img/tab_right.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;
-}
-.subnav input:hover {
-	color: #333;
-	background:  url(../../img/tab_right_hover.gif) no-repeat right top;
+    background-color: #2EA2C5; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #2EA2C5 0%, #6DC8E5 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2EA2C5), color-stop(100%,#3E6BAC)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #2EA2C5 0%, #3E6BAC 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #2EA2C5 0%,#3E6BAC 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #2EA2C5 0%,#3E6BAC 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#32578B', endColorstr='#3E6BAC',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #32578B 0%, #3E6BAC 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
+
 #logout {
 	display: inline;
 	float: right;

+ 20 - 123
main/css/corporate/default.css

@@ -55,129 +55,34 @@ input[type=button], input[type=submit] {
     padding: 0;
     width: 100%;
 }
-/* header 1 styles */
-#header1 {
-	background-color: #dcdcdc;
-	color: #666;
-	border-bottom: 1px solid #ccc;
-}
-#header1 a {
-	color: #333;
-	text-decoration: none;
-}
-#header1 a:hover {
-}
-#my_courses {
-	float: right;
-	font-weight: bold;
-}
-#header1 img {
-	border: 0px;
-}
-/* header 2 styles */
-#header2 {
-	background: #f0f0f0;
-	color: #666;
-	border-bottom: 1px solid #ccc;
-}
-#header2 a {
-	color: #333;
-	text-decoration: none;
-}
-#header2 a:hover {
-}
-#Header2Right ul {
-	float: right;
-	list-style-type: none;
-	text-align: right;
-	color:#680157;
-	margin: 0;
-	padding: 0;
-}
-#Header2Right ul li {
-	display: inline;
-}
-#Header2Right ul li a {
-	color:#333;
-}
-#Header2Right ul li a:hover {
-	color:#333;
-}
-/* header 3 styles */
-.subnav {
-	background: #fff;
-	border-bottom: 1px solid #aeaeae;
-	color: #333;
-	height:auto;
-	font-weight: bold;	
-    width:100%;
-}
 
-.subnav UL {
-	PADDING-RIGHT: 2px;
-	PADDING-LEFT: 10px;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	list-style:none;	
-}
-.subnav LI {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 2px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-	cursor: pointer;
+.subnav {
+    background-color: #F2F2F2; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #CCCCCC 0%, #F2F2F2 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #CCCCCC;
 }
-
 .subnav a {
-	float:left;
-	background:url(images/tab_left.gif) no-repeat left top;
-	text-decoration:none;
-	cursor: pointer;
-	color: #333;	
-    padding: 0px 9px 0px 9px;
-	height:25px;
-}
-.subnav li a:hover {
-	float:left;
-	background:url(images/tab_left_hover.gif) no-repeat left top;
-	text-decoration:none;
-	cursor: pointer;
-}
-.subnav li a span {
-	float:left;
-	display:block;
-	background:url(images/tab_right.gif) no-repeat right top;
-	color:#333;
-	cursor: pointer;
-	padding-right: 10px;
-	padding-top: 5px;
-	height:20px;
+    color:#333;
 }
-.subnav li a:hover span {
-	float:left;
-	display:block;
-	background:url(images/tab_right_hover.gif) no-repeat right top;
-	color:#333;
-	cursor: pointer;
-}
-.subnav #current a {
-	float:left;
-	background:url(images/tab_left_active.gif) no-repeat left top;
-	text-decoration:none;
-}
-.subnav #current a span {
-	float:left;
-	display:block;
-	background:url(images/tab_right_active.gif) no-repeat right top;
+
+.subnav #current a {    
 }
 
-.subnav #logout {
-	margin-top: 0px;
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color:#333;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
+
 #logout {
 	display: inline;
 	float: right;
@@ -187,14 +92,6 @@ input[type=button], input[type=submit] {
 }
 
 
-/* header 4 styles */
-#header4 {	
-	background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
-}
-
 /* The tool shortcuts */
 #toolshortcuts {
 	text-align: right;

+ 8 - 53
main/css/cosmic_campus/default.css

@@ -84,69 +84,24 @@ input[type=button], input[type=submit] {
 	float: left;
 	font-weight: bold;
 }
-#my_courses {
-	float: right;
-	font-weight: bold;
-}
-/* header 2 styles */
-#header2 {
-	min-height:10px;
-	padding:  0.2em 0.5em;
-	padding-bottom: 0.2em;
-	background: #A7A7E5;
-	color: #666;
-}
-#header2 a {
-	color: #666;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
-#Header2Right ul {
-	float: right;
-	width: 70%;
-	margin: 0;
-	padding: 0;
-	list-style-type: none;
-	text-align: right;
-}
-#Header2Right ul li {
-	display: inline;
-	color:#ffffff;
-}
-#Header2Right ul li a {
-	color:#f1d40d;
-}
+
 /* header 3 styles */
 .subnav {
 	background: #fff;
 	color: #006;
-	border-bottom: 1px solid #aeaeae;
-	height:40px;	
-	background-image: url(images/fondoHeader3.jpg);	
-    width:100%;
+	border-bottom: 1px solid #aeaeae;	
+	background-image: url(images/fondoHeader3.jpg);
 }
-.subnav a {
-	height:25px;
-	color: #fff;
-
+.subnav a {	
+    color: #fff;
 }
 .subnav a:hover {
 	color: #8484CA;	
 }
-.subnav ul {
-	height:50px;
-}
-.subnav li {
 
-}
-
-/* header 4 styles */
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 
 /* The tool shortcuts */

+ 30 - 81
main/css/delicious_bordeaux/default.css

@@ -365,103 +365,52 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 }
 #my_courses {
 	float: right;
 }
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
 /*****************************************************
  *  HEADER 3: TABS OF THE HEADER			     	 *
  *****************************************************/
+
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width:100%;    
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
+    background-color: #975B5B; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #975B5B 0%, #BD9393 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#975B5B), color-stop(100%,#BD9393)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #975B5B 0%, #BD9393 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #975B5B 0%,#BD9393 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #975B5B 0%,#BD9393 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#975B5B', endColorstr='#BD9393',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #975B5B 0%, #BD9393 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0px;
-	padding: 0px;
-	background-color: transparent;
-	border: none;
-	COLOR: rgb(39,84,175);
-	font-weight:bold;
-	display: inline;
-	background:  url(../../img/tab_right.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;    
-}
-.subnav input:hover {
-	color: #333;
-	background:  url(../../img/tab_right_hover.gif) no-repeat right top;
-}
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 #logout {
 	display: inline;

+ 29 - 65
main/css/dokeos_blue/default.css

@@ -363,87 +363,51 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 }
 #my_courses {
 	float: right;
 }
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-	min-height: 25px;
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
 /*****************************************************
  *  HEADER 3: TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width: 100%;
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
+    background-color: #406FB2; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #406FB2 0%, #33588D 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#406FB2), color-stop(100%,#33588D)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #406FB2 0%, #33588D 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #406FB2 0%,#33588D 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #406FB2 0%,#33588D 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#406FB2', endColorstr='#33588D',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #406FB2 0%, #33588D 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 #logout {
 	display: inline;

+ 30 - 83
main/css/empire_green/default.css

@@ -365,102 +365,49 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 }
-#my_courses {
-	float: right;
-}
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	color: #636363;/*border: 1px solid red;*/
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
 /*****************************************************
  *  HEADER 3: TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width:100%;    
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0 0 0 0;
-	padding: 0;
-	background-color: transparent;
-	border: none;
-	COLOR: rgb(39,84,175);
-	font-weight:bold;
-	display: inline;
-	background:  url(../../img/tab_right.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;
+    background-color: #5B975B; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #5B975B 0%, #8FBB8F 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5B975B), color-stop(100%,#8FBB8F)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #5B975B 0%, #8FBB8F 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #5B975B 0%,#8FBB8F 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #5B975B 0%,#8FBB8F 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5B975B', endColorstr='#8FBB8F',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #5B975B 0%, #8FBB8F 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav input:hover {
-	color: #333;
-	background:  url(../../img/tab_right_hover.gif) no-repeat right top;
-}
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 #logout {
 	display: inline;

+ 30 - 108
main/css/fruity_orange/default.css

@@ -366,126 +366,48 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 }
-#my_courses {
-	float: right;
-}
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;	
-    width:100%;
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0 0 0 0;
-	padding: 0;
-	background-color: transparent;
-	border: none;
-	COLOR: rgb(39,84,175);
-	font-weight:bold;
-	display: inline;
-	background:  url(../../img/tab_right.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;
-}
-.subnav input:hover {
-	color: #333;
-	background:  url(../../img/tab_right_hover.gif) no-repeat right top;
-}
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
-}
-.subnav input.logout:hover {
+    background-color: #F8B846; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #F8B846 0%, #F79A2A 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F8B846), color-stop(100%,#F79A2A)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #F8B846 0%, #F79A2A 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #F8B846 0%,#F79A2A 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #F8B846 0%,#F79A2A 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F8B846', endColorstr='#F79A2A',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #F8B846 0%, #F79A2A 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-#logout {
-	display: inline;
-	float: right;
-	width: auto;
-	text-align: right;
-}
-.subnav .clear {
-	display: none;
-}
-/*****************************************************
- *  HEADER 4
- *****************************************************/
-#header4 {
-	background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-
-#header4 a:hover {
-	text-decoration: none;
-	color: #a8a7a7;
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 /* The tool shortcuts */
 #toolshortcuts {

+ 1 - 22
main/css/kiddy/default.css

@@ -15,30 +15,9 @@
     font-size:120%;
 }
 
-#header1 {
-    font-size:100%;
-    font-family: 'Chelsea Market', Tahoma, Geneva, sans-serif;    
-}
-#header1 a {
-    font-size:100%;
-    font-family: 'Chelsea Market', Tahoma, Geneva, sans-serif;    
-}
-
-#header2 {
-    font-size: 120%;
-}
-#Header2Right ul li {
-    font-family: 'Chelsea Market', Tahoma, Geneva, sans-serif;    
-    font-size:100%;
-}
-#Header2Right ul li a {
-    font-family: 'Chelsea Market', Tahoma, Geneva, sans-serif;    
-    font-size:100%;
-}
-
 .subnav input.logout {
     padding: 2px 10px 0;
-    font-size: 120%;
+    font-size: 110%;
     font-family: 'Chelsea Market', Tahoma, Geneva, sans-serif;    
 }
 

+ 33 - 159
main/css/medical/default.css

@@ -381,121 +381,12 @@ a:active {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
 #institution {
 	float: left;
 	font-weight: bold;
 }
-#my_courses {
-	float: right;
-	font-weight: bold;
-}
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	font-size: 1.0em;
-	font-weight: normal;
-	height:15px;
-	padding:  0.2em 0.5em;
-	padding-bottom: 0.2em;
-	background: #B7A6AC;
-	color: #666;
-}
-#header2 a {
-	color: #666;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
-/*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
- *****************************************************/
-.subnav {
-	font-size: 1.0em;
-	padding: 0.8em 0.5em 0.4em 0.5em;
-	background: #fff;
-	color: #006;
-	height:25px;
-	margin-bottom: 1px;
-	background-image: url(images/fondoHeader3.jpg);
-}
-.subnav A {
-	PADDING-RIGHT: 15px;
-	DISPLAY: block;
-	PADDING-LEFT: 6px;
-	BACKGROUND:  url(images/tab_right.gif) no-repeat right top;
-	PADDING-BOTTOM: 0px;
-	COLOR: #fff;
-	PADDING-TOP: 5px;
-	TEXT-DECORATION: none;
-}
-.subnav A:hover {
-	COLOR: #83676f;
-}
-.subnav UL {
-	PADDING-RIGHT: 10px;
-	PADDING-LEFT: 10px;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav LI {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-}
-.subnav LI:hover {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	PADDING-TOP: 0px
-}
-.subnav #current {
-}
-.subnav #current A {
-	COLOR: #333
-}
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0 0 0 0;
-	padding: 0 30px 0 0;
-	background-color: transparent;
-	border: none;
-	COLOR: #fff;
-	font-size: 1.0em;
-	font-weight:bold;
-	font-family: verdana, arial, helvetica, sans-serif;
-	display: inline;
-	BACKGROUND:  url(images/salir.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;
-}
-.subnav input:hover {
-	COLOR: #999;
-	BACKGROUND:  url(images/salir.gif) no-repeat right top;
-}
-.subnav input {
-	PADDING-RIGHT: 15px;
-	DISPLAY: block;
-	PADDING-LEFT: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
-}
-.subnav input.logout:hover {
-}
+
+
 #logout {
 	display: inline;
 	float: right;
@@ -503,22 +394,41 @@ a:active {
 	text-align: right;
 	font-size: 1.0em;
 }
+
+
 /*****************************************************
- *  HEADER 3: not used          			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
+.subnav {
+    background-color: #B49FA6; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #B49FA6 0%, #AF8B97 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #B49FA6;
 }
-#header4 a {
-	color: #666;
+.subnav a {
+    color:white;
 }
-#header4 a:hover {
-	text-decoration: none;
-	color: #AF8B97;
+
+.subnav #current a {
+    
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: #333;
+}
+.subnav a:hover {
+    color: #333;
+}
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
+
 /* The tool shortcuts */
 #toolshortcuts {
 	text-align: right;
@@ -2200,25 +2110,7 @@ padding-top: 0px;	padding-right: 0px;	padding-bottom: 0px;	padding-left: 0px;}
 /*****************************************************
  *  BUTTONS	                                         *
  *****************************************************/
-/* BUTTONS */
-button,input[type="submit"] {
-	margin:5px 5px 3px 0px !important;
-	background-color: #DFDFDF;
-	border-width: 1px;
-	/*    -moz-border-radius-topright : 5px;
-    -moz-border-radius-topleft : 5px;
-    -moz-border-radius-bottomright : 5px;
-    -moz-border-radius-bottomleft : 5px;
-*/
-    font-family: bold arial, verdana, helvetica, sans-serif;
-	font-size: 100%;
-	line-height :130%;
-	text-decoration: none;
-	color: black;
-	cursor: pointer;
-	padding:5px 15px 5px 15px;
-	vertical-align:middle;
-}
+
 button:hover input[type="submit"]:hover{
 	background-color:#cbcbcb;
 	color:#545454;
@@ -2230,24 +2122,6 @@ button.add, button.save, button.cancel, button.refresh, button.upload, button.se
 	background-position:10px;
 	background-repeat:no-repeat;
 }
-/* POSITIVE */
-button.save, button.add, button.search, button.refresh, button.upload, button.login, button.plus, button.minus, button.next, button.back, input[type="submit"].submit_next  {
-	background-color:#E5EDF9;
-	border-color: #D4E2F6;
-}
-button.save:hover, button.refresh:hover, button.upload:hover, button.add:hover, button.search:hover, button.login:hover, button.plus:hover, button.minus:hover, button.next:hover, button.back:hover, input[type="submit"].submit_next:hover {
-	border-color: #D4E2F6;
-	background-color:#D4E2F6;
-}
-/* NEGATIVE */
-button.cancel {
-	background-color:#F8E8E6;
-	border-color: #FFE3DE;
-}
-button.cancel:hover {
-	border-color: #F4E1D0;
-	background-color: #FFE3DE;
-}
 /*including "save" image*/
 button.save {
 	background-image:url(images/button_accept.gif);

+ 14 - 79
main/css/public_admin/default.css

@@ -399,93 +399,28 @@ a:active {
 /*****************************************************
  *  HEADER 3: TABS OF THE HEADER			     	 *
  *****************************************************/
-.subnav {
-    font-size: 1.0em;
-    padding: 4px 0px 4px 0px;
-    background: #fff;
-    color: #006;
-    border-bottom: 1px solid #aeaeae;
-    height:25px;
-    margin-bottom: 1px;
-    background-image: url(images/fondoHeader3.jpg);	
-    width:100%;
+.subnav {    
+    background-image: url(images/fondoHeader3.jpg);	    
+}
+
+.subnav a {
+    COLOR: #fff;    
 }
-.subnav A {
-    PADDING-RIGHT: 15px;
-    DISPLAY: block;
-    PADDING-LEFT: 6px;
-    /* BACKGROUND:  url(images/tab_right.gif) no-repeat right top; */
-    PADDING-BOTTOM: 0px;
-    COLOR: #fff;
-    PADDING-TOP: 5px;
-    TEXT-DECORATION: none;
-}
-.subnav A:hover {
+.subnav a:hover {
     COLOR: #9ba408;
     background: none;
 }
-.subnav UL {
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    LIST-STYLE-TYPE: none;    
-}
-.subnav LI {
-    PADDING-RIGHT: 0px;
-    PADDING-LEFT: 9px;
-    FLOAT: left;
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-}
-.subnav LI:hover {
-    PADDING-RIGHT: 0px;
-    PADDING-LEFT: 9px;
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    PADDING-TOP: 0px
-}
-.subnav #current {
-}
+
 .subnav #current A {
     COLOR: #999
 }
-.subnav .banner_links {
-    margin: 0;
-}
-.subnav input.logout {
-    /* makes an input appear like a link in this header */
-    margin: 0 0 0 0;
-    padding: 0 30px 0 0;
-    background-color: transparent;
-    border: none;
-    COLOR: #fff;
-    font-size: 1.0em;
-    font-weight:bold;
-    font-family: verdana, arial, helvetica, sans-serif;
-    display: inline;
-    PADDING-RIGHT: 0px;
-    PADDING-TOP: 3px;
-}
-.subnav input:hover {
-    COLOR: #999;
-}
-.subnav input {
-    PADDING-RIGHT: 15px;
-    DISPLAY: block;
-    PADDING-LEFT: 6px;
-}
-.subnav #logout {
-    margin-top: 0px;
-}
-.subnav input.logout:hover {
-}
-#logout {
-    display: inline;
-    float: right;
-    width: auto;
-    text-align: right;
-    font-size: 1.0em;
+
+.subnav .nav > li > a {
+    border-left: none;
+    border-radius: 0 0 0 0;
+    border-right: none;
 }
+
 /*****************************************************
  *  HEADER 4
  *****************************************************/

+ 31 - 2
main/css/responsive.css

@@ -11,8 +11,7 @@
     
     header #header_center, header #header_right {
         display:none;
-    }
-    
+    }    
     
     #footer_left , #footer_right #admin_name, #footer_right #software_name {
         text-align: center !important;
@@ -97,6 +96,36 @@
             -moz-border-radius: 4px 4px 0 0;
                 border-radius: 4px 4px 0 0;
     }
+    
+    
+     /* .new_actions */
+    .new_actions {           
+        border:1px solid #fff;
+        position: static;
+        top: auto;
+        z-index: auto;
+        width: 100%;
+        height: auto;    
+        -webkit-box-shadow: none;
+            -moz-box-shadow: none;
+                box-shadow: none;
+                text-align: center;
+    }
+    .new_actions .nav > li {
+        float: none;    
+    }
+    .new_actions .nav > li > a {
+        border: 0;
+    }
+    .new_actions .nav > li + li > a {
+        border-top: 1px solid #e5e5e5;
+    }
+    .new_actions .nav > li:first-child > a,
+    .new_actions .nav > li:first-child > a:hover {
+        -webkit-border-radius: 4px 4px 0 0;
+            -moz-border-radius: 4px 4px 0 0;
+                border-radius: 4px 4px 0 0;
+    }
 
 
     /* Unfloat the back to top link in footer */

+ 34 - 83
main/css/royal_purple/default.css

@@ -339,88 +339,53 @@ a:active {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
+
 #institution {
 	float: left;
 }
-#my_courses {
-	float: right;
-}
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
+
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;	
-    width:100%;
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
-}
-.subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
+    color:white;
 }
 
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
+.subnav #current a {
+    background-color: #8E5B97; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #8E5B97 0%, #B793BD 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8E5B97), color-stop(100%,#B793BD)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #8E5B97 0%, #B793BD 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #8E5B97 0%,#B793BD 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #8E5B97 0%,#B793BD 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8E5B97', endColorstr='#B793BD',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #8E5B97 0%, #B793BD 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
+
 #logout {
 	display: inline;
 	float: right;
@@ -428,20 +393,6 @@ a:active {
 	text-align: right;
 }
 
-/*****************************************************
- *  HEADER 4
- *****************************************************/
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
-}
-
-#header4 a:hover {
-	text-decoration: none;
-	color: #a8a7a7;
-}
 /* The tool shortcuts */
 #toolshortcuts {
 	text-align: right;

+ 4 - 144
main/css/silver_line/default.css

@@ -74,6 +74,8 @@ ul {
     list-style: none;
 }
 
+
+
 /*
 -----------------------------------------------------------------------------
 Menu Slide JQuery
@@ -369,121 +371,11 @@ ul#navigation .student-connect a {
     margin-bottom: .5em;
     position:relative;
 }
-/*
-------------------------------------------------------------------------------
-    HEADER 1: Title, portal, organisation, course title
-------------------------------------------------------------------------------
-*/
 
-#header1 {
-    width: 100%;
-    float: left;
-}
-#header1 #my_courses {
-    display: none;
-    visibility: hidden;
-}
-#top_corner {
-}
 #institution {
     margin: 0 0 0 3.9em;
 }
-/*
-------------------------------------------------------------------------------
-    HEADER 2: Users online, help, student/teacher view
-------------------------------------------------------------------------------
-*/
 
-#header2 {
-    width: 100%;
-    position: relative; /* to avoid the IE peekabo bug*/
-    height:90px;
-}
-#header2 ul {
-    list-style: none;
-    margin: 0 1.9em 0 0;
-    padding: 0;
-}
-#header2 ul li {
-    display: inline;
-    width: auto;
-    margin: 0 .1em 0 .2em;
-    padding: 0;
-}
-
-/*
-------------------------------------------------------------------------------
-    HEADER 3: Main menu
-------------------------------------------------------------------------------
-*/
-
-.subnav {
-    width: 100%;
-
-    padding: 0;
-}
-.subnav input.logout {
-    /* makes an input appear like a link in this header */
-    background-color: transparent;
-    border: none;
-    color: #000;
-    height: auto;
-    display: inline;
-    line-height: 1em;
-    font: bold 1em Arial, sans-serif, sans;
-    margin: -.3em 0 0 2em;
-    padding: 0;
-}
-.subnav form {
-    margin: 0;
-    padding: 0;
-}
-.subnav #logout {
-    display: inline;
-    float: right;
-    clear: right;
-    margin: 0 1.5em 0 0;
-    padding: 0;
-    width: 10%;
-}
-.subnav #logout li {
-    display: block;
-    margin: 0;
-    padding: 0;
-    float: right;
-    clear: right;
-}
-
-.subnav ul {
-    PADDING-RIGHT: 10px;
-    PADDING-LEFT: 10px;
-    PADDING-BOTTOM: 0px;
-    MARGIN: 5px;
-    LIST-STYLE-TYPE: none;    
-}
-.subnav ul li {
-    float: left;
-    display: inline;
-    list-style: none;
-    margin: 0 1em 0 0;
-    padding: 0;
-    width: auto;
-}
-.subnav ul li a {
-    display: inline;
-}
-/*
-------------------------------------------------------------------------------
-    HEADER 4:
-------------------------------------------------------------------------------
-*/
-
-#header4 { 
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%;
-}
 
 /*
 ------------------------------------------------------------------------------
@@ -1283,14 +1175,12 @@ div.system_announcement {
 .survey_question_wrapper {
     border: 1px solid #4271b5;
 }
-.survey_question {
-    /* 264269 4271b5 E5EDF9 */
+.survey_question {    
     background-color:#4271b5;
     color:#FFFFFF;
     padding:5px;/*border: 1px solid #264269;*/
 }
-.survey_question_options {
-    /* 264269 4271b5 E5EDF9 */
+.survey_question_options {    
     background-color:#FFF;
     color:#000;
     padding:5px;/*border: 1px solid #264269;*/
@@ -1802,36 +1692,6 @@ span.radio {
 /*****************************************************
  *  BUTTONS	                                         *
  *****************************************************/
-
-button:hover input[type="submit"]:hover {
-    background-color:#cbcbcb;
-    color:#545454;
-    border-style: inset;
-}
-/* button with image */
-button.add, button.save, button.cancel, button.refresh, button.upload, button.search, button.login, button.plus, button.minus, button.next, button.back, input[type="submit"].submit_next {
-    padding-left:30px;
-    background-position:10px;
-    background-repeat:no-repeat;
-}
-/* POSITIVE */
-button.save, button.add, button.search, button.refresh, button.upload, button.login, button.plus, button.minus, button.next, button.back, input[type="submit"].submit_next {
-    background-color:#E5EDF9;
-    border-color: #D4E2F6;
-}
-button.save:hover, button.refresh:hover, button.upload:hover, button.add:hover, button.search:hover, button.login:hover, button.plus:hover, button.minus:hover, button.next:hover, button.back:hover, input[type="submit"].submit_next:hover {
-    border-color: #D4E2F6;
-    background-color:#D4E2F6;
-}
-/* NEGATIVE */
-button.cancel {
-    background-color:#F8E8E6;
-    border-color: #FFE3DE;
-}
-button.cancel:hover {
-    border-color: #F4E1D0;
-    background-color: #FFE3DE;
-}
 /*including "save" image*/
 button.save {
     background-image:url(images/button_accept.gif);

+ 2 - 129
main/css/sober_brown/default.css

@@ -347,140 +347,13 @@ a:active {
     margin: 0;
     font-weight: bold;
 }
-#top_corner {
-}
+
 #institution {
     float: left;
     font-weight: bold;
     padding-left:17px;
 }
-#my_courses {
-    float: right;
-    font-weight: bold;
-}
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-    font-size: 1.0em;
-    font-weight: normal;
-    min-height:35px;
-    background: #716D61;
-    width:100%;
-    color: #666;
-}
-#header2 a {
-    color: #666;
-    text-decoration: none;
-    font-weight:normal;
-}
-#header2 a:hover {
-    text-decoration: underline;
-}
-/*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
- *****************************************************/
-.subnav {
-    font-size: 1.0em;
-    padding: 4px 0px 4px 0px;
-    background: #fff;
-    color: #006;
-    border-bottom: 1px solid #aeaeae;
-    height:25px;
-    margin-bottom: 1px;
-    width:100%;
-}
-.subnav A {
-    PADDING-RIGHT: 15px;
-    DISPLAY: block;
-    PADDING-LEFT: 6px;
-    BACKGROUND:  url(images/tab_right.gif) no-repeat right top;
-    PADDING-BOTTOM: 0px;
-    COLOR: #333;
-    PADDING-TOP: 5px;
-    TEXT-DECORATION: none;
-}
-.subnav A:hover {
-    COLOR: #999;
-}
-.subnav UL {    
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    LIST-STYLE-TYPE: none;    
-}
-.subnav LI {
-    PADDING-RIGHT: 0px;
-    PADDING-LEFT: 9px;
-    FLOAT: left;
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    PADDING-TOP: 0px;/*border-bottom: 1px solid #dcdcdc;*/
-}
-.subnav LI:hover {
-    PADDING-RIGHT: 0px;
-    PADDING-LEFT: 9px;
-    PADDING-BOTTOM: 0px;
-    MARGIN: 0px;
-    PADDING-TOP: 0px
-}
-.subnav #current {
-}
-.subnav #current A {
-    COLOR: #999
-}
-.subnav .banner_links {
-    margin: 0;
-}
-.subnav input.logout {
-    /* makes an input appear like a link in this header */
-    margin: 0 0 0 0;
-    padding: 0 30px 0 0;
-    background-color: transparent;
-    border: none;
-    color: #333;
-    font-size: 1.0em;
-    font-weight:bold;
-    font-family: verdana, arial, helvetica, sans-serif;
-    display: inline;
-    padding-right: 0px;
-    padding-top: 3px;
-}
-.subnav input:hover {
-    COLOR: #999;
-}
-.subnav input {
-    PADDING-RIGHT: 15px;
-    DISPLAY: block;
-    PADDING-LEFT: 6px;
-}
-.subnav #logout {
-    margin-top: 0px;
-}
-.subnav input.logout:hover {
-}
-#logout {
-    display: inline;
-    float: right;
-    width: auto;
-    text-align: right;
-    font-size: 1.0em;
-    color:#333;
-}
-/*****************************************************
- *  HEADER 4
- *****************************************************/
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    width:100%;
-}
-#header4 a {
-    color: #666;
-}
-#header4 a:hover {
-    text-decoration: none;
-    color: #f3840d;
-}
+
 /* The tool shortcuts */
 #toolshortcuts {
     text-align: right;

+ 31 - 78
main/css/steel_grey/default.css

@@ -373,79 +373,46 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 #my_courses {
 	float: right;
 }
-/********************************************************
- *  HEADER 2: Users online, help, student/teacher view	*
- ********************************************************/
-#header2 {
-	position: relative; /* to avoid the IE peekabo bug*/
-	color: #636363;/*border: 1px solid red;*/
-	min-height: 25px;
-}
-#header2 a {
-	color: #636363;
-	text-decoration: none;
-	font-weight:normal;
-}
-#header2 a:hover {
-	text-decoration: underline;
-}
+
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width: 100%;
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
+    background-color: #808080; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #808080 0%, #A5A5A5 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#808080), color-stop(100%,#A5A5A5)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #808080 0%, #A5A5A5 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #808080 0%,#A5A5A5 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #808080 0%,#A5A5A5 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#808080', endColorstr='#A5A5A5',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #808080 0%, #A5A5A5 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav input.logout:hover {
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 #logout {
 	display: inline;
@@ -453,20 +420,6 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
 	width: auto;
 	text-align: right;
 }
-/*****************************************************
- *  HEADER 4
- *****************************************************/
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px; 
-    width:100%;
-}
-
-#header4 a:hover {
-	text-decoration: none;
-	color: #a8a7a7;
-}
 /* The tool shortcuts */
 #toolshortcuts {
 	text-align: right;

+ 32 - 106
main/css/tasty_olive/default.css

@@ -320,131 +320,57 @@ a:active {
 	padding: 0;
 	margin: 0;
 }
-/********************************************************
- *  HEADER 1: Title, portal, organisation, course title	*
- ********************************************************/
-#header1 {
-	padding: 4px;
-	color: #8e975b;
-}
-#header1 a {
-	color: #636363;
-	text-decoration: none;
-}
-#header1 a:hover {
-	text-decoration: underline;
-}
+
 #sitename {
 	margin: 0;
 	font-weight: bold;
 }
-#top_corner {
-}
+
 #institution {
 	float: left;
 }
-#my_courses {
-	float: right;
-}
 
 /*****************************************************
- *  HEADER 3: TABS OF THE HEADER			     	 *
+ *  TABS OF THE HEADER			     	 *
  *****************************************************/
 .subnav {
-	background-image: url(images/tab-repeat.png);
-	background-position: 0px 0px;
-	background-repeat: repeat-x;/*border: 1px solid green;*/
-	height:41px;
-    width:100%;    
+    background-color: #4C4C4C; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4C4C4C), color-stop(100%,#747474)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #4C4C4C 0%, #747474 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #4C4C4C 0%,#747474 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C4C4C', endColorstr='#747474',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #4C4C4C 0%, #747474 100%); /* W3C */
+    border: 1px solid #4C4C4C;
 }
 .subnav a {
-	DISPLAY: block;
-	PADDING-RIGHT: 15px;
-	PADDING-LEFT: 6px;
-	COLOR: #fff;
-    float:left;
-	PADDING-TOP: 10px;
-}
-.subnav a:hover {
-	color: #a8a7a7;
-    background: none;
-}
-.subnav ul {
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	LIST-STYLE-TYPE: none;	
-}
-.subnav li {
-	PADDING-RIGHT: 0px;
-	PADDING-LEFT: 9px;
-	FLOAT: left;
-	PADDING-BOTTOM: 0px;
-	MARGIN: 0px;
-	padding-top: 10px;	
-}
-.subnav li#current {
-	background:  url(images/tab-left.png) no-repeat top left;
-	padding-top: 0px;
-	height: 41px;
-	float: left;
+    color:white;
 }
+
 .subnav #current a {
-	background:  url(images/tab-right.png) no-repeat top right;
-	height: 31px;
-}
-.subnav .banner_links {
-	margin: 0;
-}
-.subnav input.logout {
-	/* makes an input appear like a link in this header */
-	margin: 0px;
-	padding: 0px;
-	background-color: transparent;
-	border: none;
-	COLOR: rgb(39,84,175);
-	font-weight:bold;
-	display: inline;
-	background:  url(../../img/tab_right.gif) no-repeat right top;
-	PADDING-RIGHT: 10px;
-	PADDING-TOP: 3px;
+    background-color: #8E975B; /* Old browsers */
+    background-repeat: repeat-x; /* Repeat the gradient */
+    background-image: -moz-linear-gradient(top, #8E975B 0%, #B7BD93 100%); /* FF3.6+ */  
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8E975B), color-stop(100%,#B7BD93)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #8E975B 0%, #B7BD93 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #8E975B 0%,#B7BD93 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #8E975B 0%,#B7BD93 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8E975B', endColorstr='#B7BD93',GradientType=0 ); /* IE6-9 */
+    background-image: linear-gradient(top, #8E975B 0%, #B7BD93 100%); /* W3C */
+}
+.subnav .nav > #current > a, .subnav .nav > #current > a:hover {
+    color: white;
 }
-.subnav input:hover {
-	color: #333;
-	background:  url(../../img/tab_right_hover.gif) no-repeat right top;
-}
-.subnav input {
-	padding-right: 15px;
-	display: block;
-	padding-left: 6px;
-}
-.subnav #logout {
-	margin-top: 0px;
-}
-.subnav input.logout:hover {
-}
-#logout {
-	display: inline;
-	float: right;
-	width: auto;
-	text-align: right;
+.subnav a:hover {
+    color: #a8a7a7;
 }
-.subnav .clear {
-	display: none;
-}
-/*****************************************************
- *  HEADER 4
- *****************************************************/
-#header4 {
-    background-color: #fff;
-    color: #fff;
-    margin-bottom: 2px;
-    width:100%; 
+.subnav .nav > li > a {
+    border-left: none;    
+    border-right: none;
 }
 
-#header4 a:hover {
-	text-decoration: none;
-	color: #a8a7a7;
-}
 /* The tool shortcuts */
 #toolshortcuts {
 	text-align: right;

+ 86 - 50
main/exercice/exercise.class.php

@@ -19,7 +19,7 @@ define('EXERCISE_FEEDBACK_TYPE_EXAM',       2); //NoFeedback 	 - Show score only
 
 define('EXERCISE_MAX_NAME_SIZE',            80);
 
-$debug = 0; //All exercise scripts should depend in this debug variable
+$debug = true; //All exercise scripts should depend in this debug variable
 
 require_once dirname(__FILE__).'/../inc/lib/exercise_show_functions.lib.php';
 
@@ -359,7 +359,7 @@ class Exercise {
 	/**
 	 * returns random answers status.
 	 *
-	 * @author - Juan Carlos Raa
+	 * @author - Juan Carlos Ra�a
 	 */
 	function selectRandomAnswers() {
 		$this->random_answers;
@@ -599,7 +599,7 @@ class Exercise {
 	/**
 	 * sets to 0 if answers are not selected randomly
 	 * if answers are selected randomly
-	 * @author - Juan Carlos Raa
+	 * @author - Juan Carlos Ra�a
 	 * @param - integer $random_answers - random answers
 	 */
 	function updateRandomAnswers($random_answers) {
@@ -1818,18 +1818,18 @@ class Exercise {
 	public function manage_answer($exeId, $questionId, $choice, $from = 'exercise_show', $exerciseResultCoordinates = array(), $saved_results = true, $from_database = false, $show_result = true, $propagate_neg = 0, $hotspot_delineation_result = array()) {
 		global $_configuration, $feedback_type, $debug;		
 		require_once api_get_path(LIBRARY_PATH).'geometry.lib.php';
-
-		if ($debug) error_log('manage_answer called exe_id '.$exeId);
-		if ($debug) error_log('manage_answer $from  '.$from);
-		if ($debug) error_log('manage_answer $saved_results  '.$saved_results);
-		if ($debug) error_log('manage_answer $from_database '.$from_database);
-		if ($debug) error_log('manage_answer $show_result '.$show_result);
-		if ($debug) error_log('manage_answer $propagate_neg '.$propagate_neg);
-		if ($debug) error_log('manage_answer $hotspot_delineation_result '.print_r($hotspot_delineation_result, 1));
+        
+        if ($debug) error_log("<------ manage_answer ------> ");
+		if ($debug) error_log('manage_answer called exe_id: '.$exeId);
+		if ($debug) error_log('manage_answer $from:  '.$from);
+		if ($debug) error_log('manage_answer $saved_results: '.$saved_results);
+		if ($debug) error_log('manage_answer $from_database: '.$from_database);
+		if ($debug) error_log('manage_answer $show_result: '.$show_result);
+		if ($debug) error_log('manage_answer $propagate_neg: '.$propagate_neg);
+		if ($debug) error_log('manage_answer $hotspot_delineation_result: '.print_r($hotspot_delineation_result, 1));
 			
 		$extra_data = array();
-		$html = '';
-		 
+				 
 		$questionId   = intval($questionId);
 		$exeId        = intval($exeId);
 		$TBL_TRACK_ATTEMPT      = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
@@ -1868,9 +1868,8 @@ class Exercise {
 		$objAnswerTmp = new Answer($questionId);
 		$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
 
-		if ($debug) error_log('Count of answers :'.$nbrAnswers);
-		if ($debug) error_log('$answerType : '.$answerType);
-
+		if ($debug) error_log('Count of answers: '.$nbrAnswers);
+		if ($debug) error_log('$answerType: '.$answerType);
 
 		if ($answerType == FREE_ANSWER || $answerType == ORAL_EXPRESSION) {
 			$nbrAnswers = 1;
@@ -1916,18 +1915,26 @@ class Exercise {
 		$organs_at_risk_hit = 0;
 
 		$questionScore = 0;
-		 
+		if ($debug) error_log('Start answer loop ');
+        
+        $answer_correct_array = array();
+        
 		for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
 			$answer             = $objAnswerTmp->selectAnswer($answerId);			
 			$answerComment      = $objAnswerTmp->selectComment($answerId);
 			$answerCorrect      = $objAnswerTmp->isCorrect($answerId);
 			$answerWeighting    = $objAnswerTmp->selectWeighting($answerId);
 			$numAnswer          = $objAnswerTmp->selectAutoId($answerId);
+            
+            $answer_correct_array[$answerId] = (bool)$answerCorrect;
+            
+            if ($debug) error_log("answer auto id: $numAnswer ");
+            if ($debug) error_log("answer correct : $answerCorrect ");
 
 			//delineation
 			$delineation_cord   = $objAnswerTmp->selectHotspotCoordinates(1);
 			$answer_delineation_destination=$objAnswerTmp->selectDestination(1);
-
+            
 			switch ($answerType) {
 				// for unique answer
 				case UNIQUE_ANSWER :
@@ -1982,32 +1989,34 @@ class Exercise {
 						//if no result then the user just hit don't know
 						$studentChoice = 3;
 						$questionScore  +=  $doubt_score;
-					}
-					
+					}					
 					$totalScore = $questionScore;
 					break;
-				case MULTIPLE_ANSWER :
+				case MULTIPLE_ANSWER : //2                    
 					if ($from_database) {
-						$choice=array();
-						$queryans = "SELECT answer FROM ".$TBL_TRACK_ATTEMPT." where exe_id = '".$exeId."' and question_id= '".$questionId."'";
+						$choice = array();
+						$queryans = "SELECT answer FROM ".$TBL_TRACK_ATTEMPT." WHERE exe_id = '".$exeId."' AND question_id= '".$questionId."'";                        
 						$resultans = Database::query($queryans);
 						while ($row = Database::fetch_array($resultans)) {
 							$ind = $row['answer'];
 							$choice[$ind] = 1;
 						}
-						$numAnswer=$objAnswerTmp->selectAutoId($answerId);
-						$studentChoice=$choice[$numAnswer];
-						if ($studentChoice) {
-							$questionScore  +=$answerWeighting;
-							$totalScore     +=$answerWeighting;
+						$numAnswer = $objAnswerTmp->selectAutoId($answerId);
+						$studentChoice = $choice[$numAnswer];  
+                        $real_answers[$answerId] = (bool)$studentChoice;
+						if ($studentChoice == $answerCorrect) {
+							$questionScore  +=$answerWeighting;							                            
 						}
 					} else {
-						$studentChoice=$choice[$numAnswer];
-						if ($studentChoice) {
+						$studentChoice = $choice[$numAnswer];
+						if ($studentChoice == $answerCorrect) {
 							$questionScore  +=$answerWeighting;
-							$totalScore     +=$answerWeighting;
 						}
+                        $real_answers[$answerId] = (bool)$studentChoice;
 					}
+                    $totalScore     +=$answerWeighting;
+                    
+                    if ($debug) error_log("studentChoice: $studentChoice");
 					break;
 				case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE:
 					if ($from_database) {
@@ -2336,10 +2345,8 @@ class Exercise {
 						break;
 					}
 					// for hotspot with no order
-				case HOT_SPOT :
-					
-					if ($from_database) {
-						
+				case HOT_SPOT :					
+					if ($from_database) {						
 						if ($show_result) {
 							$TBL_TRACK_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
 							$query = "SELECT hotspot_correct FROM ".$TBL_TRACK_HOTSPOT." WHERE hotspot_exe_id = '".$exeId."' and hotspot_question_id= '".$questionId."' AND hotspot_answer_id='".Database::escape_string($answerId)."'";
@@ -2405,11 +2412,14 @@ class Exercise {
 					$_SESSION['hotspot_dest'][1]	= $answer_delineation_destination;
 					break;
 			} // end switch Answertype
+            
 
-			global $origin, $debug;
+			global $origin;
 
 			if ($show_result) {
-
+                
+                if ($debug) error_log('show result '.$show_result);
+                
 				if ($from == 'exercise_result') {
 					if ($debug) error_log('Showing questions $from '.$from);
 					//display answers (if not matching type, or if the answer is correct)
@@ -2821,7 +2831,10 @@ class Exercise {
 					}
 				}
 			}
+            if ($debug) error_log(' ------ ');
 		} // end for that loops over all answers of the current question
+        
+        if ($debug) error_log('-- end answer loop --');
 
 		
 		// destruction of Answer
@@ -2833,7 +2846,7 @@ class Exercise {
 		}
 
 		$final_answer = true;
-		foreach($real_answers as $my_answer) {
+		foreach ($real_answers as $my_answer) {
 			if (!$my_answer) {
 				$final_answer = false;
 			}
@@ -2848,6 +2861,27 @@ class Exercise {
 				$totalScore         += $answerWeighting;
 			}
 		}
+        
+        //Fixes multiple answer question in order to be exact 
+        if ($answerType == MULTIPLE_ANSWER) {
+            $counter = 1;            
+            $correct_answer = true;
+            foreach ($real_answers as $my_answer) {
+                if ($debug) error_log(" my_answer: $my_answer answer_correct_array[counter]: ".$answer_correct_array[$counter]);
+                if ($my_answer != $answer_correct_array[$counter]) {
+                    $correct_answer = false;
+                    break;
+                }
+                $counter++;    
+            }            
+            if ($debug) error_log(" answer_correct_array: ".print_r($answer_correct_array, 1)."");
+            if ($debug) error_log(" real_answers: ".print_r($real_answers, 1)."");
+            if ($debug) error_log(" correct_answer: ".$correct_answer);
+                        
+            if ($correct_answer == false) {
+                $questionScore = 0;
+            }
+        } 
 
 		$extra_data = array('final_overlap' => $final_overlap, 'final_missing'=>$final_missing, 'final_excess'=> $final_excess,
         					'overlap_color' => $overlap_color, 'missing_color'=>$missing_color, 'excess_color'=> $excess_color,
@@ -3015,14 +3049,15 @@ class Exercise {
 		// Store results directly in the database
 		// For all in one page exercises, the results will be
 		// stored by exercise_results.php (using the session)
-
+        
 		if ($saved_results) {
+            if ($debug) error_log("Save question results $saved_results");
+            if ($debug) error_log(print_r($choice ,1 ));
+            
 			if (empty($choice)) {
 				$choice = 0;
 			}
 			if ($answerType ==  MULTIPLE_ANSWER_TRUE_FALSE || $answerType ==  MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE ) {
-				
-				if ($debug) error_log(print_r($choice ,1 ));
 				if ($choice != 0) {
 					$reply = array_keys($choice);
 					for ($i = 0; $i < sizeof($reply); $i++) {
@@ -3036,6 +3071,7 @@ class Exercise {
 			} elseif ($answerType == MULTIPLE_ANSWER) {
 				if ($choice != 0) {
 					$reply = array_keys($choice);
+                    if ($debug) error_log("reply ".print_r($reply, 1)."");
 					for ($i = 0; $i < sizeof($reply); $i++) {
 						$ans = $reply[$i];
 						exercise_attempt($questionScore, $ans, $quesId, $exeId, $i, $this->id);
@@ -3454,16 +3490,16 @@ class Exercise {
 				$tabCategoryQuestions = array();
 				$tabCategoryQuestions = Testcategory::getQuestionsByCat($this->id);
 				$isRandomByCategory = $this->selectRandomByCat();
-				// on tri les catégories en fonction du terme entre [] en tête de la description de la catégorie
+				// on tri les catégories en fonction du terme entre [] en tête de la description de la catégorie
 				/*
-				 * ex de catégories :
-				 * [biologie] Maîtriser les mécanismes de base de la génétique
-				 * [biologie] Relier les moyens de défenses et les agents infectieux
-				 * [biologie] Savoir où est produite l'énergie dans les cellules et sous quelle forme
-				 * [chimie] Classer les molécules suivant leur pouvoir oxydant ou réducteur
-				 * [chimie] Connaître la définition de la théorie acide/base selon Brönsted
-				 * [chimie] Connaître les charges des particules
-				 * On veut dans l'ordre des groupes définis par le terme entre crochet au début du titre de la catégorie
+				 * ex de catégories :
+				 * [biologie] Maîtriser les mécanismes de base de la génétique
+				 * [biologie] Relier les moyens de défenses et les agents infectieux
+				 * [biologie] Savoir où est produite l'énergie dans les cellules et sous quelle forme
+				 * [chimie] Classer les molécules suivant leur pouvoir oxydant ou réducteur
+				 * [chimie] Connaître la définition de la théorie acide/base selon Brönsted
+				 * [chimie] Connaître les charges des particules
+				 * On veut dans l'ordre des groupes définis par le terme entre crochet au début du titre de la catégorie
 				*/
 				// If test option is Grouped By Categories
 				if ($isRandomByCategory == 2) {

+ 2 - 1
main/exercice/exercise_result.php

@@ -45,7 +45,7 @@ api_protect_course_script(true);
 // Database table definitions
 $main_admin_table       = Database::get_main_table(TABLE_MAIN_ADMIN);
 
-if($debug>0){error_log('Entered exercise_result.php: '.print_r($_POST,1));}
+if ($debug){ error_log('Entering exercise_result.php: '.print_r($_POST,1));}
 
 // general parameters passed via POST/GET
 if ( empty ( $origin ) ) {                  $origin                 = Security::remove_XSS($_REQUEST['origin']);}
@@ -165,6 +165,7 @@ $total_score = $total_weight = 0;
 
 // Loop over all question to show results for each of them, one by one
 if (!empty($question_list)) {
+    if ($debug) { error_log('Looping question_list '.print_r($question_list,1));}
 	foreach ($question_list as $questionId) {
 	    // destruction of the Question object
 		unset($objQuestionTmp);

+ 2 - 3
main/exercice/exercise_show.php

@@ -20,7 +20,6 @@ $language_file = array('exercice');
 require_once 'exercise.class.php';
 require_once 'question.class.php'; //also defines answer type constants
 require_once 'answer.class.php';
-
 require_once '../inc/global.inc.php';
 require_once 'exercise.lib.php';
 
@@ -42,11 +41,11 @@ $TBL_QUESTIONS         	= Database::get_course_table(TABLE_QUIZ_QUESTION);
 $TBL_REPONSES          	= Database::get_course_table(TABLE_QUIZ_ANSWER);
 $main_user_table 		= Database::get_main_table(TABLE_MAIN_USER);
 $main_course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
-$TBL_TRACK_EXERCICES	= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
+$TBL_TRACK_EXERCICES    = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
 $TBL_TRACK_ATTEMPT		= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
 
 // General parameters passed via POST/GET
-if($debug) { error_log('Entered exercise_result.php: '.print_r($_POST,1)); }
+if ($debug) { error_log('Entered exercise_result.php: '.print_r($_POST,1)); }
 
 if ( empty ( $formSent ) ) {            $formSent       = $_REQUEST['formSent']; }
 if ( empty ( $exerciseResult ) ) {      $exerciseResult = $_SESSION['exerciseResult'];}

+ 56 - 78
main/exercice/exercise_submit.php

@@ -159,7 +159,6 @@ if ($time_control) {
 	$current_expired_time_key = generate_time_control_key($objExercise->id);
 }
 
-
 $show_clock = true;
 $user_id = api_get_user_id();
 if ($objExercise->selectAttempts() > 0) {
@@ -220,42 +219,44 @@ if ($objExercise->selectAttempts() > 0) {
 
 
 
-if ($debug) { error_log("4. Setting the exe_id $exe_id");} ;
+if ($debug) { error_log("4. Setting the exe_id: $exe_id");} ;
 
 //5. Getting user exercise info (if the user took the exam before) - generating exe_id
 //var_dump($safe_lp_id.' - '.$safe_lp_item_id.' - '.$safe_lp_item_view_id);
 $exercise_stat_info = $objExercise->get_stat_track_exercise_info($safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id);
 
 if (empty($exercise_stat_info)) {
+    if ($debug)  error_log('5  $exercise_stat_info is empty ');
 	$total_weight = 0;
 	$questionList = $objExercise->get_validated_question_list();	
-	foreach($questionList as $question_id) {
+	foreach ($questionList as $question_id) {
 		$objQuestionTmp = Question::read($question_id);
 		$total_weight += floatval($objQuestionTmp->weighting);
 	}
 	$clock_expired_time = '';
+    
 	if ($time_control) {
 		$expected_time = $current_timestamp + $total_seconds;
 		
-		if ($debug)  error_log('6.3. $current_timestamp '.$current_timestamp);
-		if ($debug)  error_log('6.4. $expected_time '.$expected_time);
+		if ($debug)  error_log('5.1. $current_timestamp '.$current_timestamp);
+		if ($debug)  error_log('5.2. $expected_time '.$expected_time);
 		
 		$clock_expired_time 	= api_get_utc_datetime($expected_time);
-		if ($debug) error_log('6.5. $expected_time '.$clock_expired_time);
+		if ($debug) error_log('5.3. $expected_time '.$clock_expired_time);
 		
 		//Sessions  that contain the expired time
 		$_SESSION['expired_time'][$current_expired_time_key] 	 = $clock_expired_time;
-		if ($debug) {
-			error_log('6.6. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] );
-		};
+		if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
 	}
 	$exe_id = $objExercise->save_stat_track_exercise_info($clock_expired_time, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id, $questionList, $total_weight);
 	$exercise_stat_info = $objExercise->get_stat_track_exercise_info($safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id);	
+    if ($debug)  error_log("5.5  exercise_stat_info[] exists getting exe_id $exe_id");
 } else {
 	$exe_id = $exercise_stat_info['exe_id'];
+    if ($debug)  error_log("5  exercise_stat_info[] exists getting exe_id $exe_id ");
 }
 
-if ($debug) { error_log('5. $objExercise->get_stat_track_exercise_info function called::  '.print_r($exercise_stat_info, 1)); };
+if ($debug) { error_log('6. $objExercise->get_stat_track_exercise_info function called::  '.print_r($exercise_stat_info, 1)); };
 
 if (!empty($exercise_stat_info['questions_to_check'])) {
 	$my_remind_list = $exercise_stat_info['questions_to_check'];
@@ -264,29 +265,30 @@ if (!empty($exercise_stat_info['questions_to_check'])) {
 }
 
 $params = 'exe_id='.$exe_id.'&exerciseId='.$exerciseId.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpath_item_view_id;
-if ($debug) { error_log("5.1 params: ->  $params"); };
+if ($debug) { error_log("6.1 params: ->  $params"); };
 
 if ($reminder == 2 && empty($my_remind_list)) {	
+    if ($debug) { error_log("6.2 calling the exercise_reminder.php "); };
 	header('Location: exercise_reminder.php?'.$params);
 	exit;
 }
 
 /*
- * 6. Loading Time control parameters
+ * 7. Loading Time control parameters
  * If the expired time is major that zero(0) then the expired time is compute on this time. Disable for learning path
  */
 
 if ($time_control) {
-	if ($debug) error_log('6.1. Time control is enabled');	
-	if ($debug) {error_log('6.2. $current_expired_time_key  '.$current_expired_time_key); };
-	if ($debug) { error_log('6.2. $_SESSION[expired_time][$current_expired_time_key]  '.$_SESSION['expired_time'][$current_expired_time_key]); };
+	if ($debug) error_log('7.1. Time control is enabled');	
+	if ($debug) error_log('7.2. $current_expired_time_key  '.$current_expired_time_key);
+	if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key]  '.$_SESSION['expired_time'][$current_expired_time_key]);
 	
     if (!isset($_SESSION['expired_time'][$current_expired_time_key])) {
         //Timer - Get expired_time for a student        
         if (!empty($exercise_stat_info)) {
-        	if ($debug) {error_log('6.3 Seems that the session ends and the user want to retake the exam'); };        	
+        	if ($debug) {error_log('7.4 Seems that the session ends and the user want to retake the exam'); };        	
 	        $expired_time_of_this_attempt = $exercise_stat_info['expired_time_control'];
-			if ($debug) {error_log('$expired_time_of_this_attempt: '.$expired_time_of_this_attempt); }			
+			if ($debug) {error_log('7.5 $expired_time_of_this_attempt: '.$expired_time_of_this_attempt); }			
 	        //Get the last attempt of an exercice
 	    	$last_attempt_date = get_last_attempt_date_of_exercise($exercise_stat_info['exe_id']);
 	    	
@@ -299,31 +301,33 @@ if ($time_control) {
 	    		$diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC');
 	    		$last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff);
 	    	}
-	        if ($debug) {error_log('6.4. $last_attempt_date: '.$last_attempt_date); }
+	        if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); }
 	        	
 	        //New expired time - it is due to the possible closure of session
 	        $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC');
-	        if ($debug) {error_log('6.5. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); }	        
+	        if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); }	        
 	        
 	        $expected_time	= $current_timestamp + $new_expired_time_in_seconds;
-	        if ($debug) {error_log('6.6. $expected_time1: '.$expected_time); }
+	        if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); }
 	        	        			
 	        $clock_expired_time  = api_get_utc_datetime($expected_time);
-	        if ($debug) {error_log('6.7. $clock_expired_time: '.$clock_expired_time); }
+	        if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); }
 	        	              		
 			// First we update the attempt to today
 			// How the expired time is changed into "track_e_exercices" table,then the last attempt for this student should be changed too,so
 	        $sql_track_e_exe = "UPDATE $exercice_attemp_table SET tms = '".api_get_utc_datetime()."' WHERE exe_id = '".$exercise_stat_info['exe_id']."' AND tms = '".$last_attempt_date."' ";
-	        if ($debug) {error_log('6.8. $sql_track_e_exe2: '.$sql_track_e_exe); }
+	        if ($debug) {error_log('7.10. $sql_track_e_exe2: '.$sql_track_e_exe); }
 	        Database::query($sql_track_e_exe);
 	        	
 	        //Sessions  that contain the expired time
 	        $_SESSION['expired_time'][$current_expired_time_key] 		= $clock_expired_time;
-	        if ($debug) {error_log('6.9. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
+	        if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
         }
     } else {
         $clock_expired_time =  $_SESSION['expired_time'][$current_expired_time_key];
     }
+} else {
+    if ($debug) { error_log("7 No time control"); };
 }
 
 // Get time left for exipiring time
@@ -337,24 +341,6 @@ if ($time_control) { //Sends the exercice form when the expired time is finished
 	$htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
 }
 
-/*
-if ($objExercise->type == ONE_PER_PAGE && $objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {	
-	if (!empty($exercise_stat_info)) {
-        $exe_id = $exercise_stat_info['exe_id'];
-        if ($_SERVER['REQUEST_METHOD'] != 'POST') {            
-            $recorded['questionList'] = explode(',', $exercise_stat_info['data_tracking']);            
-            $query = 'SELECT * FROM ' . $exercice_attemp_table . ' WHERE exe_id = ' . $exercise_stat_info['exe_id'] . ' ORDER BY tms ASC';            
-            $result = Database::query($query);
-            while ($row = Database :: fetch_array($result,'ASSOC')) {
-                $recorded['exerciseResult'][$row['question_id']] = 1;
-            }
-            $exerciseResult = $_SESSION['exerciseResult'] = $recorded['exerciseResult'];            
-            $current_question = count($recorded['exerciseResult']);
-            $current_question++;
-            $questionList = $_SESSION['questionList'] = $recorded['questionList'];
-        }
-    }
-}*/
 // if the user has submitted the form
 
 $exercise_title			= $objExercise->selectTitle();
@@ -378,7 +364,7 @@ if (!isset($_SESSION['questionList'])) {
 	}
 }
 
-if ($debug) error_log('7 Question list loaded '.print_r($questionList, 1));
+if ($debug) error_log('8. Question list loaded '.print_r($questionList, 1));
 
 $quizStartTime = time();
 api_session_register('quizStartTime');
@@ -390,7 +376,7 @@ if (!empty($questionList)) {
 }
 
 if ($formSent && isset($_POST)) {
-    if ($debug > 0) { error_log('8. $formSent was set'); }
+    if ($debug) { error_log('9. $formSent was set'); }
 
     // Initializing
     if (!is_array($exerciseResult)) {
@@ -406,13 +392,13 @@ if ($formSent && isset($_POST)) {
     
     // if the user has answered at least one question
     if (is_array($choice)) {
-        if ($debug) { error_log('8.1. $choice is an array '.print_r($choice, 1)); } 	
+        if ($debug) { error_log('9.1. $choice is an array '.print_r($choice, 1)); } 	
         // Also store hotspot spots in the session ($exerciseResultCoordinates
         // will be stored in the session at the end of this script)
 
         if (isset($_POST['hotspot'])) {
             $exerciseResultCoordinates = $_POST['hotspot'];
-            if ($debug) { error_log('8.2. $_POST[hotspot] data '.print_r($exerciseResultCoordinates, 1)); }     
+            if ($debug) { error_log('9.2. $_POST[hotspot] data '.print_r($exerciseResultCoordinates, 1)); }     
         }        	
         if ($objExercise->type == ALL_ON_ONE_PAGE) {
             // $exerciseResult receives the content of the form.
@@ -433,15 +419,15 @@ if ($formSent && isset($_POST)) {
                     $choice = $exerciseResult[$questionId];                    
                     if (isset($exe_id)) {
                     	//Manage the question and answer attempts
-                        if ($debug > 0) { error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice,1)); }
+                        if ($debug) { error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice,1)); }
                     	$objExercise->manage_answer($exe_id, $questionId, $choice,'exercise_show',$exerciseResultCoordinates, true, false,false, $objExercise->propagate_neg);
                     }
                     //END of saving and qualifying
                 }
             }
         }
-        if ($debug > 0) { error_log('8.3.  $choice is an array - end'); }
-        if ($debug > 0) { error_log('8.4.  $exerciseResult '.print_r($exerciseResult,1)); }
+        if ($debug) { error_log('9.3.  $choice is an array - end'); }
+        if ($debug) { error_log('9.4.  $exerciseResult '.print_r($exerciseResult,1)); }
     }
     
     
@@ -452,11 +438,11 @@ if ($formSent && isset($_POST)) {
 
     // if all questions on one page OR if it is the last question (only for an exercise with one question per page)
     
-    if (($objExercise->type == ALL_ON_ONE_PAGE || $current_question >= $question_count)) {       
+    if (($objExercise->type == ALL_ON_ONE_PAGE || $current_question >= $question_count)) {          
         if (api_is_allowed_to_session_edit()) {
             // goes to the script that will show the result of the exercise
             if ($objExercise->type == ALL_ON_ONE_PAGE) {
-                if ($debug) { error_log('Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
+                if ($debug) { error_log('10. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
                 
                 //We check if the user attempts before sending to the exercise_result.php                
                 if ($objExercise->selectAttempts() > 0) {
@@ -492,23 +478,20 @@ if ($formSent && isset($_POST)) {
                     if ($debug) { error_log('Updating track_e_exercises '.$update_query); }                    
                     Database::query($update_query);*/
                 }                
-                if ($debug) { error_log('Redirecting to exercise_show.php'); }
+                if ($debug) { error_log('10. Redirecting to exercise_show.php'); }
                 //header("Location: exercise_show.php?id=$exe_id&origin=$origin&learnpath_id=$safe_lp_id&learnpath_item_id=$safe_lp_item_id&learnpath_item_view_id=$safe_lp_item_view_id");
                 header("Location: exercise_result.php?exe_id=$exe_id&origin=$origin&learnpath_id=$safe_lp_id&learnpath_item_id=$safe_lp_item_id&learnpath_item_view_id=$safe_lp_item_view_id");
                 exit;
             }            
         } else {
-            if ($debug) { error_log('Redirecting to exercise_submit.php'); }
+            if ($debug) { error_log('10. Redirecting to exercise_submit.php'); }
             header("Location: exercise_submit.php?exerciseId=$exerciseId&origin=$origin");
             exit;            
         }
     }
-    
-    if (!empty($remind_list)) {
-         //header("Location: exercise_reminder.php?origin=$origin&learnpath_id=$safe_lp_id&learnpath_item_id=$safe_lp_item_id&learnpath_item_view_id=$safe_lp_item_view_id");
-         exit;
-    }
-    if ($debug > 0) { error_log('$formSent was set - end'); }
+    if ($debug) { error_log('11. $formSent was set - end'); }
+} else {
+    if ($debug) { error_log('9. $formSent was NOT sent'); }
 }
 
 // if questionNum comes from POST and not from GET
@@ -520,12 +503,13 @@ if (!$current_question || $_REQUEST['num']) {
         $current_question++;
     }
 }
+
 if ($question_count != 0) {
 	if (($objExercise->type == ALL_ON_ONE_PAGE || $current_question > $question_count)) {       
 	    if (api_is_allowed_to_session_edit()) {
 	        // goes to the script that will show the result of the exercise
 	        if ($objExercise->type == ALL_ON_ONE_PAGE) {
-	            if ($debug) { error_log('Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
+	            if ($debug) { error_log('12. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
 	            
 	            //We check if the user attempts before sending to the exercise_result.php
 	            if ($objExercise->selectAttempts() > 0) {
@@ -554,10 +538,10 @@ if ($question_count != 0) {
 	            
 	                if ($check) {
 	                	$sql_exe_result = "";                    	
-	                    if ($debug) { error_log('exercise_time_control_is_valid is valid'); }
+	                    if ($debug) { error_log('12. exercise_time_control_is_valid is valid'); }
 	                } else {
 	                	$sql_exe_result = ", exe_result = 0";
-	                    if ($debug) { error_log('exercise_time_control_is_valid is NOT valid then exe_result = 0 '); }
+	                    if ($debug) { error_log('12. exercise_time_control_is_valid is NOT valid then exe_result = 0 '); }
 	                }
 	                /*
 	                //Clean incomplete - @todo why setting to blank the status?                  
@@ -626,12 +610,6 @@ if (api_is_course_admin() && $origin != 'learnpath') {
     }
     echo '</div>';
 }
-/*
-$exercise_header = Display::div($exercise_title, array('class'=>'exercise_title'));
-if (!empty($exercise_description)) {
-	$exercise_header .= Display::div($exercise_description, array('class'=>'exercise_description'));
-}
-echo Display::div($exercise_header, array('class'=>'exercise_header'));*/
 
 $is_visible_return = $objExercise->is_visible($learnpath_id, $learnpath_item_id, $learnpath_item_view_id);
 if ($is_visible_return['value'] == false) {
@@ -644,7 +622,7 @@ if ($is_visible_return['value'] == false) {
 
 $limit_time_exists = (($objExercise->start_time != '0000-00-00 00:00:00') || ($objExercise->end_time != '0000-00-00 00:00:00')) ? true : false;
 
-if ($limit_time_exists) {	    
+if ($limit_time_exists) {    
     $exercise_start_time 	= api_strtotime($objExercise->start_time, 'UTC');
     $exercise_end_time 		= api_strtotime($objExercise->end_time, 'UTC');
     $time_now 				= time();
@@ -699,16 +677,15 @@ if ($origin != 'learnpath') {
    echo '<div id="highlight-plugin" class="glossary-content">';
 }
 
-//var_dump('$remind_question_id . '.$remind_question_id);
-
 if ($reminder == 2)  {
+    if ($debug) { error_log('. $reminder == 2'); }
  
     $data_tracking  = $exercise_stat_info['data_tracking'];
     $data_tracking  = explode(',', $data_tracking);
       
     $current_question = 1; //set by default the 1st question    
     
-    if (!empty($my_remind_list)) { 
+    if (!empty($my_remind_list)) {
     	//Checking which questions we are going to call from the remind list      
 		for ($i = 0; $i < count($data_tracking); $i++) {
 			for($j = 0; $j < count($my_remind_list); $j++) {				
@@ -741,8 +718,9 @@ if ($reminder == 2)  {
 				}
 			}  
         }
-    } else {    	
+    } else {
     	if ($objExercise->review_answers) {
+            if ($debug) { error_log('. redirecting to exercise_reminder.php '); }
 	    	header("Location: exercise_reminder.php?$params");
 	    	exit;
     	}
@@ -847,10 +825,8 @@ if (!empty($error)) {
                             
            		// Only for the first time
            		
-           		
-           		
           		$("#save_for_now_"+question_id).html("'.addslashes(Display::return_icon('loading1.gif')).'");                                
-                    $.ajax({ 
+                    $.ajax({
                         url: "'.api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?a=save_exercise_by_now",
                         data: "'.$params.'&type=simple&question_id="+question_id+"&"+my_choice+"&"+hotspot+"&"+remind_list,                                 
                         success: function(return_value) {
@@ -867,10 +843,12 @@ if (!empty($error)) {
 								} else {
 									url = "exercise_submit.php?'.$params.'&num='.$current_question.'&remind_question_id='.$remind_question_id.'";
 								}								
-								window.location = url;
-								
+								window.location = url;								
                         	}
-                        },                                 
+                        },
+                        error: function() {
+                            $("#save_for_now_"+question_id).html("'.addslashes(Display::return_icon('error.png', get_lang('Error'), array(), ICON_SIZE_SMALL)).'");
+                        }
                     });   
                 return false;
             }

+ 8 - 2
main/gradebook/gradebook_add_eval.php

@@ -30,6 +30,7 @@ if (isset ($_GET['selectcat']) && (!empty ($_GET['selectcat']))) {
 	$evaladd->set_category_id(0);
 }
 $form = new EvalForm(EvalForm :: TYPE_ADD, $evaladd, null, 'add_eval_form',null,api_get_self() . '?selectcat=' .$select_cat);
+
 if ($form->validate()) {
 	$values = $form->exportValues();
 	$eval = new Evaluation();
@@ -42,12 +43,17 @@ if ($form->validate()) {
 	}
 	
 	//Always add the gradebook to the course
-	$eval->set_course_code(api_get_course_id());
-	
+	$eval->set_course_code(api_get_course_id());	
 	$eval->set_category_id($values['hid_category_id']);
+    
+    $parent_cat = Category :: load($values['hid_category_id']);            
+    $global_weight = $cat[0]->get_weight();
+    $values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();    
+    
 	$eval->set_weight($values['weight']);
 	
 	$eval->set_max($values['max']);
+    
 	if (empty ($values['visible'])) {
 		$visible = 0;
 	} else {

+ 6 - 0
main/gradebook/gradebook_add_link.php

@@ -68,6 +68,12 @@ if (isset($_GET['typeselected']) && $_GET['typeselected'] != '0') {
 		} else {
 			$link->set_ref_id($addvalues['select_link']);
 		}
+        
+        $parent_cat = Category :: load($addvalues['select_gradebook']);            
+        $global_weight = $category[0]->get_weight();
+        
+        $addvalues['weight'] = $addvalues['weight_mask']/$global_weight*$parent_cat[0]->get_weight();    
+    
 		$link->set_weight($addvalues['weight']);
 
 		if ($link->needs_max()) {

+ 34 - 4
main/gradebook/gradebook_edit_cat.php

@@ -10,10 +10,10 @@
 $language_file = 'gradebook';
 
 require_once '../inc/global.inc.php';
-
 require_once 'lib/be.inc.php';
 require_once 'lib/gradebook_functions.inc.php';
 require_once 'lib/fe/catform.class.php';
+require_once api_get_path(LIBRARY_PATH).'grade_model.lib.php';
 
 api_block_anonymous_users();
 block_students();
@@ -100,13 +100,14 @@ if ($form->validate()) {
 	}else {
 		$cat->set_course_code($values['course_code']);
 	}
-	$cat->set_description($values['description']);
-	
-	$cat->set_skills($values['skills']);
     
+    $cat->set_grade_model_id($values['grade_model_id']);
+	$cat->set_description($values['description']);	
+	$cat->set_skills($values['skills']);    
 	$cat->set_user_id($values['hid_user_id']);
 	$cat->set_parent_id($values['hid_parent_id']);
 	$cat->set_weight($values['weight']);
+    
 	if ($values['hid_parent_id'] == 0 ) {
 		$cat->set_certificate_min_score($values['certif_min_score']);
 	}
@@ -117,6 +118,35 @@ if ($form->validate()) {
 	}
 	$cat->set_visible($visible);
 	$cat->save();
+    $parent_id = $cat->get_parent_id();
+    
+    
+    if ($parent_id == 0) {        
+        //do something           
+        if (isset($values['grade_model_id']) && !empty($values['grade_model_id'])) {
+            $obj = new GradeModel();                             
+            $components = $obj->get_components($values['grade_model_id']);
+
+            foreach ($components as $component) {
+                $gradebook =  new Gradebook();
+                $params = array();
+
+                $params['name']             = $component['acronym'];
+                $params['description']      = $component['title'];
+                $params['user_id']          = api_get_user_id();
+                $params['parent_id']        = $cat->get_id();
+                $params['weight']           = $component['percentage']/100*$values['weight'];
+                $params['session_id']       = api_get_session_id();
+                $params['course_code']      = api_get_course_id();
+                $params['grade_model_id']   = api_get_session_id();
+
+                $gradebook->save($params);                
+            }
+        }
+        
+    }
+    
+    
 	header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat=' . $cat->get_parent_id());
 	exit;
 }

+ 8 - 1
main/gradebook/gradebook_edit_eval.php

@@ -27,7 +27,14 @@ if ($form->validate()) {
 	$eval->set_user_id($values['hid_user_id']);
 	$eval->set_course_code($values['hid_course_code']);
 	$eval->set_category_id($values['hid_category_id']);
-	$eval->set_weight($values['weight']);
+    
+    $parent_cat = Category :: load($values['hid_category_id']);                
+    $cat = Category :: load($parent_cat[0]->get_parent_id());    
+    $global_weight = $cat[0] -> get_weight();        
+    $values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
+        
+    $eval->set_weight($values['weight']);
+    
 	$eval->set_max($values['max']);
 	if (empty ($values['visible'])) {
 		$visible = 0;

+ 5 - 1
main/gradebook/gradebook_edit_link.php

@@ -32,7 +32,11 @@ $cats = Category :: load(null, null, $course_code, null, null, $session_id, fals
 
 $form = new LinkAddEditForm(LinkAddEditForm :: TYPE_EDIT, $cats, null, $link, 'edit_link_form', api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit);
 if ($form->validate()) {
-	$values = $form->exportValues();
+	$values = $form->exportValues();    
+    $parent_cat = Category :: load($values['select_gradebook']);    
+    $cat = Category :: load($parent_cat[0]->get_parent_id());           
+    $global_weight = $cat[0]->get_weight();    
+    $values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();    
 	$link->set_weight($values['weight']);
     
     if (!empty($values['select_gradebook'])) {

+ 60 - 109
main/gradebook/index.php

@@ -505,7 +505,6 @@ if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
 
 
 // DISPLAY HEADERS AND MESSAGES
-
 if (!isset($_GET['exportpdf'])) {
 	if (isset ($_GET['studentoverview'])) {
 		$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('ToolGradebook'));
@@ -521,16 +520,6 @@ if (!isset($_GET['exportpdf'])) {
 		Display :: display_header('');
 	} else {
 		Display :: display_header(get_lang('ToolGradebook'));
-		/*if ( ($_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') ) {
-			$cats = Category :: load (0, null, null, null, null, null, false);
-			$allcat= $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
-			$alleval= $cats[0]->get_evaluations($stud_id);
-			$alllink= $cats[0]->get_links($stud_id);
-			$gradebooktable= new GradebookTable($cats[0], $allcat, $alleval,$alllink, $addparams);
-			$gradebooktable->display();
-			Display :: display_footer();
-			exit;
-		}*/
 	}
 }
 
@@ -589,27 +578,6 @@ if (empty ($_GET['selectcat'])) {
 	$category= $_GET['selectcat'];
 }
 $simple_search_form='';
-// search disabled in course context
-/*
-$simple_search_form= new UserForm(UserForm :: TYPE_SIMPLE_SEARCH, null, 'simple_search_form', null, api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']));
-$values= $simple_search_form->exportValues();
-$keyword = '';
-if (isset($_GET['search']) && !empty($_GET['search']))
-	$keyword = Security::remove_XSS($_GET['search']);
-if ($simple_search_form->validate() && (empty($keyword)))
-	$keyword = $values['keyword'];
-*/
-
-/* search disabled in course context
-if (!empty($keyword))
-{
-	$cats= Category :: load($category);
-	$allcat= array ();
-	$alleval= Evaluation :: find_evaluations($keyword, $cats[0]->get_id());
-	$alllink= LinkFactory :: find_links($keyword, $cats[0]->get_id());
-}
-else
-*/
 
 if (isset ($_GET['studentoverview'])) {    
     //@todo this code also seems to be deprecated ...    
@@ -717,12 +685,6 @@ if (isset($_GET['cidReq']) && $_GET['cidReq']!='') {
 	$addparams['cidReq']='';
 }
 $no_qualification = false;
-if (( count($allcat) == 0) && ( count($alleval) == 0 ) && ( count($alllink) == 0 )) {
-    $no_qualification = true;
-    if ((($is_course_admin) && (!isset ($_GET['selectcat']))) && api_is_course_tutor()) {
-        Display :: display_normal_message(get_lang('GradebookWelcomeMessage') . '<br /><br /><form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"><input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',false);
-    }
-}
 
 //here we are in a sub category
 if ($category != '0') {
@@ -780,9 +742,7 @@ if ($category != '0') {
 			
 			$cattotal = Category :: load($category_id);
             //echo 'start';            
-			$scoretotal= $cattotal[0]->calc_score(api_get_user_id());
-            
-            //echo 'end';            var_dump($scoretotal);
+			$scoretotal= $cattotal[0]->calc_score(api_get_user_id());            
 					
 			//Do not remove this the gradebook/lib/fe/gradebooktable.class.php file load this variable as a global 		
 			$my_score_in_gradebook =  round($scoretotal[0],2);
@@ -823,36 +783,68 @@ if (api_is_allowed_to_edit(null, true)) {
 	//
 	} else {	    
         if (((isset ($_GET['selectcat']) && $_GET['selectcat']==0) || ((isset($_GET['cidReq']) && $_GET['cidReq']!==''))) || isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') {
-            $cats = Category :: load(null, null, $course_code, null, null, $session_id, false);
-			if (!$first_time=1) {                
-            }
+            $cats = Category :: load(null, null, $course_code, null, null, $session_id, false);		
 		}
 	}
 }
 
 if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
 	echo '<meta http-equiv="refresh" content="0;url='.api_get_self().'?cidReq='.$course_code.'" />';
-} else {				
-	/*$models = api_get_settings_options('grading_model');
-	$course_grading_model_id = api_get_course_setting('course_grading_model');
-	$grading_model = '';
-	if (!empty($course_grading_model_id)) {
-		if (!empty($models)) {
-			foreach($models as $option) {			
-				if (intval($option['id']) == $course_grading_model_id) {
-					$grading_model = $option['value'];
-				}
-			}
-		}
-	}
-	
-	$grading_contents = api_grading_model_functions($grading_model, 'to_array');
-	$grading_string   = api_grading_model_functions($grading_model, 'decorate');*/
-    
+} else {    
     $cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init
-		
-	if (!empty($cats)) {	    
-		//$items = $grading_contents['items'];
+
+	if (!empty($cats)) {        
+        
+        if (api_is_allowed_to_edit(null, true)) {
+            //Getting grade models
+            $obj = new GradeModel();
+            $grade_models = $obj->get_all();                
+            $options = array('-1' => get_lang('none'));
+            foreach ($grade_models as $item) {
+                $options[$item['id']] = $item['name'];
+            }                
+
+            $grade_model_id = $cats[0]->get_grade_model_id();        
+            
+            //No children
+            if (count($cats) == 1 && empty($grade_model_id)) {
+                $form = new FormValidator('grade_model_settings');
+                $form->addElement('select', 'grade_model', get_lang('SelectGradeModel'), $options);                
+                $form->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');                
+                
+                if ($form->validate()) {
+                    $value = $form->exportValue('grade_model');                    
+                    $gradebook = new Gradebook();
+                    $gradebook->update(array('id'=> $cats[0]->get_id(), 'grade_model_id' => $value), true);                 
+
+                    //do something                        
+                    $obj = new GradeModel();                             
+                    $components = $obj->get_components($value);
+
+                    foreach ($components as $component) {
+                        $gradebook =  new Gradebook();
+                        $params = array();
+
+                        $params['name']             = $component['acronym'];
+                        $params['description']      = $component['title'];
+                        $params['user_id']          = api_get_user_id();
+                        $params['parent_id']        = $cats[0]->get_id();
+                        $params['weight']           = $component['percentage'];
+                        $params['session_id']       = api_get_session_id();
+                        $params['course_code']      = api_get_course_id();
+                        $params['grade_model_id']   = api_get_session_id();
+
+                        $gradebook->save($params);
+                    }
+                    
+                    //Reloading cats
+                    $cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init
+                } else {
+                    $form->display();   
+                }                
+            }
+        }
+        
 		$i = 0;
 		foreach ($cats as $cat) {
 			
@@ -869,51 +861,10 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
 				
 				if (api_is_allowed_to_edit(null,true)) {
 					//Showing the grading system
-					if (!empty($grading_string)) {
-						Display::display_normal_message(get_lang('GradeModel').': '.$grading_string);
-					}
-				}
-                $obj = new GradeModel();
-                $grade_models = $obj->get_all();                
-                $options = array(0 => get_lang('none'));
-                foreach ($grade_models as $item) {
-                    $options[$item['id']] = $item['name'];
-                }                
-        
-                //No children
-                if (empty($allcat)) {
-                    $form = new FormValidator('grade_model_settings');
-                    $form->addElement('select', 'grade_model', get_lang('SelectGradeModel'), $options);                
-                    $form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');                
-                    $form->display();     
-
-                    if ($form->validate()) {
-                        $value = $form->exportValue('grade_model');                    
-                        $gradebook = new Gradebook();
-                        $gradebook->update(array('id'=> $cat->get_id(), 'grade_model_id' => $value), true);                 
-
-                        //do something                        
-                        $obj = new GradeModel();                             
-                        $components = $obj->get_components($value);
-
-                        foreach ($components as $component) {
-                            $gradebook =  new Gradebook();
-                            $params = array();
-
-                            $params['name'] = $component['acronym'];
-                            $params['description'] = $component['title'];
-                            $params['user_id'] = api_get_user_id();
-                            $params['parent_id'] = $cat->get_id();
-                            $params['weight'] = $component['percentage'];
-                            $params['session_id'] = api_get_session_id();
-                            $params['course_code'] = api_get_course_id();
-                            $params['grade_model_id'] = api_get_session_id();
-
-                            $gradebook->save($params);
-                        }
-                    }
-                }
-                
+					if (!empty($grade_models[$grade_model_id])) {                        
+                        Display::display_normal_message(get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']);
+                    }					
+				}                
 				$gradebooktable = new GradebookTable($cat, $allcat, $alleval, $alllink, $addparams);                
 				$gradebooktable->display();				
 			}

+ 7 - 4
main/gradebook/lib/be/category.class.php

@@ -334,12 +334,11 @@ class Category implements GradebookItem
 	}
 	/**
 	 * Update the properties of this category in the database
+     * @todo fix me
 	 */
 	public function save() {
 		$tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
-		$sql = 'UPDATE '.$tbl_grade_categories
-			." SET name = '".Database::escape_string($this->get_name())."'"
-			.', description = ';
+		$sql = 'UPDATE '.$tbl_grade_categories." SET name = '".Database::escape_string($this->get_name())."'".', description = ';
 		if (isset($this->description)) {
 			$sql .= "'".Database::escape_string($this->get_description())."'";
 		} else {
@@ -364,13 +363,17 @@ class Category implements GradebookItem
 		} else {
 			$sql .= 'null';
 		}
+        if (isset($this->grade_model_id)) {
+            $sql .= ', grade_model_id = '.intval($this->get_grade_model_id());
+        }
 		$sql .= ', weight = '.Database::escape_string($this->get_weight())
 			.', visible = '.intval($this->is_visible())
 			.' WHERE id = '.intval($this->id);
+        
 		Database::query($sql);
         
         $gradebook= new Gradebook();
-        $res    = $gradebook->update_skills_to_gradebook($this->id, $this->get_skills(false));
+        $gradebook->update_skills_to_gradebook($this->id, $this->get_skills(false));
 
 	}
 

+ 4 - 4
main/gradebook/lib/be/evaluation.class.php

@@ -208,8 +208,7 @@ class Evaluation implements GradebookItem
     /**
      * Insert this evaluation into the database
      */
-    public function add()
-	{
+    public function add() {
 		if (isset($this->name) && isset($this->user_id) && isset($this->weight) && isset ($this->eval_max) && isset($this->visible)) {
 			$tbl_grade_evaluations = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
 
@@ -228,7 +227,7 @@ class Evaluation implements GradebookItem
 			$sql .= ',type';
 			$sql .= ") VALUES ('".Database::escape_string($this->get_name())."'"
 					.','.intval($this->get_user_id())
-					.','.intval($this->get_weight())
+					.','.floatval($this->get_weight())
 					.','.intval($this->get_max())
 					.','.intval($this->is_visible());
 			if (isset($this->description)) {
@@ -301,11 +300,12 @@ class Evaluation implements GradebookItem
 		} else {
 			$sql .= 'null';
 		}
-		$sql .= ', weight = '.Database::escape_string($this->get_weight())
+		$sql .= ', weight = "'.Database::escape_string($this->get_weight()).'" '
 				.', max = '.Database::escape_string($this->get_max())
 				.', visible = '.intval($this->is_visible())
 				.' WHERE id = '.intval($this->id);
 		//recorded history
+        
 		$eval_log=new Evaluation();
 		$eval_log->add_evaluation_log($this->id);
 		Database::query($sql);

+ 43 - 9
main/gradebook/lib/fe/catform.class.php

@@ -115,13 +115,23 @@ class CatForm extends FormValidator {
 	 * Builds an form to edit a category
 	 */
    	protected function build_editing_form() {
-   	    $skills = $this->category_object->get_skills_for_select();        
+   	    $skills = $this->category_object->get_skills_for_select();      
+        $course_code = api_get_course_id();
+        $session_id = api_get_session_id();
+         //Freeze or not
+        $test_cats  = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init	
+        $links = $test_cats[0]->get_links();
+        $grade_model_id = $this->category_object->get_grade_model_id();
+        if (empty($links)) {
+            $grade_model_id    = 0;
+        }
     
    		$this->setDefaults(array(
 			'name' 				=> $this->category_object->get_name(),
     		'description' 		=> $this->category_object->get_description(),
     		'hid_user_id' 		=> $this->category_object->get_user_id(),
     		'hid_parent_id' 	=> $this->category_object->get_parent_id(),
+            'grade_model_id' 	=> $grade_model_id,
     		'skills'            => $skills,
    	 		'weight' 			=> $this->category_object->get_weight(),
    	 		'visible' 			=> $this->category_object->is_visible(),
@@ -135,8 +145,7 @@ class CatForm extends FormValidator {
    	private function build_basic_form() {
    	    
 		$this->addElement('hidden', 'zero', 0);
-		$this->add_textfield('name', get_lang('CategoryName'), true, array('size'=>'54','maxlength'=>'50'));
-        
+		$this->add_textfield('name', get_lang('CategoryName'), true, array('size'=>'54','maxlength'=>'50'));        
 		$this->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
 		
 		if (isset($this->category_object) && $this->category_object->get_parent_id() == 0) {
@@ -157,8 +166,7 @@ class CatForm extends FormValidator {
 		
 		$grading_contents = api_grading_model_functions($grading_model, 'to_array');
 		*/
-		if (0) {
-			
+		if (0) {			
 			/*$course_code	= api_get_course_id();			
 			$session_id		= api_get_session_id();
 			
@@ -174,13 +182,18 @@ class CatForm extends FormValidator {
 			//$this->addRule('weight',get_lang('ThisFieldIsRequired'),'required');
 			$this->freeze('weight');			*/
 		} else {
-			$this->add_textfield('weight', array(get_lang('TotalWeight'), get_lang('TotalSumOfWeights')), true, array('value'=>$value,'size'=>'4','maxlength'=>'5'));
+            $global_weight = api_get_setting('gradebook_default_weight');
+            if (isset($global_weight)) {
+                $value = $global_weight;
+            } else {
+                $value = 100;
+            }            
+			$this->add_textfield('weight', array(get_lang('TotalWeight'), get_lang('TotalSumOfWeights')), true, array('value'=>$value, 'size'=>'4','maxlength'=>'5'));
 			$this->addRule('weight',get_lang('ThisFieldIsRequired'),'required');
 		}
         
         if (api_is_platform_admin() || api_is_drh()) {
-            //the magic should be here
-            
+            //the magic should be here            
             $skills = $this->category_object->get_skills();    
             $this->addElement('select', 'skills', array(get_lang('Skills'), get_lang('SkillsAchievedWhenAchievingThisGradebook')), null, array('id'=>'skills', 'multiple'=>'multiple'));
             $content = '';
@@ -205,8 +218,29 @@ class CatForm extends FormValidator {
 		
    		$this->addElement('hidden','hid_user_id');
    		$this->addElement('hidden','hid_parent_id');
-		$this->addElement('textarea', 'description', get_lang('Description'),array('rows'=>'3','cols' => '34'));
+		$this->addElement('textarea', 'description', get_lang('Description'),array('class'=>'span3','cols' => '34'));        
         
+        if (isset($this->category_object) && $this->category_object->get_parent_id() == 0) {
+            //Getting grade models
+            $obj = new GradeModel();
+            $grade_models = $obj->get_all();                
+            $options = array(-1 => get_lang('none'));
+            foreach ($grade_models as $item) {
+                $options[$item['id']] = $item['name'];
+            }                                    
+            $this->addElement('select', 'grade_model_id', array(get_lang('GradeModel'), get_lang('OnlyActiveWhenThereAreAnyComponents')), $options);
+            
+            //Freeze or not
+            $course_code = api_get_course_id();
+            $session_id = api_get_session_id();
+            $test_cats  = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init	
+            $links = $test_cats[0]->get_links();            
+            
+            if (count($test_cats) > 1 || !empty($links)) {
+                $this->freeze('grade_model_id');
+            }
+        }
+                
 		if ($this->form_type == self :: TYPE_ADD) {
 			$this->addElement('style_submit_button', null, get_lang('AddCategory'), 'class="save"');
 		} else {

+ 12 - 23
main/gradebook/lib/fe/displaygradebook.php

@@ -381,15 +381,10 @@ class DisplayGradebook
             }
         }
 
-
-
 		if (!$is_course_admin && $status<>1 && $selectcat<>0) {
 			$user_id = api_get_user_id();
-			//$user= get_user_info_from_id($user_id);
-
 			$catcourse	  = Category::load($catobj->get_id());            
-			$scoredisplay = ScoreDisplay :: instance();
-			//$scorecourse  = $catcourse[0]->calc_score($user_id);
+			$scoredisplay = ScoreDisplay :: instance();			
 
 			// generating the total score for a course
 			$allevals= $catcourse[0]->get_evaluations($user_id,true);
@@ -397,36 +392,30 @@ class DisplayGradebook
 			$evals_links = array_merge($allevals, $alllinks);
 			$item_value=0;
 			$item_total=0;
-            
-           
             $item_total_value = 0;            
-           
+            
 			for ($count=0; $count < count($evals_links); $count++) {
 				$item           = $evals_links[$count];
 				$score          = $item->calc_score($user_id);
                 $my_score_denom =($score[1]==0) ? 1 : $score[1];
-				$item_value     = $score[0]/$my_score_denom * $item->get_weight();                
-                
-                //$sub_cat_percentage = $sum_categories_weight_array[$item->get_category_id()];
-                //$percentage     = round($item->get_weight()/($sub_cat_percentage) *  $sub_cat_percentage/$catobj->get_weight(), 2);
                 
-                //$item_value     = $percentage*$item_value;                
+				$item_value     = $score[0]/$my_score_denom * $item->get_weight(); 
+                $sub_item_total      = $item->get_weight();                
                 
-				//$item_total         += $percentage*100;
-                $item_total         += $item->get_weight();                
-                $item_total_value   += $item_value;
-				//$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT);				
+                /*$item_value         = $item_value*$catcourse[0]->get_weight();                 
+                $sub_item_total      = $item->get_weight()*$catcourse[0]->get_weight();                
+                */
+                //var_dump($item_value.' - '.$sub_item_total);
+                $item_total         += $sub_item_total;                
+                $item_total_value   += $item_value;                
 			}
             $item_total = round($item_total);
-			$item_value = number_format($item_total_value, 2);
+			//$item_value = number_format($item_total_value, api_get_setting('gradebook_number_decimals'));
+            $item_value = number_format($item_total_value, 2);
 			$total_score = array($item_value, $item_total);
 		
 			$scorecourse_display = $scoredisplay->display_score($total_score, SCORE_DIV_PERCENT);
 
-			//$cattotal = Category :: load(0);
-			//$scoretotal= $cattotal[0]->calc_score(api_get_user_id());
-			//$scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
-			//$scoreinfo = get_lang('StatsStudent') . ' :<b> '.api_get_person_name($user['firstname'], $user['lastname']).'</b><br />';
 			if ((!$catobj->get_id() == '0') && (!isset ($_GET['studentoverview'])) && (!isset ($_GET['search']))) {
 				$scoreinfo.= '<h2>'.get_lang('Total') . ' : ' . $scorecourse_display . '</h2>';
 			}

+ 44 - 22
main/gradebook/lib/fe/evalform.class.php

@@ -285,7 +285,7 @@ class EvalForm extends FormValidator
 			$this->add_textfield($element_name,
 								 $this->build_stud_label($user[0], $user[1], $user[2], $user[3]),
 								 false,
-								 array ('size' => 4,'maxlength' => 5));
+								 array ('class' => 'span1','maxlength' => 5));
             
 			$this->addRule($element_name, get_lang('OnlyNumbers'), 'numeric');
 			$this->addRule(array($element_name,'maxvalue'), get_lang('OverMax'), 'compare', '<=');
@@ -381,20 +381,30 @@ class EvalForm extends FormValidator
 	/**
 	 * Builds a form to edit an evaluation
 	 */
-	protected function build_editing_form() {
-		$this->setDefaults(array (	'hid_id' => $this->evaluation_object->get_id(), 
-									'name' 	 => $this->evaluation_object->get_name(), 
-									'description' => $this->evaluation_object->get_description(), 
-									'hid_user_id' => $this->evaluation_object->get_user_id(), 
-									'hid_course_code' => $this->evaluation_object->get_course_code(), 
-									'hid_category_id' => $this->evaluation_object->get_category_id(), 
-									'created_at' => api_get_utc_datetime($this->evaluation_object->get_date()), 
-									'weight' => $this->evaluation_object->get_weight(), 'max' => $this->evaluation_object->get_max(), 'visible' => $this->evaluation_object->is_visible()));
+	protected function build_editing_form() {        
+        $parent_cat = Category :: load($this->evaluation_object->get_category_id());
+        $cat = Category :: load($parent_cat[0]->get_parent_id());
+        $global_weight = $cat[0]->get_weight();                
+        //$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();    
+        $weight_mask = $global_weight*$this->evaluation_object->get_weight()/$parent_cat[0]->get_weight() ;
+            
+		$this->setDefaults(array (	'hid_id'            => $this->evaluation_object->get_id(), 
+									'name'              => $this->evaluation_object->get_name(), 
+									'description'       => $this->evaluation_object->get_description(), 
+									'hid_user_id'       => $this->evaluation_object->get_user_id(), 
+									'hid_course_code'   => $this->evaluation_object->get_course_code(), 
+									'hid_category_id'   => $this->evaluation_object->get_category_id(), 
+									'created_at'        => api_get_utc_datetime($this->evaluation_object->get_date()), 
+									'weight'            => $weight,
+                                    'weight_mask'       => $weight_mask,
+                                    'max'               => $this->evaluation_object->get_max(), 
+                                    'visible'           => $this->evaluation_object->is_visible()));
 		$id_current=isset($this->id)?$this->id :null;
-		$this->addElement('hidden', 'hid_id',$id_current);
+		$this->addElement('hidden', 'hid_id', $id_current);
 		$this->build_basic_form(1);
 		$this->addElement('style_submit_button', 'submit', get_lang('ModifyEvaluation'),'class="save"');
 	}
+    
 	/**
 	 * Builds a basic form that is used in add and edit
 	 */
@@ -432,14 +442,19 @@ class EvalForm extends FormValidator
         
         if (!empty($all_categories)) {            
             foreach ($all_categories as $my_cat) {
-                if ($my_cat->get_course_code() == api_get_course_id()) {                    
-                    if ($my_cat->get_parent_id() == 0 ) {
-                        $default_weight = $my_cat->get_weight();
-                        $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id());
-                        $cats_added[] = $my_cat->get_id();
+                if ($my_cat->get_course_code() == api_get_course_id()) {         
+                    $grade_model_id = $my_cat->get_grade_model_id();
+                    if (empty($grade_model_id)) {
+                        if ($my_cat->get_parent_id() == 0) {
+                            $default_weight = $my_cat->get_weight();
+                            $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id());
+                            $cats_added[] = $my_cat->get_id();
+                        } else {
+                            $select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id());
+                            $cats_added[] = $my_cat->get_id();
+                        }
                     } else {
-                        $select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id());
-                        $cats_added[] = $my_cat->get_id();
+                        $select_gradebook->addoption(get_lang('Select'), 0);
                     }
                     if ($this->evaluation_object->get_category_id() == $my_cat->get_id()) {
                         $default_weight = $my_cat->get_weight();                        
@@ -447,14 +462,21 @@ class EvalForm extends FormValidator
                 }           
             }
         }
+        $global_weight = api_get_setting('gradebook_default_weight');
         
-
-		$this->add_textfield('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
+		$this->add_textfield('weight_mask', array(get_lang('Weight'), null, ' [0 .. '.$global_weight.'] '), true, array (
 			'size' => '4',
 			'maxlength' => '5',
             'class' => 'span1'
 		));
         
+        /*$this->add_textfield('weight', array(null, null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
+            	'size' => '4',
+			'maxlength' => '5',
+            'class' => 'span1'
+		));*/
+        
+        
 		if ($edit) {
 			if (!$this->evaluation_object->has_results()) {
 				$this->add_textfield('max', get_lang('QualificationNumeric'), true, array (
@@ -480,8 +502,8 @@ class EvalForm extends FormValidator
 			'cols' => '34'
 		));
 		$this->addElement('checkbox', 'visible', null, get_lang('Visible'));
-		$this->addRule('weight', get_lang('OnlyNumbers'), 'numeric');
-		$this->addRule(array ('weight', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
+		$this->addRule('weight_mask', get_lang('OnlyNumbers'), 'numeric');
+		$this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
 		$this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
 		$this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
 	}

+ 24 - 12
main/gradebook/lib/fe/gradebooktable.class.php

@@ -134,6 +134,7 @@ class GradebookTable extends SortableTable {
 		//status of user in course
 	    $user_id     = api_get_user_id();
 		$course_code = api_get_course_id();
+        $session_id = api_get_session_id();
 		$status_user = api_get_status_of_user_in_course($user_id, $course_code);
         
 		$data_array  = $this->datagen->get_data($sorting, $from, $this->per_page);		
@@ -143,7 +144,8 @@ class GradebookTable extends SortableTable {
 		$weight_total_links = 0;
         
         $main_categories = array();
-		
+        
+        $main_cat =  Category :: load(null, null, $course_code, null, null, $session_id, false);        		
 		foreach ($data_array as $data) {		
 			
             // list of items inside the gradebook (exercises, lps, forums, etc)
@@ -157,9 +159,10 @@ class GradebookTable extends SortableTable {
 			$invisibility_span_close = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '</span>' : '';
 
 			if (api_is_allowed_to_edit(null, true)) {
+                //id
 				$row[] = $this->build_id_column($item);
-			}
-			
+			}		
+            //Type
 			$row[] = $this->build_type_column($item);
 			
 			//Name
@@ -174,9 +177,14 @@ class GradebookTable extends SortableTable {
             
 			//Description
 			$row[] = $invisibility_span_open.$data[2] . $invisibility_span_close;			
-			
+			            
 			//Weight
-			$row[] = $invisibility_span_open .Display::tag('h4', $data[3] .' / '.$this->currentcat->get_weight()).$invisibility_span_close;		
+			//$row[] = $invisibility_span_open .Display::tag('h4', $data['3'] .' / '.$this->currentcat->get_weight()).$invisibility_span_close;		
+            //$average = $data['3']/$this->currentcat->get_weight()*100;
+            
+            $scoredisplay = ScoreDisplay :: instance();            
+            $average = $scoredisplay->display_score(array($data['3'], $this->currentcat->get_weight()), SCORE_PERCENT, SCORE_BOTH, true);
+            $row[] = $invisibility_span_open .Display::tag('h4', $average).$invisibility_span_close;		
             
             $category_weight = $item->get_weight();
             	
@@ -186,13 +194,13 @@ class GradebookTable extends SortableTable {
 				$cattotal   = Category :: load($_GET['selectcat']);
                 $scoretotal = $cattotal[0]->calc_score(api_get_user_id());                    
                 $item_value = $scoretotal[0];
-                $item_value = number_format($item_value, 2, '.', ' ');			   				  			   	
+                $item_value = number_format($item_value, api_get_setting('gradebook_number_decimals'), '.', ' ');			   				  			   	
 			}
 						
 			//Date
     		//$row[] = $invisibility_span_open.$data[4].$invisibility_span_close;
 
-			//Admins get an edit column
+			//Edit (for admins)
 			if (api_is_allowed_to_edit(null, true)) {
 				$cat = new Category();
 				$show_message = $cat->show_message_resource_delete($item->get_course_code());
@@ -236,8 +244,7 @@ class GradebookTable extends SortableTable {
 								
 					//if the item is invisible, wrap it in a span with class invisible
 					$invisibility_span_open  = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '<span class="invisible">' : '';
-					$invisibility_span_close = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '</span>' : '';
-		
+					$invisibility_span_close = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '</span>' : '';		
                     
                     $main_categories[$parent_id]['children'][$item->get_id()]['name'] = $item->get_name();
                     $main_categories[$parent_id]['children'][$item->get_id()]['weight'] = $item->get_weight();
@@ -251,10 +258,13 @@ class GradebookTable extends SortableTable {
 					$row[] = $invisibility_span_open."&nbsp;&nbsp;&nbsp;  ".$this->build_name_link($item) . $invisibility_span_close;
 					
 					//Description
-					//$row[] = $invisibility_span_open.$data[2] . $invisibility_span_close;			
+					$row[] = $invisibility_span_open.$data[2] . $invisibility_span_close;			
 					
 					//Weight
-					$row[] = $invisibility_span_open . $data[3] .' / '.$category_weight.$invisibility_span_close;
+					//$row[] = $invisibility_span_open . $data[3] .' / '.$category_weight.$invisibility_span_close;
+                    $weight = $data[3]/$category_weight*$main_cat[0]->get_weight();
+                    
+                    $row[] = $invisibility_span_open . $weight.$invisibility_span_close;
 					
 					if (api_is_allowed_to_edit(null, true)) {						
 						//$weight_total_links += intval($data[3]);
@@ -282,6 +292,8 @@ class GradebookTable extends SortableTable {
 						if (count($eval_n_links)> 0 && $status_user!=1 ) {
 							$value_data = isset($data[4]) ? $data[4] : null;							
 							if (!is_null($value_data)) {
+                                //$my_score = $data[5]->get_eval_max()/;
+                                //var_dump($data[5]);
 								$row[] = $value_data;
 							}
 						}    
@@ -494,7 +506,7 @@ class GradebookTable extends SortableTable {
 		switch ($item->get_item_type()) {
 			// category
 			case 'C' :
-				return build_edit_icons_cat($item, $this->currentcat->get_id());
+				return build_edit_icons_cat($item, $this->currentcat);
 			// evaluation
 			case 'E' :
 				return build_edit_icons_eval($item, $this->currentcat->get_id());

+ 20 - 5
main/gradebook/lib/fe/linkaddeditform.class.php

@@ -83,17 +83,32 @@ class LinkAddEditForm extends FormValidator
             }
         }
         
+        $global_weight = api_get_setting('gradebook_default_weight');
+        
+		$this->add_textfield('weight_mask', array(get_lang('Weight'), null, ' [0 .. '.$global_weight.'] '), true, array (
+			'size' => '4',
+			'maxlength' => '5',
+            'class' => 'span1'
+		));
+        /*
+        
 		// ELEMENT: weight
         $this->add_textfield('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array (
             'size' => '4',
             'maxlength' => '5',
             'class' => 'span1'
-        ));
+        ));*/
         
-		$this->addRule('weight',get_lang('OnlyNumbers'),'numeric');
-		$this->addRule(array ('weight', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
-		if ($form_type == self :: TYPE_EDIT) {
-			$defaults['weight'] = $link->get_weight();            
+		$this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric');
+		$this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
+		if ($form_type == self :: TYPE_EDIT) {            
+            $parent_cat = Category :: load($link->get_category_id());     
+            $cat = Category :: load($parent_cat[0]->get_parent_id());
+            $global_weight = $cat[0]->get_weight();
+            
+            $values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
+			//$defaults['weight'] = $link->get_weight();   
+            $defaults['weight_mask'] = $values['weight'] ;   
             $defaults['select_gradebook'] = $link->get_category_id();
             
 		}

+ 3 - 1
main/gradebook/lib/gradebook_data_generator.class.php

@@ -101,7 +101,9 @@ class GradebookDataGenerator
 			}*/			
 			if (count($this->evals_links) > 0) {
 				if (!api_is_allowed_to_edit() || $status_user != 1 ) {
+                    
 					$row[] = $this->build_result_column($item, $ignore_score_color);
+                    $row[] = $item;
 				}
 			}			
 		    $data[] = $row;
@@ -216,7 +218,7 @@ class GradebookDataGenerator
         return null;
 	}
 
-	private function build_date_column ($item) {
+	private function build_date_column($item) {
 		$date = $item->get_date();
 		if (!isset($date) || empty($date)) {
 			return '';

+ 12 - 3
main/gradebook/lib/gradebook_functions.inc.php

@@ -196,11 +196,18 @@ function get_icon_file_name ($type) {
  * @param int $selectcat id of selected category
  */
 function build_edit_icons_cat($cat, $selectcat) {
-	$show_message=$cat->show_message_resource_delete($cat->get_course_code());
+	$show_message = $cat->show_message_resource_delete($cat->get_course_code());
+    $grade_model_id = $selectcat->get_grade_model_id();
+    
+    $selectcat = $selectcat->get_id();
+    
 	if ($show_message===false) {
 		$visibility_icon= ($cat->is_visible() == 0) ? 'invisible' : 'visible';
 		$visibility_command= ($cat->is_visible() == 0) ? 'set_visible' : 'set_invisible';
-		$modify_icons= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&amp;cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
+        
+        if (empty($grade_model_id)) {
+            $modify_icons= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&amp;cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
+        }
 		
 		$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visiblecat=' . $cat->get_id() . '&amp;' . $visibility_command . '=&amp;selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';
 		
@@ -212,8 +219,10 @@ function build_edit_icons_cat($cat, $selectcat) {
 			//$modify_icons .= '&nbsp;<img src="../img/deplacer_fichier_na.gif" border="0" title="' . get_lang('Move') . '" alt="" />';
 		}
         
-        $modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
+        if (empty($grade_model_id)) {
+            $modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
                 Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_SMALL).' </a>';                            
+        }
 
 		$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&amp;selectcat=' . $selectcat . '&amp;cidReq='.$cat->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'),'',ICON_SIZE_SMALL).'</a>';
 

+ 32 - 14
main/inc/ajax/exercise.ajax.php

@@ -15,6 +15,8 @@ api_protect_course_script(true);
 $action = $_REQUEST['a'];
 $course_id = api_get_course_int_id();
 
+if ($debug) error_log("$action ajax call");
+
 switch ($action) {
     case 'get_live_stats':
         if (!api_is_allowed_to_edit(null, true)) {
@@ -121,8 +123,8 @@ switch ($action) {
             Display::display_confirmation_message(get_lang('Saved'));
         }
         break;
-    case 'add_question_to_reminder':    	    	
-    	$objExercise             = $_SESSION['objExercise'];    	
+    case 'add_question_to_reminder':          
+    	$objExercise  = $_SESSION['objExercise'];    	
     	if (empty($objExercise)) {
     		echo 0;
     		exit;
@@ -135,19 +137,24 @@ switch ($action) {
         if (api_is_allowed_to_session_edit()) {
         	            
             //"all" or "simple" strings means that there's one or all questions           
-            $type                    = $_REQUEST['type'];            
+            $type                   = $_REQUEST['type'];            
             
             //Normal questions choices
-            $choice                  = $_REQUEST['choice'];
+            $choice                 = $_REQUEST['choice'];
             
             //All Hotspot coordinates from all questions 
-            $hot_spot_coordinates    = $_REQUEST['hotspot'];
-            
+            $hot_spot_coordinates   = $_REQUEST['hotspot'];            
             
             //There is a reminder?
-            $remind_list             = isset($_REQUEST['remind_list']) && !empty($_REQUEST['remind_list'])? array_keys($_REQUEST['remind_list']) : null;
+            $remind_list            = isset($_REQUEST['remind_list']) && !empty($_REQUEST['remind_list'])? array_keys($_REQUEST['remind_list']) : null;
                
-            $exe_id = $_REQUEST['exe_id'];
+            $exe_id                 = $_REQUEST['exe_id'];
+            
+            if ($debug) error_log("exe_id = $exe_id ");
+            if ($debug) error_log("type = $type ");
+            if ($debug) error_log("choice = ".print_r($choice, 1)." ");
+            if ($debug) error_log("hot_spot_coordinates = $hot_spot_coordinates ");
+            if ($debug) error_log("remind_list = $remind_list ");            
             
             //Exercise information            
             $question_id             = intval($_REQUEST['question_id']);            
@@ -157,7 +164,8 @@ switch ($action) {
             if (empty($question_list) || empty($objExercise)) {
                 echo 0;
                 exit;
-            }            
+            }
+            
             //Getting information of the current exercise    
             $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);           
             
@@ -232,12 +240,16 @@ switch ($action) {
             
             //Looping the question list
             
-            foreach($question_list as $my_question_id) {                
+            foreach ($question_list as $my_question_id) {
+                if ($debug) error_log("Saving question_id = $my_question_id ");                
+                
                 if ($type == 'simple' && $question_id != $my_question_id) {
                     continue;
                 }             
                  
                 $my_choice = $choice[$my_question_id];
+                
+                if ($debug) error_log("my_choice = ".print_r($my_choice, 1)."");
                                 
                // creates a temporary Question object
             	$objQuestionTmp        = Question::read($my_question_id);
@@ -255,7 +267,8 @@ switch ($action) {
             	$hotspot_delineation_result = $_SESSION['hotspot_delineation_result'][$objExercise->selectId()][$my_question_id];
             	
             	// Deleting old attempt
-                if (isset($attempt_list) && !empty($attempt_list[$my_question_id])) {                    
+                if (isset($attempt_list) && !empty($attempt_list[$my_question_id])) {          
+                    if ($debug) error_log("delete_attempt  exe_id : $exe_id, my_question_id: $my_question_id");
                     delete_attempt($exe_id, api_get_user_id() , api_get_course_id(), api_get_session_id(), $my_question_id);
                     if ($objQuestionTmp->type  == HOT_SPOT) {            	        
             	        delete_attempt_hotspot($exe_id, api_get_user_id() , api_get_course_id(), $my_question_id);
@@ -266,13 +279,18 @@ switch ($action) {
             	// We're inside *one* question. Go through each possible answer for this question
             	$result = $objExercise->manage_answer($exe_id, $my_question_id, $my_choice,'exercise_result', $hot_spot_coordinates, true, false, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result, true);
             	  	
-                $total_score     += $result['score'];    
-              	
+                $total_score     += $result['score'];
+                
+                if ($debug) error_log("total_score: $total_score ");
+                if ($debug) error_log("total_weight: $total_weight ");
+                                
                 update_event_exercice($exe_id, $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $exercise_stat_info['orig_lp_id'], $exercise_stat_info['orig_lp_item_id'], $exercise_stat_info['orig_lp_item_view_id'], $exercise_stat_info['exe_duration'], $question_list, 'incomplete', $remind_list);
                 
                  // Destruction of the Question object
             	unset($objQuestionTmp); 
-            }            
+                if ($debug) error_log(" -- end question -- ");
+            }   
+            if ($debug) error_log(" ------ end ajax call ------- ");            
         }
         
         if ($objExercise->type == ONE_PER_PAGE) {

+ 16 - 12
main/inc/ajax/social.ajax.php

@@ -77,8 +77,7 @@ switch ($action) {
 		if (api_is_anonymous()) {
 			echo '';
 			break;
-		}
-		$list_path_friends	= array();
+		}		
 		$user_id	= api_get_user_id();
 		$name_search= Security::remove_XSS($_POST['search_name_q']);		
 		$number_friends = 0;
@@ -97,27 +96,32 @@ switch ($action) {
 			$number_loop   = ($number_friends/$number_of_images);
 			$loop_friends  = ceil($number_loop);
 			$j=0;
-			$friend_html.= '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" >';
-			for ($k=0;$k<$loop_friends;$k++) {
-				$friend_html.='<tr><td valign="top">';
+			$friend_html.= '<ul class="thumbnails">';
+			for ($k=0;$k<$loop_friends;$k++) {				
 				if ($j==$number_of_images) {
 					$number_of_images=$number_of_images*2;
 				}
 				while ($j<$number_of_images) {
 					if (isset($friends[$j])) {
+                        $friend_html.='<li class="span2">';
 						$friend = $friends[$j];
 						$user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
 						$friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92);
-						$friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
-						$friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="width:60px;height:60px;border:3pt solid #eee" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
-						$friend_html.='<img onclick="delete_friend (this)" id=img_'.$friend['friend_user_id'].' src="'.api_get_path(WEB_IMG_PATH).'blank.gif" alt="" title=""  class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';				
+						$friend_html.='<div class="thumbnail" onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
+                        $friend_html.='<img src="'.$friends_profile['file'].'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" />';
+                        $friend_html.='<div class="caption">';
+						$friend_html.='<a href="profile.php?u='.$friend['friend_user_id'].'"><h5>'.$user_name.'</h5></a>';
+						$friend_html.='<p><button class="btn" onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].'>'.get_lang('Delete').'</button></p>';
+                        $friend_html.='</div>';
+                        $friend_html.='</div>';
+                        
+                        $friend_html.='</li>';
 					}
 					$j++;
-				}
-				$friend_html.='</td></tr>';
+				}				
 			}
-			$friend_html.='<br/></table>';
-		}
+			$friend_html.='</ul>';
+		}        
 		echo $friend_html;	
 		break;		
 	case 'toogle_course':

+ 4 - 6
main/inc/lib/auth.lib.php

@@ -429,8 +429,7 @@ class Auth
         $tbl_course               = Database::get_main_table(TABLE_MAIN_COURSE);
         $TABLE_COURSE_FIELD       = Database::get_main_table(TABLE_MAIN_COURSE_FIELD);
         $TABLE_COURSE_FIELD_VALUE = Database::get_main_table(TABLE_MAIN_COURSE_FIELD_VALUES);
-        $table_course_ranking       = Database::get_main_table(TABLE_STATISTIC_TRACK_COURSE_RANKING);
-        
+                
 
         // get course list auto-register
         $sql = "SELECT course_code FROM $TABLE_COURSE_FIELD_VALUE tcfv INNER JOIN $TABLE_COURSE_FIELD tcf ON tcfv.field_id = tcf.id 
@@ -487,10 +486,8 @@ class Auth
                 
                 if ($row['tutor_name'] == '0') {
                     $row['tutor_name'] = get_lang('NoManager');
-                }
-                
-                $point_info = CourseManager::get_course_ranking($row['id'], 0);        
-                
+                }                
+                $point_info = CourseManager::get_course_ranking($row['id'], 0);
                 $courses[] = array(
                                     'real_id'           => $row['id'],
                                     'point_info'		=> $point_info,                                    
@@ -504,6 +501,7 @@ class Auth
                                     'unsubscribe'       => $row['unsubscribe'],
                                     'registration_code' => $row['registration_code'],
                                     'creation_date'     => $row['creation_date'],
+                                    'visibility'        => $row['visibility'],
                                     'count_users'       => $count_users,
                                     'count_connections' => $count_connections_last_month
                                   );

+ 18 - 0
main/inc/lib/display.lib.php

@@ -1412,4 +1412,22 @@ class Display {
         }
         return $html;        
     }    
+    
+    function actions($items) {
+        if (!empty($items)) {
+            $html = '<div class="new_actions"><ul class="nav nav-pills">';        
+            foreach ($items as $value) {
+                $class = null;
+                if (isset($value['active']) && $value['active']) {
+                    $class = 'class ="active"';
+                }
+                $html .= "<li $class >"; 
+                $html .= self::url($value['content'], $value['url']);
+                $html .= '</li>'; 
+            }        
+            $html .= '</ul></div>';
+        }
+        return $html;
+        
+    }
 } //end class Display

+ 39 - 23
main/inc/lib/events.lib.inc.php

@@ -331,8 +331,7 @@ function update_event_exercice($exeid, $exo_id, $score, $weighting,$session_id,$
 		if (!exercise_time_control_is_valid($exo_id)) {
 			$score = 0;		
 	    }
-	    $now = time();
-              
+	                  
         /*  start_date wouldn't be updated
         $start_date_condition = '';        
 	    //Validation in case of wrong start_date
@@ -377,6 +376,9 @@ function update_event_exercice($exeid, $exo_id, $score, $weighting,$session_id,$
 				 WHERE exe_id = '".Database::escape_string($exeid)."'";
 		$res = Database::query($sql);
         
+        if ($debug) error_log('update_event_exercice called ');
+        if ($debug) error_log("$sql");
+        
         //Deleting control time session track		
 		//exercise_time_control_delete($exo_id);
 		return $res;        
@@ -448,56 +450,71 @@ function create_event_exercice($exo_id) {
  * @param	integer	Position
  * @return	boolean	Result of the insert query
  */
-function exercise_attempt($score, $answer, $quesId, $exeId, $j, $exercise_id = 0, $nano = null) {	
+function exercise_attempt($score, $answer, $question_id, $exe_id, $position, $exercise_id = 0, $nano = null) {	
     require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
-	$score 	= Database::escape_string($score);
-	$answer = Database::escape_string($answer);
-	$quesId = Database::escape_string($quesId);
-	$exeId 	= Database::escape_string($exeId);
-	$j 		= Database::escape_string($j);
+    global $debug;
+	$score          = Database::escape_string($score);
+	$answer         = Database::escape_string($answer);
+	$question_id    = Database::escape_string($question_id);
+	$exe_id          = Database::escape_string($exe_id);
+	$position 		= Database::escape_string($position);
+    $now            = api_get_utc_datetime();
+	$user_id        = api_get_user_id();
 		
 	$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
+    
+    if ($debug) error_log("----- entering exercise_attempt function ------");
+    
+    if ($debug) error_log("answer: $answer");
+    if ($debug) error_log("score: $score");
+    if ($debug) error_log("question_id : $question_id");
+    if ($debug) error_log("position: $position");
 
-	//Validation in case of fraud with actived control time	
-	
+	//Validation in case of fraud with actived control time	    	
     if (!exercise_time_control_is_valid($exercise_id)) {
+        if ($debug) error_log("exercise_time_control_is_valid is false");
     	$score = 0;
     	$answer = 0;
     	$j = 0;
 	}
-	$reallyNow 	= api_get_utc_datetime();
-	$user_id 	= api_get_user_id();
+	
+    
 	if (!empty($user_id)) {
 		$user_id = "'".$user_id."'";
 	} else {
 		// anonymous
 		$user_id = api_get_anonymous_id();
 	}		
-	$file = '';
-	
+    
+	$file = '';	
 	if (isset($nano)) {	
-		$file = basename($nano->load_filename_if_exists(false));
+		$file = Database::escape_string(basename($nano->load_filename_if_exists(false)));
 	}
     
 	$sql = "INSERT INTO $TBL_TRACK_ATTEMPT (exe_id, user_id, question_id, answer, marks, course_code, session_id, position, tms, filename)
 			  VALUES (
-			  ".$exeId.",
+			  ".$exe_id.",
 			  ".$user_id.",
-			   '".$quesId."',
+			   '".$question_id."',
 			   '".$answer."',
 			   '".$score."',
 			   '".api_get_course_id()."',
 			   '".api_get_session_id()."',
-			   '".$j."',
-			   '".$reallyNow."',
+			   '".$position."',
+			   '".$now."',
 			   '".$file."'
 			)";		
-    //error_log($sql);
-	if (!empty($quesId) && !empty($exeId) && !empty($user_id)) {
+    
+    if ($debug) error_log("Saving question attempt: ");
+    if ($debug) error_log($sql);
+    if ($debug) error_log("");
+    
+	if (!empty($question_id) && !empty($exe_id) && !empty($user_id)) {
 		$res = Database::query($sql);		
 		if (defined('ENABLED_LIVE_EXERCISE_TRACKING')){
 			$recording_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
-			$recording_changes = "INSERT INTO $recording_table (exe_id, question_id, marks, insert_date, author, session_id) VALUES ('$exeId','$quesId','$score','".api_get_utc_datetime()."','', '".api_get_session_id()."') ";
+            if ($debug) error_log("Saving e attempt recording ");
+			$recording_changes = "INSERT INTO $recording_table (exe_id, question_id, marks, insert_date, author, session_id) VALUES ('$exe_id','$question_id','$score','".api_get_utc_datetime()."','', '".api_get_session_id()."') ";
 			Database::query($recording_changes);			
 		}		
 		return $res;
@@ -1374,4 +1391,3 @@ function event_course_login($course_code, $user_id, $session_id) {
     //Course catalog stats modifications see #4191    
     CourseManager::update_course_ranking(null, null, null, null, true, false);
 }
-

+ 13 - 4
main/inc/lib/main_api.lib.php

@@ -628,6 +628,15 @@ function api_is_ldap_activated() {
     return is_array($extAuthSource[LDAP_AUTH_SOURCE]);
 }
 
+/**
+ * @return bool     Return true if Facebook authentification is activated
+ *
+ */
+function api_is_facebook_auth_activated() {
+    global $_configuration;
+    return (isset($_configuration['facebook_auth']) && $_configuration['facebook_auth'] == 1);
+}
+
 
 /**
  * This function checks whether a given path points inside the system.
@@ -4226,11 +4235,11 @@ function & api_get_settings($cat = null, $ordering = 'list', $access_url = 1, $u
 function & api_get_settings_categories($exceptions = array(), $access_url = 1) {
     $access_url = (int) $access_url;
     $t_cs = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
-    $list = "'".implode("','",$exceptions)."'";
-    $sql = "SELECT DISTINCT category FROM $t_cs";
+    $list = "'".implode("','",$exceptions)."'";    
+    $sql = "SELECT DISTINCT category FROM $t_cs WHERE category is NOT NULL ";
     if ($list != "'',''" and $list != "''" and !empty($list)) {
-        $sql .= " WHERE category NOT IN ($list)";
-    }
+        $sql .= " AND category NOT IN ($list) ";
+    }    
     $result = Database::store_result(Database::query($sql));
     return $result;
 }

+ 20 - 21
main/inc/lib/usermanager.lib.php

@@ -1775,6 +1775,7 @@ class UserManager {
 		$tbl_session_user			= Database :: get_main_table(TABLE_MAIN_SESSION_USER);
 		$tbl_session				= Database :: get_main_table(TABLE_MAIN_SESSION);		
 		$tbl_session_course_user	= Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+        
 		if ($user_id != strval(intval($user_id))) return array();
 
 		$categories = array();
@@ -1782,7 +1783,8 @@ class UserManager {
 		if ($fill_first) {
 			$categories[0] = array();
 		}
-		// get the list of sessions where the user is subscribed as student
+        
+		// Get the list of sessions where the user is subscribed as student
 
 		$condition_date_end = "";
 		if ($is_time_over) {
@@ -1791,11 +1793,10 @@ class UserManager {
 			$condition_date_end = " AND (date_end >= CURDATE() OR date_end = '0000-00-00') ";
 		}
 
-		$sessions_sql = "SELECT DISTINCT id, session_category_id, session.name "
-                        ." FROM $tbl_session_user, $tbl_session "
-                        ." WHERE id_session=id AND id_user=$user_id " 
-                        ." $condition_date_end "
-                        ." ORDER BY session_category_id, date_start, date_end";
+		$sessions_sql = "SELECT DISTINCT id, session_category_id, session.name 
+                        FROM $tbl_session_user, $tbl_session 
+                        WHERE id_session=id AND id_user=$user_id $condition_date_end 
+                        ORDER BY session_category_id, date_start, date_end";
         $result = Database::query($sessions_sql);
         if (Database::num_rows($result) > 0) {
             while ($row = Database::fetch_array($result)) {
@@ -1804,17 +1805,16 @@ class UserManager {
             }
         }
 
-        // get the list of sessions where the user is subscribed as coach in a 
+        // Get the list of sessions where the user is subscribed as coach in a 
         // course, from table session_rel_course_rel_user
 
-		$sessions_sql = "SELECT DISTINCT id, session_category_id, session.name "
-                        ." FROM $tbl_session as session "
-                        ." INNER JOIN $tbl_session_course_user as session_rel_course_user "
-                          ." ON session_rel_course_user.id_session = session.id "
-                          ." AND session_rel_course_user.id_user = $user_id "
-                          ." AND session_rel_course_user.status = 2	$condition_date_end "
-                        ." ORDER BY session_category_id, date_start, date_end";
-
+		$sessions_sql = "SELECT DISTINCT id, session_category_id, session.name 
+                            FROM $tbl_session as session  INNER JOIN $tbl_session_course_user as session_rel_course_user 
+                            ON  session_rel_course_user.id_session = session.id  AND 
+                                session_rel_course_user.id_user = $user_id AND 
+                                session_rel_course_user.status = 2 $condition_date_end 
+                            ORDER BY session_category_id, date_start, date_end";
+        
         $result = Database::query($sessions_sql);
         if (Database::num_rows($result)>0) {
             while ($row = Database::fetch_array($result)) {
@@ -1823,11 +1823,10 @@ class UserManager {
             }
         }
 
-        // get the list of sessions where the user is subscribed as session coach
-        $sessions_sql = "SELECT DISTINCT id, session_category_id, session.name "
-                        ." FROM $tbl_session as session "
-                        ." WHERE session.id_coach = $user_id $condition_date_end "
-                        ." ORDER BY session_category_id, date_start, date_end";
+        // Get the list of sessions where the user is subscribed as a session coach
+        $sessions_sql = "SELECT DISTINCT id, session_category_id, session.name FROM $tbl_session as session 
+                            WHERE session.id_coach = $user_id $condition_date_end 
+                            ORDER BY session_category_id, date_start, date_end";
 
 		$result = Database::query($sessions_sql);
 		if (Database::num_rows($result)>0) {
@@ -3402,4 +3401,4 @@ class UserManager {
         }
         return false;
     }
-}
+}

+ 3 - 6
main/inc/lib/userportal.lib.php

@@ -683,15 +683,12 @@ class IndexManager {
         $id_label = null;
 	    if (!empty($id)) {
             $id_label = " id = $id ";
-        }
-        
-		$html= '<div '.$id_label.' class="well sidebar-nav">';
-		//$html.= '<div class="menusection">';
+        }        
+		$html= '<div '.$id_label.' class="well sidebar-nav">';		
 		if (!empty($title)) {
 			$html.= '<h4>'.$title.'</h4>';
 		}        
-		$html.= $content;
-	    //$html.= '</div>';        
+		$html.= $content;	    
 	    $html.= '</div>';   
 		return $html;
 	}

+ 15 - 14
main/install/configuration.dist.php

@@ -82,25 +82,26 @@ $_configuration['db_admin_path']  = '';
  * 
  * Login modules settings
  */
-// For new login module
-// Uncomment these lines to activate ldap
-// $extAuthSource["ldap"]["login"]						= $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/login.php";
-// $extAuthSource["ldap"]["newUser"]					= $_configuration['root_sys'].$_configuration['code_append']."auth/ldap/newUser.php";
+// CAS IMPLEMENTATION
+// -> Go to your portal Chamilo > Administration > CAS to activate CAS
+// You can leave these lines uncommented even if you don't use CAS authentification
+$extAuthSource["cas"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/cas/login.php";
+$extAuthSource["cas"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/cas/newUser.php";
 //
-// Go to Chamilo > Administration > CAS to activate CAS
-// You can leave these lines uncommented even if you don't use CAS
-$extAuthSource["cas"]["login"]						= $_configuration['root_sys'].$_configuration['code_append']."auth/cas/login.php";
-$extAuthSource["cas"]["newUser"]					= $_configuration['root_sys'].$_configuration['code_append']."auth/cas/newUser.php";
+// NEW LDAP IMPLEMENTATION BASED ON external_login info
+// -> Uncomment the two lines bellow to activate LDAP AND edit main/auth/external_login/ldap.conf.php for configuration
+// $extAuthSource["extldap"]["login"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/login.ldap.php";
+// $extAuthSource["extldap"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/newUser.ldap.php";
 //
+// FACEBOOK IMPLEMENTATION BASED ON external_login info
+// -> Uncomment the line bellow to activate Facebook Auth AND edit main/auth/external_login/ldap.conf.php for configuration
+// $_configuration['facebook_auth'] = 1;
+//
+// OTHER EXTERNAL LOGIN INFORMATION
 // To fetch external login information, uncomment those 2 lines and modify  files auth/external_login/newUser.php and auth/external_login/updateUser.php files
 // $extAuthSource["external_login"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/newUser.php";
 // $extAuthSource["external_login"]["updateUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/updateUser.php";
-//
-//NEW LDAP IMPLEMENTATION BASED ON external_logininfo
-// Please edit main/auth/external_login/ldap.conf.php
-//$extAuthSource["extldap"]["login"]						= $_configuration['root_sys'].$_configuration['code_append']."auth/external_login/login.ldap.php";
-//$extAuthSource["extldap"]["newUser"]					= $_configuration['root_sys'].$_configuration['code_append']."auth/external_ldap/newUser.ldap.php";
-//
+
 /**
  * 
  * Hosting settings - Allows you to set limits to the Chamilo portal when

+ 14 - 19
main/install/db_main.sql

@@ -702,16 +702,6 @@ VALUES
 ('display_upcoming_events',NULL,'radio','Tools','true','DisplayUpcomingEventsTitle','DisplayUpcomingEventsComment',NULL,NULL, 0),
 ('number_of_upcoming_events',NULL,'textfield','Tools','1','NumberOfUpcomingEventsTitle','NumberOfUpcomingEventsComment',NULL,NULL, 0),
 ('show_closed_courses',NULL,'radio','Platform','false','ShowClosedCoursesTitle','ShowClosedCoursesComment',NULL,NULL, 0),
-('ldap_main_server_address', NULL, 'textfield', 'LDAP', 'localhost', 'LDAPMainServerAddressTitle', 'LDAPMainServerAddressComment', NULL, NULL, 0),
-('ldap_main_server_port', NULL, 'textfield', 'LDAP', '389', 'LDAPMainServerPortTitle', 'LDAPMainServerPortComment', NULL, NULL, 0),
-('ldap_domain', NULL, 'textfield', 'LDAP', 'dc=nodomain', 'LDAPDomainTitle', 'LDAPDomainComment', NULL, NULL, 0),
-('ldap_replicate_server_address', NULL, 'textfield', 'LDAP', 'localhost', 'LDAPReplicateServerAddressTitle', 'LDAPReplicateServerAddressComment', NULL, NULL, 0),
-('ldap_replicate_server_port', NULL, 'textfield', 'LDAP', '389', 'LDAPReplicateServerPortTitle', 'LDAPReplicateServerPortComment', NULL, NULL, 0),
-('ldap_search_term', NULL, 'textfield', 'LDAP', '', 'LDAPSearchTermTitle', 'LDAPSearchTermComment', NULL, NULL, 0),
-('ldap_version', NULL, 'radio', 'LDAP', '3', 'LDAPVersionTitle', 'LDAPVersionComment', NULL, '', 0),
-('ldap_filled_tutor_field', NULL, 'textfield', 'LDAP', 'employeenumber', 'LDAPFilledTutorFieldTitle', 'LDAPFilledTutorFieldComment', NULL, '', 0),
-('ldap_authentication_login', NULL, 'textfield', 'LDAP', '', 'LDAPAuthenticationLoginTitle', 'LDAPAuthenticationLoginComment', NULL, '', 0),
-('ldap_authentication_password', NULL, 'textfield', 'LDAP', '', 'LDAPAuthenticationPasswordTitle', 'LDAPAuthenticationPasswordComment', NULL, '', 0),
 ('service_visio', 'visio_use_rtmpt', 'radio',null,'false', 'VisioUseRtmptTitle','VisioUseRtmptComment', NULL, NULL, 0),
 ('extendedprofile_registration', 'mycomptetences', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyCompetences', 0),
 ('extendedprofile_registration', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationTitle','ExtendedProfileRegistrationComment', NULL, 'MyDiplomas', 0),
@@ -721,7 +711,7 @@ VALUES
 ('extendedprofile_registrationrequired', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyDiplomas', 0),
 ('extendedprofile_registrationrequired', 'myteach', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyTeach', 0),
 ('extendedprofile_registrationrequired', 'mypersonalopenarea', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyPersonalOpenArea', 0),
-('ldap_filled_tutor_field_value', NULL, 'textfield', 'LDAP', '', 'LDAPFilledTutorFieldValueTitle', 'LDAPFilledTutorFieldValueComment', NULL, '', 0),
+('ldap_description', NULL, 'radio', 'LDAP', NULL, 'LdapDescriptionTitle', 'LdapDescriptionComment', NULL, NULL, 0),
 ('registration','phone','textfield','User','false','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Phone', 0),
 ('add_users_by_coach',NULL,'radio','Security','false','AddUsersByCoachTitle','AddUsersByCoachComment',NULL,NULL, 0),
 ('extend_rights_for_coach',NULL,'radio','Security','false','ExtendRightsForCoachTitle','ExtendRightsForCoachComment',NULL,NULL, 0),
@@ -837,10 +827,7 @@ VALUES
 ('cas_port', NULL, 'textfield', 'CAS', '', 'CasMainPortTitle', 'CasMainPortComment', NULL, NULL, 0),
 ('cas_protocol', NULL, 'radio', 'CAS', '', 'CasMainProtocolTitle', 'CasMainProtocolComment', NULL, NULL, 0),
 ('cas_add_user_activate', NULL, 'radio', 'CAS', '', 'CasUserAddActivateTitle', 'CasUserAddActivateComment', NULL, NULL, 0),
-('cas_add_user_login_attr', NULL, 'textfield', 'CAS', '', 'CasUserAddLoginAttributeTitle', 'CasUserAddLoginAttributeComment', NULL, NULL, 0),
-('cas_add_user_email_attr', NULL, 'textfield', 'CAS', '', 'CasUserAddEmailAttributeTitle', 'CasUserAddEmailAttributeComment', NULL, NULL, 0),
-('cas_add_user_firstname_attr', NULL, 'textfield', 'CAS', '', 'CasUserAddFirstnameAttributeTitle', 'CasUserAddFirstnameAttributeComment', NULL, NULL, 0),
-('cas_add_user_lastname_attr', NULL, 'textfield', 'CAS', '', 'CasUserAddLastnameAttributeTitle', 'CasUserAddLastnameAttributeComment', NULL, NULL, 0),
+('update_user_info_cas_with_ldap', NULL, 'radio', 'CAS', 'true', 'UpdateUserInfoCasWithLdapTitle', 'UpdateUserInfoCasWithLdapComment', NULL, NULL, 0),
 ('student_page_after_login', NULL, 'textfield', 'Platform', '', 'StudentPageAfterLoginTitle', 'StudentPageAfterLoginComment', NULL, NULL, 0),
 ('teacher_page_after_login', NULL, 'textfield', 'Platform', '', 'TeacherPageAfterLoginTitle', 'TeacherPageAfterLoginComment', NULL, NULL, 0),
 ('drh_page_after_login', NULL, 'textfield', 'Platform', '', 'DRHPageAfterLoginTitle', 'DRHPageAfterLoginComment', NULL, NULL, 0),
@@ -864,7 +851,8 @@ VALUES
 ('courses_default_creation_visibility', NULL, 'radio', 'Course', '2', 'CoursesDefaultCreationVisibilityTitle', 'CoursesDefaultCreationVisibilityComment', NULL, NULL, 1),
 ('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle', 'AllowBrowserSnifferComment', NULL, NULL, 0),
 ('enable_wami_record',NULL,'radio','Tools','false','EnableWamiRecordTitle','EnableWamiRecordComment',NULL,NULL, 0),
-('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17486','DatabaseVersion','', NULL, NULL, 0);
+('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0),
+('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17536','DatabaseVersion','', NULL, NULL, 0);
 
 /*
 ('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1),
@@ -1153,8 +1141,11 @@ VALUES
 ('cas_protocol', 'CAS1', 'CAS1Text'),
 ('cas_protocol', 'CAS2', 'CAS2Text'),
 ('cas_protocol', 'SAML', 'SAMLText'),
-('cas_add_user_activate', 'true', 'Yes'),
 ('cas_add_user_activate', 'false', 'No'),
+('cas_add_user_activate', 'platform', 'casAddUserActivatePlatform'),
+('cas_add_user_activate', 'extldap', 'casAddUserActivateLDAP'),
+('update_user_info_cas_with_ldap', 'true', 'Yes'),
+('update_user_info_cas_with_ldap', 'false', 'No'),
 ('scorm_cumulative_session_time','true','Yes'),
 ('scorm_cumulative_session_time','false','No'),
 ('allow_hr_skills_management', 'true', 'Yes'),
@@ -1198,7 +1189,11 @@ VALUES
 ('allow_browser_sniffer', 'true', 'Yes'),
 ('allow_browser_sniffer', 'false', 'No'),
 ('enable_wami_record', 'true', 'Yes'),
-('enable_wami_record', 'false', 'No');
+('enable_wami_record', 'false', 'No'),
+('cas_add_user_activate', 'extldap', 'casAddUserActivateLDAP'),
+('update_user_info_cas_with_ldap', 'true', 'Yes'),
+('update_user_info_cas_with_ldap', 'false', 'No');
+
 
 UNLOCK TABLES;
 /*
@@ -1355,7 +1350,7 @@ CREATE TABLE IF NOT EXISTS gradebook_evaluation (
   course_code varchar(40) default NULL,
   category_id int default NULL,
   created_at DATETIME NOT NULL default '0000-00-00 00:00:00',
-  weight smallint NOT NULL,
+  weight FLOAT NOT NULL,
   max float unsigned NOT NULL,
   visible tinyint NOT NULL,
   type varchar(40) NOT NULL default 'evaluation',

+ 25 - 5
main/install/db_stats.sql

@@ -8,6 +8,7 @@
 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
 
+DROP TABLE IF EXISTS track_c_browsers;
 CREATE TABLE track_c_browsers (
   id int NOT NULL auto_increment,
   browser varchar(255) NOT NULL default '',
@@ -15,6 +16,7 @@ CREATE TABLE track_c_browsers (
   PRIMARY KEY  (id)
 );
 
+DROP TABLE IF EXISTS track_c_countries;
 CREATE TABLE track_c_countries (
   id int NOT NULL auto_increment,
   code varchar(40) NOT NULL default '',
@@ -23,6 +25,7 @@ CREATE TABLE track_c_countries (
   PRIMARY KEY  (id)
 );
 
+DROP TABLE IF EXISTS track_c_os;
 CREATE TABLE track_c_os (
   id int NOT NULL auto_increment,
   os varchar(255) NOT NULL default '',
@@ -30,6 +33,7 @@ CREATE TABLE track_c_os (
   PRIMARY KEY  (id)
 );
 
+DROP TABLE IF EXISTS track_c_providers;
 CREATE TABLE track_c_providers (
   id int NOT NULL auto_increment,
   provider varchar(255) NOT NULL default '',
@@ -37,6 +41,7 @@ CREATE TABLE track_c_providers (
   PRIMARY KEY  (id)
 );
 
+DROP TABLE IF EXISTS track_c_referers;
 CREATE TABLE track_c_referers (
   id int NOT NULL auto_increment,
   referer varchar(255) NOT NULL default '',
@@ -44,6 +49,7 @@ CREATE TABLE track_c_referers (
   PRIMARY KEY  (id)
 );
 
+DROP TABLE IF EXISTS track_e_access;
 CREATE TABLE track_e_access (
   access_id int NOT NULL auto_increment,
   access_user_id int unsigned default NULL,
@@ -56,6 +62,7 @@ CREATE TABLE track_e_access (
   KEY access_cours_code (access_cours_code)
 );
 
+DROP TABLE IF EXISTS track_e_lastaccess;
 CREATE TABLE track_e_lastaccess (
   access_id bigint NOT NULL auto_increment,
   access_user_id int unsigned default NULL,
@@ -69,7 +76,7 @@ CREATE TABLE track_e_lastaccess (
   KEY access_session_id (access_session_id)
 );
 
-
+DROP TABLE IF EXISTS track_e_default;
 CREATE TABLE track_e_default (
   default_id int NOT NULL auto_increment,
   default_user_id int unsigned NOT NULL default 0,
@@ -81,6 +88,7 @@ CREATE TABLE track_e_default (
   PRIMARY KEY  (default_id)
 );
 
+DROP TABLE IF EXISTS track_e_downloads;
 CREATE TABLE track_e_downloads (
   down_id int NOT NULL auto_increment,
   down_user_id int unsigned default NULL,
@@ -93,6 +101,7 @@ CREATE TABLE track_e_downloads (
   KEY down_cours_id (down_cours_id)
 );
 
+DROP TABLE IF EXISTS track_e_exercices;
 CREATE TABLE track_e_exercices (
   exe_id int NOT NULL auto_increment,
   exe_user_id int unsigned default NULL,
@@ -119,7 +128,7 @@ ALTER TABLE track_e_exercices ADD COLUMN expired_time_control datetime NOT NULL
 ALTER TABLE track_e_exercices ADD COLUMN orig_lp_item_view_id INT NOT NULL DEFAULT 0;
 ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT  NOT NULL DEFAULT '';
 
-
+DROP TABLE IF EXISTS track_e_attempt;
 CREATE TABLE track_e_attempt (
   exe_id int default NULL,
   user_id int NOT NULL default 0,
@@ -138,6 +147,7 @@ ALTER TABLE track_e_attempt ADD INDEX (user_id);
 ALTER TABLE track_e_attempt ADD INDEX (question_id);
 ALTER TABLE track_e_attempt ADD INDEX (session_id);
 
+DROP TABLE IF EXISTS track_e_attempt_recording;
 CREATE TABLE track_e_attempt_recording (
   exe_id int unsigned NOT NULL, 
   question_id int unsigned NOT NULL,  
@@ -151,6 +161,7 @@ ALTER TABLE track_e_attempt_recording ADD INDEX (exe_id);
 ALTER TABLE track_e_attempt_recording ADD INDEX (question_id);
 ALTER TABLE track_e_attempt_recording ADD INDEX (session_id);
 
+DROP TABLE IF EXISTS track_e_hotpotatoes;
 CREATE TABLE track_e_hotpotatoes (
   exe_name VARCHAR( 255 ) NOT NULL ,
   exe_user_id int unsigned DEFAULT NULL ,
@@ -162,6 +173,7 @@ CREATE TABLE track_e_hotpotatoes (
   KEY exe_cours_id (exe_cours_id)
 );
 
+DROP TABLE IF EXISTS track_e_links;
 CREATE TABLE track_e_links (
   links_id int NOT NULL auto_increment,
   links_user_id int unsigned default NULL,
@@ -174,6 +186,7 @@ CREATE TABLE track_e_links (
   KEY links_user_id (links_user_id)
 );
 
+DROP TABLE IF EXISTS track_e_login;
 CREATE TABLE track_e_login (
   login_id int NOT NULL auto_increment,
   login_user_id int unsigned NOT NULL default 0,
@@ -184,6 +197,7 @@ CREATE TABLE track_e_login (
   KEY login_user_id (login_user_id)
 );
 
+DROP TABLE IF EXISTS track_e_online;
 CREATE TABLE track_e_online (
   login_id int NOT NULL auto_increment,
   login_user_id int unsigned NOT NULL default 0,
@@ -195,7 +209,7 @@ CREATE TABLE track_e_online (
   PRIMARY KEY  (login_id),
   KEY login_user_id (login_user_id)
 );
-
+DROP TABLE IF EXISTS track_e_open;
 CREATE TABLE track_e_open (
   open_id int NOT NULL auto_increment,
   open_remote_host tinytext NOT NULL,
@@ -205,6 +219,7 @@ CREATE TABLE track_e_open (
   PRIMARY KEY  (open_id)
 );
 
+DROP TABLE IF EXISTS track_e_uploads;
 CREATE TABLE track_e_uploads (
   upload_id int NOT NULL auto_increment,
   upload_user_id int unsigned default NULL,
@@ -217,6 +232,7 @@ CREATE TABLE track_e_uploads (
   KEY upload_cours_id (upload_cours_id)
 );
 
+DROP TABLE IF EXISTS track_e_course_access;
 CREATE TABLE track_e_course_access (
   course_access_id int NOT NULL auto_increment,
   course_code varchar(40) NOT NULL,
@@ -228,6 +244,7 @@ CREATE TABLE track_e_course_access (
   PRIMARY KEY  (course_access_id)
 );
 
+DROP TABLE IF EXISTS track_e_hotspot;
 CREATE TABLE track_e_hotspot (
   hotspot_id int NOT NULL auto_increment,
   hotspot_user_id int NOT NULL,
@@ -244,6 +261,8 @@ CREATE TABLE track_e_hotspot (
   KEY hotspot_question_id (hotspot_question_id)
 );
 
+DROP TABLE IF EXISTS track_e_item_property;
+
 CREATE TABLE track_e_item_property (
   id int NOT NULL auto_increment PRIMARY KEY,
   course_id int NOT NULL,
@@ -273,6 +292,7 @@ ALTER TABLE track_e_uploads ADD INDEX (upload_session_id);
 --
 -- Table structure for LP custom storage API
 --
+DROP TABLE IF EXISTS stored_values;
 CREATE TABLE stored_values (
         user_id INT NOT NULL,
         sco_id INT NOT NULL,
@@ -283,6 +303,7 @@ CREATE TABLE stored_values (
 ALTER TABLE stored_values ADD KEY (user_id, sco_id, course_id, sv_key);
 ALTER TABLE stored_values ADD UNIQUE (user_id, sco_id, course_id, sv_key);
 
+DROP TABLE IF EXISTS stored_values_stack;
 CREATE TABLE stored_values_stack (
         user_id INT NOT NULL,
         sco_id INT NOT NULL,
@@ -292,5 +313,4 @@ CREATE TABLE stored_values_stack (
         sv_value TEXT NOT NULL
 );
 ALTER TABLE stored_values_stack ADD KEY (user_id, sco_id, course_id, sv_key, stack_order);
-ALTER TABLE stored_values_stack ADD UNIQUE (user_id, sco_id, course_id, sv_key, stack_order);
-
+ALTER TABLE stored_values_stack ADD UNIQUE (user_id, sco_id, course_id, sv_key, stack_order);

+ 6 - 2
main/install/migrate-db-1.8.8-1.9.0-pre.sql

@@ -146,6 +146,7 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_wami_record', 'true', 'Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_wami_record', 'false', 'No');
 
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0);
 
 -- Course ranking
 
@@ -173,9 +174,10 @@ CREATE TABLE grade_model (id INTEGER  NOT NULL AUTO_INCREMENT, name VARCHAR(255)
 CREATE TABLE grade_components (id INTEGER  NOT NULL AUTO_INCREMENT, percentage VARCHAR(255)  NOT NULL, title VARCHAR(255)  NOT NULL, acronym VARCHAR(255)  NOT NULL, grade_model_id INTEGER NOT NULL, PRIMARY KEY (id));
 ALTER TABLE gradebook_category ADD COLUMN grade_model_id INT DEFAULT 0;
 UPDATE settings_current SET title = 'DatabaseVersion' WHERE variable = 'chamilo_database_version';
+ALTER TABLE gradebook_evaluation MODIFY COLUMN weight FLOAT NOT NULL;
 
 -- Do not move this query
-UPDATE settings_current SET selected_value = '1.9.0.17486' WHERE variable = 'chamilo_database_version';
+UPDATE settings_current SET selected_value = '1.9.0.17536' WHERE variable = 'chamilo_database_version';
 
 -- xxSTATSxx
 ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';
@@ -201,4 +203,6 @@ ALTER TABLE student_publication ADD COLUMN allow_text_assignment INTEGER NOT NUL
 ALTER TABLE quiz ADD COLUMN random_by_category INT NOT NULL DEFAULT 0;
 ALTER TABLE quiz ADD COLUMN text_when_finished TEXT DEFAULT NULL;
 ALTER TABLE quiz ADD COLUMN display_category_name INT NOT NULL DEFAULT 1;
-ALTER TABLE quiz ADD COLUMN pass_percentage INT DEFAULT NULL;
+ALTER TABLE quiz ADD COLUMN pass_percentage INT DEFAULT NULL;
+
+

+ 19 - 15
main/social/friends.php

@@ -49,8 +49,8 @@ function search_image_social()  {
 		type: "POST",
 		url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=show_my_friends",
 		data: "search_name_q="+name_search,
-		success: function(datos) {
-			$("#friend_table").html(datos);
+		success: function(data) {
+			$("#friends").html(data);
 		}
 	});
 }
@@ -99,38 +99,42 @@ if (isset($name_search) && $name_search!='undefined') {
 	$friends = SocialManager::get_friends($user_id);
 }
 
-$social_right_content .= '<div class="span8">';
+$social_right_content = '<div class="span8">';
 
 if (count($friends) == 0 ) {
 	$social_right_content .= get_lang('NoFriendsInYourContactList').'<br /><br />';
 	$social_right_content .= '<a class="btn" href="search.php">'.get_lang('TryAndFindSomeFriends').'</a>';	
 } else {
-	$social_right_content = get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;';
+	$social_right_content .= get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;';
 	$social_right_content .= '<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" onkeyup="search_image_social()" />';
     
-    $friend_html = '';
+    $friend_html = '<div id="friends">';
 
     $number_friends = count($friends);
     $j=0;		    
     
-    $friend_html.= '<table id="friend_table" width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="" >';
-    for ($k=0;$k<$number_friends;$k++) {
-        $friend_html.='<tr><td valign="top">';
-
+    $friend_html.= '<ul class="thumbnails">';
+    for ($k=0;$k<$number_friends;$k++) {        
         while ($j<$number_friends) {
+            
             if (isset($friends[$j])) {
+                $friend_html.='<li class="span2">';
                 $friend = $friends[$j];
                 $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
                 $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92);
-                $friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
-                $friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="height:60px;" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
-                $friend_html.='<img onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].' src="../img/blank.gif" alt="" title=""  class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';				
+                $friend_html.='<div class="thumbnail" onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
+                $friend_html.='<img src="'.$friends_profile['file'].'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" />                                    ';
+                $friend_html.='<div class="caption">                                   
+                               <a href="profile.php?u='.$friend['friend_user_id'].'"> <h5>'.$user_name.'</h5></a>';
+                $friend_html.='<p><button onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].'  />'.get_lang('Delete').'</button></p>
+                        </div>';				
+                $friend_html.='</li>';
             }
             $j++;
-        }
-        $friend_html.='</td></tr>';
+        }        
     }
-    $friend_html.='</table>';
+    $friend_html.='</ul>';
+    $friend_html.='</div>';
     $social_right_content .=  $friend_html;
 }
 $social_right_content .= '</div>';

+ 22 - 23
main/template/default/auth/courses_categories.php

@@ -31,15 +31,13 @@ $stok = Security::get_token();
 
 <?php if (intval($_GET['hidden_links']) != 1) { ?>
 
-<div id="actions" class="actions">
-	<span id="categories-search">
-    	<form class="course_list" method="post" action="<?php echo api_get_self(); ?>?action=subscribe&amp;hidden_links=0">            
-        	<input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
-            <input type="hidden" name="search_course" value="1" />
-            <input type="text" name="search_term" value="<?php echo (empty($_POST['search_term']) ? '' : api_htmlentities(Security::remove_XSS($_POST['search_term']))); ?>" />
-            &nbsp;<button class="search" type="submit"><?php echo get_lang('SearchCourse'); ?></button>
-		</form>
-	</span>
+<div class="actions">
+    <form class="form-search" method="post" action="<?php echo api_get_self(); ?>?action=subscribe&amp;hidden_links=0">            
+        <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
+        <input type="hidden" name="search_course" value="1" />
+        <input type="text" name="search_term" value="<?php echo (empty($_POST['search_term']) ? '' : api_htmlentities(Security::remove_XSS($_POST['search_term']))); ?>" />
+        &nbsp;<button class="search" type="submit"><?php echo get_lang('SearchCourse'); ?></button>
+    </form>	
 </div>
 <?php 
     $hidden_links = 0;
@@ -51,12 +49,7 @@ $stok = Security::get_token();
     <div class="span3">
         <div class="well">
             <?php 
-            if (!empty($browse_course_categories)) {
-                /*if ($action == 'display_random_courses') { 
-                    echo '<strong>'.get_lang('RandomPick').'</strong>';
-                    $code = '';
-                } else {                    
-                }*/
+            if (!empty($browse_course_categories)) {                   
                 echo '<a class="btn" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a><br /><br />';
                 
                 // level 1
@@ -110,6 +103,7 @@ $stok = Security::get_token();
             ?>
         </div>
     </div>
+    
     <div class="span9">
         <?php 
         if (!empty($message)) { Display::display_confirmation_message($message, false); }         
@@ -140,8 +134,7 @@ $stok = Security::get_token();
                 
                 $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&amp;course_id='.$course['real_id'], $course['point_info']);
                 
-                echo '<div class="well_border"><div class="row">';
-                
+                echo '<div class="well_border"><div class="row">';                
                     echo '<div class="span2">';
                         echo '<div class="thumbnail">';                
                         if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
@@ -159,17 +152,23 @@ $stok = Security::get_token();
                     
                     echo '<p>';
                     // we display the icon to subscribe or the text already subscribed
-                    if (!in_array($course['code'], $user_coursecodes)) {
-                        
-                        if ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM && !api_is_anonymous())) {
-                             echo '<a class="btn btn-primary" href="'.  api_get_course_url($course['code']).'">'.get_lang('GoToCourse').'</a>';
-                        } else {
-                            if ($course['subscribe'] == SUBSCRIBE_ALLOWED && !api_is_anonymous()) {
+                    
+                                       
+                    if ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM && !api_is_anonymous())) {
+                        echo '<a class="btn btn-primary" href="'.  api_get_course_url($course['code']).'">'.get_lang('GoToCourse').'</a>';
+                    } else {
+                        if ($course['subscribe'] == SUBSCRIBE_ALLOWED && !api_is_anonymous()) {
+                            if (!in_array($course['code'], $user_coursecodes) || empty($user_coursecodes)) {     
                                 echo '<a class="btn btn-primary" href="'. api_get_self().'?action=subscribe_course&amp;sec_token='.$stok.'&amp;subscribe_course='.$course['code'].'&amp;search_term='.$search_term.'&amp;category_code='.$code.'">'.
                                         get_lang('Subscribe').'</a>';
+                            } else {
+                                if (!api_is_anonymous()) {
+                                    echo '<a class="btn btn-primary" href="'.  api_get_course_url($course['code']).'">'.get_lang('GoToCourse').'</a>';    
+                                }
                             }
                         }
                     }
+                    
                     if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
                         echo '&nbsp;<a class="ajax btn" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&amp;code='.$course['code'].'" title="'.$icon_title.'" class="thickbox">'.get_lang('Description').'</a>';
                     }

+ 40 - 11
main/template/default/layout/head.tpl

@@ -77,22 +77,51 @@ function get_url_params(q, attribute) {
 
 $(document).scroll(function() {
     // Top bar scroll effect
-    if($('body').width() > 959) {
-    if ($('.subnav').length) {
-        if (!$('.subnav').attr('data-top')) {
+    if ($('body').width() > 959) {
+        if ($('.subnav').length) {
+            if (!$('.subnav').attr('data-top')) {
+                // If already fixed, then do nothing
+                if ($('.subnav').hasClass('subnav-fixed')) return;
+                // Remember top position
+                var offset = $('.subnav').offset();
+                $('.subnav').attr('data-top', offset.top);
+            }
+
+            if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop()) {
+                $('.subnav').addClass('subnav-fixed');
+            } else {
+                $('.subnav').removeClass('subnav-fixed');
+            }
+        }
+    }
+    
+    
+    if ($('.new_actions').length) {
+        if (!$('.new_actions').attr('data-top')) {
             // If already fixed, then do nothing
-            if ($('.subnav').hasClass('subnav-fixed')) return;
+            if ($('.new_actions').hasClass('new_actions-fixed')) return;
             // Remember top position
-            var offset = $('.subnav').offset()
-            $('.subnav').attr('data-top', offset.top);
+            var offset = $('.new_actions').offset();
+            
+            var more_top = 0;
+            if ($('.subnav').hasClass('new_actions-fixed')) {
+                more_top = 50;
+            }
+            
+            $('.new_actions').attr('data-top', offset.top + more_top);
+            
         }
-
-        if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop())
-            $('.subnav').addClass('subnav-fixed');
-        else
-            $('.subnav').removeClass('subnav-fixed');
+        
+        if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) {
+            $('.new_actions').addClass('new_actions-fixed');
+              
+        } else {
+            $('.new_actions').removeClass('new_actions-fixed');
         }
     }
+    
+    
+    
 });
 
 $(document).ready(function() {

+ 1 - 6
main/template/default/layout/login_form.tpl

@@ -1,10 +1,5 @@
 <div id="login_block" class="well sidebar-nav">
-	<div class="menusection">
-		<span class="menusectioncaption">
-		{{"Login"|get_lang}}
-		</span>	
-	</div>
-	
+        
 	{{ login_language_form }}
         
     {% if plugin_login_top is not null %}