Browse Source

Merge branch 'master' of github.com:chamilo/chamilo-lms

Julio Montoya 11 years ago
parent
commit
0db45ad434
31 changed files with 140 additions and 1242 deletions
  1. 6 1
      documentation/installation_guide.html
  2. 2 2
      main/admin/access_url_edit_courses_to_url.php
  3. 21 21
      main/admin/access_url_edit_users_to_url.php
  4. 34 33
      main/admin/access_urls.php
  5. 6 5
      main/admin/subscribe_user2course.php
  6. 2 2
      main/inc/lib/access_url_edit_courses_to_url_functions.lib.php
  7. 1 1
      main/inc/lib/access_url_edit_users_to_url_functions.lib.php
  8. 6 3
      main/inc/lib/main_api.lib.php
  9. 2 2
      main/template/default/layout/footer.tpl
  10. 1 0
      main/template/default/layout/head.tpl
  11. 2 0
      main/template/default/layout/main_header.tpl
  12. 2 2
      main/template/default/layout/show_header.tpl
  13. 2 19
      main/template/jquery_mobile/layout/block_menu.tpl
  14. 2 60
      main/template/jquery_mobile/layout/course_navigation.tpl
  15. 3 190
      main/template/jquery_mobile/layout/footer.tpl
  16. 5 305
      main/template/jquery_mobile/layout/head.tpl
  17. 3 27
      main/template/jquery_mobile/layout/hot_course_item.tpl
  18. 3 27
      main/template/jquery_mobile/layout/hot_course_item_popup.tpl
  19. 2 41
      main/template/jquery_mobile/layout/hot_courses.tpl
  20. 2 21
      main/template/jquery_mobile/layout/login_form.tpl
  21. 2 20
      main/template/jquery_mobile/layout/main.tpl
  22. 10 82
      main/template/jquery_mobile/layout/main_header.tpl
  23. 2 49
      main/template/jquery_mobile/layout/menu.tpl
  24. 3 16
      main/template/jquery_mobile/layout/no_layout.tpl
  25. 2 30
      main/template/jquery_mobile/layout/page_body.tpl
  26. 2 19
      main/template/jquery_mobile/layout/show_footer.tpl
  27. 3 11
      main/template/jquery_mobile/layout/show_header.tpl
  28. 2 133
      main/template/jquery_mobile/layout/sniff.tpl
  29. 2 16
      main/template/jquery_mobile/layout/social_layout.tpl
  30. 3 87
      main/template/jquery_mobile/layout/topbar.tpl
  31. 2 17
      main/template/jquery_mobile/layout/welcome_to_course.tpl

+ 6 - 1
documentation/installation_guide.html

@@ -120,8 +120,13 @@ If you are using Apache, and due to new friendly URL features added in 1.10, you
     allow from all
   </Directory>
 </pre>
+<p>
 In particular, the "AllowOverride All" clause is the one that matters. This will allow PHP to send the user from one page to another freely, thus allowing for more user-friendly URLs.<br />
-Once you've made sure "AllowOverride" says "All", you can safely save the file, get out of it and reload the web server (<i>sudo service apache2 reload</i> under Debian/Ubuntu, or click right on the WAMP/XAMP/EasyPHP icon and "reload web server" under Windows).
+Once you've made sure "AllowOverride" says "All", you can safely save the file, get out of it and reload the web server (<i>sudo service apache2 reload</i> under Debian/Ubuntu, or click right on the WAMP/XAMP/EasyPHP icon and "reload web server" under Windows).</p>
+<p>
+Please note that, if you are using Chamilo in a subdirectory (for example, you load it in your browser as http://localhost/chamilo/ or http://yoursite.com/chamilo/, you will also need to alter the .htaccess file in the root directory of Chamilo, <b>before</b> you proceed with the installation.<br />
+On the RewriteBase line, where it normally says "/", change it to whatever subdirectory you are using. In the same case as above, your RewriteBase will have to say "chamilo/" (without the quotes).
+</p>
 <h3>Downloading and installing Chamilo</h3>
 <ol>
   <li><a href="http://www.chamilo.org/download">Download Chamilo LMS</a></li>

+ 2 - 2
main/admin/access_url_edit_courses_to_url.php

@@ -177,7 +177,7 @@ $url_list = UrlManager::get_url_data();
 		if (!empty($access_url_id)) {
 			if ($url_obj['id']==$access_url_id) {
 			$checked = 'selected=true';
-			$url_selected = $url_obj['id'];
+			$url_selected = $url_obj['url'];
 			}
 		}
 		if ($url_obj['active']==1) {
@@ -330,4 +330,4 @@ function makepost(select){
 }
 </script>
 <?php
-Display::display_footer();
+Display::display_footer();

+ 21 - 21
main/admin/access_url_edit_users_to_url.php

@@ -161,33 +161,33 @@ if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
 $nosessionUsersList = $sessionUsersList = array();
 $ajax_search = $add_type == 'unique' ? true : false;
 
-if($ajax_search) {
-	$Users=UrlManager::get_url_rel_user_data($access_url_id);
-	foreach($Users as $user) {
+if ($ajax_search) {
+	$Users = UrlManager::get_url_rel_user_data($access_url_id);
+	foreach ($Users as $user) {
 		$sessionUsersList[$user['user_id']] = $user ;
 	}
 } else {
-	$Users=UrlManager::get_url_rel_user_data();
-	foreach($Users as $user) {
-		if($user['access_url_id'] == $access_url_id) {
+	$Users = UrlManager::get_url_rel_user_data();
+	foreach ($Users as $user) {
+		if ($user['access_url_id'] == $access_url_id) {
 			$sessionUsersList[$user['user_id']] = $user ;
 		}
 	}
 	$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
-	$sql="SELECT u.user_id, lastname, firstname, username
-	  	  	FROM $tbl_user u WHERE status <> ".ANONYMOUS." ".
+	$sql = "SELECT u.user_id, lastname, firstname, username ".
+	  	  	" FROM $tbl_user u WHERE status <> ".ANONYMOUS." ".
 			$order_clause;
-	$result=Database::query($sql);
-	$Users=Database::store_result($result);
+	$result = Database::query($sql);
+	$Users = Database::store_result($result);
 	$user_list_leys = array_keys($sessionUsersList);
-	foreach($Users as $user) {
+	foreach ($Users as $user) {
 		if (!in_array($user['user_id'],$user_list_leys))
 			$nosessionUsersList[$user['user_id']] = $user ;
 	}
 }
 
 
-if($add_type == 'multiple') {
+if ($add_type == 'multiple') {
 	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
 	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
 } else {
@@ -208,14 +208,14 @@ $url_list = UrlManager::get_url_data();
 <select name="access_url_id" onchange="javascript:send();">
 <option value="0"> <?php echo get_lang('SelectUrl')?></option>
 	<?php
-	$url_selected='';
+	$url_selected = '';
 	foreach ($url_list as $url_obj) {
 
 		$checked = '';
 		if (!empty($access_url_id)) {
 			if ($url_obj['id'] == $access_url_id) {
 			    $checked = 'selected=true';
-			    $url_selected =	$url_obj['id'];
+			    $url_selected = $url_obj['url'];
 			}
 		}
 		if ($url_obj['active']==1) {
@@ -231,7 +231,7 @@ $url_list = UrlManager::get_url_data();
 <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
 
 <?php
-if(!empty($errorMsg)) {
+if (!empty($errorMsg)) {
 	Display::display_normal_message($errorMsg); //main API
 }
 ?>
@@ -258,7 +258,7 @@ if(!empty($errorMsg)) {
   <td align="center">
   <div id="content_source">
   	  <?php
-  	  if($ajax_search) {
+  	  if ($ajax_search) {
   	  	?>
 		<input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
 		<div id="ajax_list_users"></div>
@@ -267,7 +267,7 @@ if(!empty($errorMsg)) {
   	  ?>
 	  <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:380px;">
 		<?php
-		foreach($nosessionUsersList as $enreg) {
+		foreach ($nosessionUsersList as $enreg) {
 		?>
 			<option value="<?php echo $enreg['user_id']; ?>"><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
 			<?php
@@ -283,7 +283,7 @@ if(!empty($errorMsg)) {
   </td>
   <td width="10%" valign="middle" align="center">
   <?php
-  if($ajax_search) {
+  if ($ajax_search) {
 	?>
 	<button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination_users'))"> </button>
   	<?php
@@ -301,7 +301,7 @@ if(!empty($errorMsg)) {
   <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" style="width:380px;">
 
 <?php
-foreach($sessionUsersList as $enreg) {
+foreach ($sessionUsersList as $enreg) {
 ?>
 	<option value="<?php echo $enreg['user_id']; ?>"><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
 
@@ -317,7 +317,7 @@ unset($sessionUsersList);
 	<td colspan="3" align="center">
 		<br />
 		<?php
-		if(isset($_GET['add']))
+		if (isset($_GET['add']))
 			echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>';
 		else
 			echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>';
@@ -381,4 +381,4 @@ function makepost(select){
 }
 </script>
 <?php
-Display::display_footer();
+Display::display_footer();

+ 34 - 33
main/admin/access_urls.php

@@ -36,43 +36,44 @@ $url_list = UrlManager::get_url_data();
 if (isset ($_GET['action'])) {
     if ($_GET['action'] == 'show_message') {
         Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
-    }
-    $check = Security::check_token('get');
-    if ($check) {
-        $url_id=Database::escape_string($_GET['url_id']);
+    } else {
+        $check = Security::check_token('get');
+        if ($check) {
+            $url_id = Database::escape_string($_GET['url_id']);
 
-        switch ($_GET['action']) {
-            case 'delete_url' :
-                $result = UrlManager::delete($url_id);
-                if ($result) {
-                    Display :: display_normal_message(get_lang('URLDeleted'));
-                } else {
-                    Display :: display_error_message(get_lang('CannotDeleteURL'));
-                }
-                break;
-            case 'lock' :
-                UrlManager::set_url_status('lock',$url_id);
-                Display :: display_normal_message(get_lang('URLInactive'));
-                break;
-            case 'unlock';
-                UrlManager::set_url_status('unlock',$url_id);
-                Display :: display_normal_message(get_lang('URLActive'));
-                break;
-            case 'register';
-                // we are going to register the admin
-                if(api_is_platform_admin()) {
-                    if($current_access_url_id!=-1) {
-                        $url_str = '';
-                        foreach($url_list as $my_url) {
-                            if (!in_array($my_url['id'],$my_user_url_list)){
-                                UrlManager::add_user_to_url(api_get_user_id(),$my_url['id']);
-                                $url_str.=$my_url['url'].' <br />';
+            switch ($_GET['action']) {
+                case 'delete_url' :
+                    $result = UrlManager::delete($url_id);
+                    if ($result) {
+                        Display :: display_normal_message(get_lang('URLDeleted'));
+                    } else {
+                        Display :: display_error_message(get_lang('CannotDeleteURL'));
+                    }
+                    break;
+                case 'lock' :
+                    UrlManager::set_url_status('lock',$url_id);
+                    Display :: display_normal_message(get_lang('URLInactive'));
+                    break;
+                case 'unlock';
+                    UrlManager::set_url_status('unlock',$url_id);
+                    Display :: display_normal_message(get_lang('URLActive'));
+                    break;
+                case 'register';
+                    // we are going to register the admin
+                    if(api_is_platform_admin()) {
+                        if($current_access_url_id!=-1) {
+                            $url_str = '';
+                            foreach($url_list as $my_url) {
+                                if (!in_array($my_url['id'],$my_user_url_list)){
+                                    UrlManager::add_user_to_url(api_get_user_id(),$my_url['id']);
+                                    $url_str.=$my_url['url'].' <br />';
+                                }
                             }
+                            Display :: display_normal_message(get_lang('AdminUserRegisteredToThisURL').': '.$url_str.'<br />',false);
                         }
-                        Display :: display_normal_message(get_lang('AdminUserRegisteredToThisURL').': '.$url_str.'<br />',false);
                     }
-                }
-                break;
+                    break;
+            }
         }
     }
     Security::clear_token();

+ 6 - 5
main/admin/subscribe_user2course.php

@@ -70,10 +70,10 @@ if (is_array($extra_field_list)) {
 }
 
 /* React on POSTed request */
-if ($_POST['form_sent']) {
+if (!empty($_POST['form_sent'])) {
     $form_sent = $_POST['form_sent'];
-    $users = is_array($_POST['UserList']) ? $_POST['UserList'] : array() ;
-    $courses = is_array($_POST['CourseList']) ? $_POST['CourseList'] : array() ;
+    $users = (isset($_POST['UserList']) && is_array($_POST['UserList']) ? $_POST['UserList'] : array());
+    $courses = (isset($_POST['CourseList']) && is_array($_POST['CourseList']) ? $_POST['CourseList'] : array());
     $first_letter_user = $_POST['firstLetterUser'];
     $first_letter_course = $_POST['firstLetterCourse'];
 
@@ -125,6 +125,7 @@ if (is_array($extra_field_list)) {
     }
 }
 
+$where_filter ='';
 if ($use_extra_fields) {
     $final_result = array();
     if (count($extra_field_result)>1) {
@@ -137,7 +138,6 @@ if ($use_extra_fields) {
         $final_result = $extra_field_result[0];
     }
 
-    $where_filter ='';
     if ($_configuration['multiple_access_urls']) {
         if (is_array($final_result) && count($final_result)>0) {
             $where_filter = " AND u.user_id IN  ('".implode("','",$final_result)."') ";
@@ -198,7 +198,8 @@ $db_courses = Database::store_result($result);
 unset($result);
 
 if (api_is_multiple_url_enabled()) {
-    $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+    $tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+    $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
     $access_url_id = api_get_current_access_url_id();
     if ($access_url_id != -1){
         $sqlNbCours = "	SELECT course_rel_user.course_code, course.title

+ 2 - 2
main/inc/lib/access_url_edit_courses_to_url_functions.lib.php

@@ -25,7 +25,7 @@ class Accessurleditcoursestourl
      * @assert () === false
      */
 
-    function search_courses($needle, $id)
+    public static function search_courses($needle, $id)
     {
         global $tbl_course;
         $xajax_response = new XajaxResponse();
@@ -58,4 +58,4 @@ class Accessurleditcoursestourl
 
         return $xajax_response;
     }
-}
+}

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

@@ -29,7 +29,7 @@ class Accessurledituserstourl
      * @return string Xajax response block
      * @assert () === false
      */
-    function search_users($needle, $id)
+    public static function search_users($needle, $id)
     {
         global $tbl_user, $tbl_access_url_rel_user;
         $xajax_response = new XajaxResponse();

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

@@ -591,6 +591,7 @@ function api_get_path($path_type, $path = null) {
         if (isset($_configuration['access_url']) &&  $_configuration['access_url'] != 1) {
             //we look into the DB the function api_get_access_url
             $url_info = api_get_access_url($_configuration['access_url']);
+
             $root_web = $url_info['active'] == 1 ? $url_info['url'] : $_configuration['root_web'];
             $load_new_config = true;
         }
@@ -607,7 +608,7 @@ function api_get_path($path_type, $path = null) {
         // Developers might use the function api_get_path() directly or indirectly (this is difficult to be traced), at the moment when
         // configuration has not been created yet. This is why this function should be upgraded to return correct results in this case.
 
-        //if (defined('SYSTEM_INSTALLATION') && SYSTEM_INSTALLATION) {
+        //if (defined('SYSTEM_INSTALLATION') && SYSTEM_INSTALLATION) 
 
         if (empty($root_web)) {
 
@@ -718,6 +719,7 @@ function api_get_path($path_type, $path = null) {
                 WEB_ARCHIVE_PATH        => 'archive/',
                 WEB_LIBRARY_PATH        => 'inc/lib/',
                 WEB_AJAX_PATH           => 'inc/ajax/',
+                WEB_PUBLIC_PATH         => 'web/',
             );
 
             $root_web = api_add_trailing_slash($root_web);
@@ -736,6 +738,7 @@ function api_get_path($path_type, $path = null) {
             $paths[WEB_ARCHIVE_PATH]        = $paths[WEB_PATH].$web_paths[WEB_ARCHIVE_PATH];
             $paths[WEB_LIBRARY_PATH]        = $paths[WEB_CODE_PATH].$web_paths[WEB_LIBRARY_PATH];
             $paths[WEB_AJAX_PATH]           = $paths[WEB_CODE_PATH].$web_paths[WEB_AJAX_PATH];
+            $paths[WEB_PUBLIC_PATH]         = $paths[WEB_PATH].$web_paths[WEB_PUBLIC_PATH];
         }
     }
 
@@ -6306,8 +6309,8 @@ function api_set_settings_and_plugins()
     if ($access_url_id != 1) {
         $url_info = api_get_access_url($_configuration['access_url']);
         if ($url_info['active'] == 1) {
-            $settings_by_access = & api_get_settings(null, 'list', $_configuration['access_url'], 1);
-            foreach ($settings_by_access as & $row) {
+            $settings_by_access = api_get_settings(null, 'list', $_configuration['access_url'], 1);
+            foreach ($settings_by_access as $row) {
                 if (empty($row['variable'])) {
                     $row['variable'] = 0;
                 }

+ 2 - 2
main/template/default/layout/footer.tpl

@@ -1,4 +1,4 @@
-<footer> <!-- start of #footer section -->
+<footer{% block footer_open_attributes %}{% endblock footer_open_attributes %}> <!-- start of #footer section -->
     <div class="container">
         <div class="row">
             <div id="footer_left" class="span4">
@@ -184,4 +184,4 @@ $(document).ready( function() {
 });
 </script>
 {% endraw %}
-{{ execution_stats }}
+{{ execution_stats }}

+ 1 - 0
main/template/default/layout/head.tpl

@@ -14,6 +14,7 @@
 {{ css_style_print }}
 {{ js_file_to_string }}
 {{ extra_headers }}
+{% block header_end %}{% endblock header_end %}
 <script>
 // This is a patch for the "__flash__removeCallback" bug, see FS#4378.
 {% raw %}

+ 2 - 0
main/template/default/layout/main_header.tpl

@@ -42,11 +42,13 @@
         {# topbar #}
         {% include app.template_style ~ "/layout/topbar.tpl" %}
 
+        {% block main_div_container %}
         {% if app.full_width == 1 %}
             <div id="main" class="container-fluid">
         {% else %}
             <div id="main" class="container">
         {% endif %}
+        {% endblock main_div_container %}
             <header>
                 <div class="row">
                     <div id="header_left" class="span4">

+ 2 - 2
main/template/default/layout/show_header.tpl

@@ -12,5 +12,5 @@
         {% endif %}
         <div class="span12">
             {% include app.template_style ~ "/layout/page_body.tpl" %}
-            <section id="main_content">
-{% endif %}
+            {% block main_content_section_block %}<section id="main_content">{% endblock main_content_section_block %}
+{% endif %}

+ 2 - 19
main/template/jquery_mobile/layout/block_menu.tpl

@@ -1,19 +1,2 @@
-{% if block_menu is not empty %}
-<div id="{{ block_menu.id }}" class="well sidebar-nav">
-    {% block block_menu_item %}
-        {% if block_menu.title is not empty %}
-            <h4>{{ block_menu.title }}</h4>
-        {% endif %}
-
-        {% if block_menu.elements is not empty %}
-
-        <ul class="nav nav-list">
-            {% for item in block_menu.elements %}
-                <li><a href="{{ item.href }}"> {{ item.title }}</a></li>
-            {% endfor %}
-        </ul>
-        {% endif %}
-        {{ block_menu.content }}
-    {% endblock %}
-</div>
-{% endif %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/block_menu.tpl" %}

+ 2 - 60
main/template/jquery_mobile/layout/course_navigation.tpl

@@ -1,62 +1,4 @@
 {# Course navigation icons #}
-{% if show_header == true %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/course_navigation.tpl" %}
 
-    {% if show_course_shortcut is not null %}
-        <div class="span12">
-            {{ show_course_shortcut }}
-        </div>
-    {% endif %}
-
-    {% if show_course_navigation_menu is not null %}    
-        <script>                    
-            $(document).ready( function() {
-                if (readCookie('menu_state') == 0) {
-                    swap_menu();
-                }
-            });                    
-            function createCookie(name, value, days) {
-                if (days) {
-                    var date = new Date();
-                    date.setTime(date.getTime()+(days*24*60*60*1000));
-                    var expires = "; expires="+date.toGMTString();
-                }
-                else var expires = "";
-                document.cookie = name+"="+value+expires+"; path=/";
-            }
-            function readCookie(name) {
-                var nameEQ = name + "=";
-                var ca = document.cookie.split(';');
-                for (var i = 0; i < ca.length; i++)
-                {
-                    var c = ca[i];
-                    while (c.charAt(0)==' ') c = c.substring(1,c.length);
-                    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
-                }
-                return null;
-            }
-            function swap_menu() {
-                toolnavlist_el = document.getElementById('toolnav');
-                center_el = document.getElementById('center');
-                swap_menu_link_el = document.getElementById('swap_menu_link');
-
-                if (toolnavlist_el.style.display == 'none') {
-                    toolnavlist_el.style.display = '';
-                    if (center_el) {
-                        center_el.style.margin = '0 190px 0 0';
-                    }
-                    swap_menu_link_el.innerHTML = '{{'Hide'|get_lang}}';
-                    createCookie('menu_state',1,10);
-                } else {
-                    toolnavlist_el.style.display = 'none';
-                    if (center_el) {
-                        center_el.style.margin = '0 0 0 0';
-                    }
-                    swap_menu_link_el.innerHTML = '{{'Show'|get_lang}}';
-                    createCookie('menu_state',0,10);
-                }
-            }
-            document.write('<div class="span12 pull-right"> <a class="btn" href="javascript: void(0);" id="swap_menu_link" onclick="javascript: swap_menu();">{{'Hide'|get_lang}}<\/a></div>');                    
-            </script>                    
-    {{ show_course_navigation_menu }}
-    {% endif %}
-{% endif %}

+ 3 - 190
main/template/jquery_mobile/layout/footer.tpl

@@ -1,191 +1,4 @@
-<footer data-role="footer"> <!-- start of #footer section -->
-    <div class="container">
-        <div class="row">
-            <div id="footer_left" class="span4">
-                {% if session_teachers is not null %}
-                    <div id="session_teachers">
-                        {{ session_teachers }}
-                    </div>
-                {% endif %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/footer.tpl" %}
 
-                {% if teachers is not null %}
-                    <div id="teachers">
-                        {{ teachers }}
-                    </div>
-                {% endif %}
-
-                {#  Plugins for footer section #}
-                {% if plugin_footer_left is not null %}
-                    <div id="plugin_footer_left">
-                        {{ plugin_footer_left }}
-                    </div>
-                {% endif %}
-                 &nbsp;
-            </div>
-
-            <div id="footer_center" class="span4">
-                {#   Plugins for footer section  #}
-                {% if plugin_footer_center is not null %}
-                    <div id="plugin_footer_center">
-                        {{ plugin_footer_center }}
-                    </div>
-                {% endif %}
-                 &nbsp;
-            </div>
-
-            <div id="footer_right" class="span4">
-                {% if administrator_name is not null %}
-                    <div id="admin_name">
-                        {{ administrator_name }}
-                    </div>
-                {% endif %}
-
-                <div id="software_name">
-                    {{ "Platform"|get_lang }} <a href="{{_p.web}}" target="_blank">{{_s.software_name}} {{_s.system_version}}</a>
-                    &copy; {{ "now"|date("Y") }}
-                </div>
-                {#   Plugins for footer section  #}
-                {% if plugin_footer_right is not null %}
-                    <div id="plugin_footer_right">
-                        {{ plugin_footer_right }}
-                    </div>
-                {% endif %}
-                &nbsp;
-            </div><!-- end of #footer_right -->
-        </div><!-- end of #row -->
-    </div><!-- end of #container -->
-</footer>
-
-{{ footer_extra_content }}
-
-{% raw %}
-<script>
-jQuery.fn.filterByText = function(textbox) {
-    return this.each(function() {
-        var select = this;
-        var options = [];
-        $(select).find('option').each(function() {
-            options.push({value: $(this).val(), text: $(this).text()});
-        });
-        $(select).data('options', options);
-
-        $(textbox).bind('change keyup', function() {
-            var options = $(select).empty().data('options');
-            var search = $.trim($(this).val());
-            var regex = new RegExp(search,"gi");
-
-            $.each(options, function(i) {
-                var option = options[i];
-                if(option.text.match(regex) !== null) {
-                    $(select).append(
-                            $('<option>').text(option.text).val(option.value)
-                    );
-                }
-            });
-        });
-    });
-};
-
-//Functions used in main/admin
-
-var textarea = "";
-var max_char = 255;
-
-function maxCharForTextarea(obj) {
-    num_characters = obj.value.length;
-    if (num_characters > max_char){
-        obj.value = textarea;
-    } else {
-        textarea = obj.value;
-    }
-}
-
-function moveItem(origin , destination) {
-    for(var i = 0 ; i<origin.options.length ; i++) {
-        if(origin.options[i].selected) {
-            destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
-            origin.options[i]=null;
-            i = i-1;
-        }
-    }
-    destination.selectedIndex = -1;
-    sortOptions(destination.options);
-}
-
-function sortOptions(options) {
-    newOptions = new Array();
-    for (i = 0 ; i<options.length ; i++)
-        newOptions[i] = options[i];
-
-    newOptions = newOptions.sort(mysort);
-    options.length = 0;
-    for(i = 0 ; i < newOptions.length ; i++)
-        options[i] = newOptions[i];
-}
-
-function mysort(a, b){
-    if(a.text.toLowerCase() > b.text.toLowerCase()){
-        return 1;
-    }
-    if(a.text.toLowerCase() < b.text.toLowerCase()){
-        return -1;
-    }
-    return 0;
-}
-
-var value = 1;
-$("#advanced_parameters").on("click", function() {
-    $("#options").toggle(function() {
-        if (value == 1) {
-            $(".advanced_parameters").addClass("btn-hide");
-            value = 0;
-        } else {
-            $(".advanced_parameters").removeClass("btn-hide");
-            value = 1;
-        }
-    });
-});
-
-/** Makes row highlighting possible */
-$(document).ready( function() {
-    //Chosen select
-    $(".chzn-select").chosen();
-
-    //Advmultiselect text inputs
-    $('.select_class_filter').each(function(){
-        var inputId = $(this).attr('id');
-
-        inputId = inputId.replace('f-', '');
-        inputId = inputId.replace('-filter', '');
-
-        $("#"+ inputId+"-f").filterByText($("#f-"+inputId+"-filter"));
-        $("#"+ inputId+"-t").filterByText($("#t-"+inputId+"-filter"));
-    });
-
-    //Table highlight
-    $("form .data_table input:checkbox").click(function() {
-        if ($(this).is(":checked")) {
-            $(this).parentsUntil("tr").parent().addClass("row_selected");
-
-        } else {
-            $(this).parentsUntil("tr").parent().removeClass("row_selected");
-        }
-    });
-
-    /* For non HTML5 browsers */
-    if ($("#formLogin".length > 1)) {
-        $("input[name=login]").focus();
-    }
-
-    /* For IOS users */
-    $('.autocapitalize_off').attr('autocapitalize', 'off');
-
-    //Tool tip (in exercises)
-    var tip_options = {
-        placement : 'right'
-    }
-    $('.boot-tooltip').tooltip(tip_options);
-});
-</script>
-{% endraw %}
-{{ execution_stats }}
+{% block footer_open_attributes %}data-role="footer"{% endblock footer_open_attributes %}

+ 5 - 305
main/template/jquery_mobile/layout/head.tpl

@@ -1,308 +1,8 @@
-<meta charset="{{ system_charset }}" />
-<link href="http://www.chamilo.org/documentation.php" rel="help" />
-<link href="http://www.chamilo.org/team.php" rel="author" />
-<link href="http://www.chamilo.org" rel="copyright" />
-{{ prefetch }}
-{{ favico }}
-<link rel="apple-touch-icon" href="{{ _p.web }}apple-touch-icon.png" />
-<meta name="apple-mobile-web-app-capable" content="yes" />
-<meta name="Generator" content="{{ _s.software_name }} {{ _s.system_version|slice(0,1) }}" />
-{#  Use the latest engine in ie8/ie9 or use google chrome engine if available  #}
-{#  Improve usability in portal devices #}
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<title>{{ title_string }}</title>
-{{ css_file_to_string }}
-{{ css_style_print }}
-{{ js_file_to_string }}
-{{ extra_headers }}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/head.tpl" %}
+
+{% block header_end %}
 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
 <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
-<script>
-//<![CDATA[
-// This is a patch for the "__flash__removeCallback" bug, see FS#4378.
-{% raw %}
-if ((navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf('opera') == -1 )) {
-    window.attachEvent( 'onunload', function() {
-            window['__flash__removeCallback'] = function ( instance, name ) {
-                try {
-                    if ( instance ) {
-                        instance[name] = null ;
-                    }
-                } catch ( flashEx ) {
-                }
-            } ;
-    });
-}
-{% endraw %}
-//]]>
-
-
-
-function setCheckbox(value, table_id) {
-    checkboxes = $("#"+table_id+" input:checkbox");
-    $.each(checkboxes, function(index, checkbox) {
-         checkbox.checked = value;
-        if (value) {
-            $(checkbox).parentsUntil("tr").parent().addClass("row_selected");
-        } else {
-            $(checkbox).parentsUntil("tr").parent().removeClass("row_selected");
-        }
-    });
-    return false;
-}
-
-function action_click(element, table_id) {
-    d = $("#"+table_id);
-    if (!confirm('{{ "ConfirmYourChoice"|get_lang }}')) {
-        return false;
-    } else {
-        var action =$(element).attr("data-action");
-        $('#'+table_id+' input[name="action"] ').attr("value", action);
-        d.submit();
-        return false;
-    }
-}
-
-/* Global chat variables */
-
-var ajax_url        = '{{ _p.web_ajax }}chat.ajax.php';
-var online_button   = '{{ online_button |e('js') }}';
-var offline_button  = '{{ offline_button |e('js') }}';
-var connect_lang    = '{{ "ChatConnected"|get_lang |e('js') }}';
-var disconnect_lang = '{{ "ChatDisconnected"|get_lang |e('js') }}';
-
-function get_url_params(q, attribute) {
-    var vars;
-    var hash;
-    if (q != undefined) {
-        q = q.split('&');
-        for(var i = 0; i < q.length; i++){
-            hash = q[i].split('=');
-            if (hash[0] == attribute) {
-                return hash[1];
-            }
-        }
-    }
-}
-
-function check_brand() {
-    if ($('.subnav').length) {
-        if ($(window).width() >= 969) {
-            $('.subnav .brand').hide();
-        } else {
-            $('.subnav .brand').show();
-        }
-    }
-}
-
-$(window).resize(function() {
-    check_brand();
-});
-
-$(document).scroll(function() {
-
-    // Top bar scroll effect
-    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');
-            }
-            //$('.subnav .brand').show();
-        }
-    } else {
-        //$('.subnav .brand').hide();
-    }
-
-    //Exercise warning fixed at the top
-    var fixed =  $("#exercise_clock_warning");
-    if (fixed.length) {
-        if (!fixed.attr('data-top')) {
-            // If already fixed, then do nothing
-            if (fixed.hasClass('subnav-fixed')) return;
-            // Remember top position
-            var offset = fixed.offset();
-            fixed.attr('data-top', offset.top);
-            fixed.css('width', '100%');
-        }
-
-        if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) {
-            fixed.addClass('subnav-fixed');
-            fixed.css('width', '100%');
-        } else {
-            fixed.removeClass('subnav-fixed');
-            fixed.css('width', '200px');
-        }
-    }
-
-    //Admin -> Settings toolbar
-    if ($('body').width() > 959) {
-        if ($('.new_actions').length) {
-            if (!$('.new_actions').attr('data-top')) {
-                // If already fixed, then do nothing
-                if ($('.new_actions').hasClass('new_actions-fixed')) return;
-                // Remember top position
-                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 ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) {
-                $('.new_actions').addClass('new_actions-fixed');
-            } else {
-                $('.new_actions').removeClass('new_actions-fixed');
-            }
-        }
-    }
-
-    //Bottom actions
-    if ($('.bottom_actions').length) {
-        if (!$('.bottom_actions').attr('data-top')) {
-            // If already fixed, then do nothing
-            if ($('.bottom_actions').hasClass('bottom_actions_fixed')) return;
-
-            // Remember top position
-            var offset = $('.bottom_actions').offset();
-            $('.bottom_actions').attr('data-top', offset.top);
-        }
-
-        if ($('.bottom_actions').attr('data-top') > $('body').outerHeight()) {
-            if ( ($('.bottom_actions').attr('data-top') - $('body').outerHeight() - $('.bottom_actions').outerHeight()) >= $(this).scrollTop()) {
-                $('.bottom_actions').addClass('bottom_actions_fixed');
-                $('.bottom_actions').css("width", "100%");
-            } else {
-                $('.bottom_actions').css("width", "");
-                $('.bottom_actions').removeClass('bottom_actions_fixed');
-            }
-        } else {
-            if ( ($('.bottom_actions').attr('data-top') -  $('.bottom_actions').outerHeight()) <= $(this).scrollTop()) {
-                $('.bottom_actions').addClass('bottom_actions_fixed');
-                $('.bottom_actions').css("width", "100%");
-            } else {
-                $('.bottom_actions').removeClass('bottom_actions_fixed');
-                $('.bottom_actions').css("width", "");
-            }
-        }
-    }
-});
-
-$(function() {
-
-    check_brand();
-
-    //Removes the yellow input in Chrome
-    if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
-        $(window).load(function(){
-            $('input:-webkit-autofill').each(function(){
-                var text = $(this).val();
-                var name = $(this).attr('name');
-                $(this).after(this.outerHTML).remove();
-                $('input[name=' + name + ']').val(text);
-            });
-        });
-    }
-
-    //Fixes buttons to the new btn class
-    if (!$('#button').hasClass('btn')) {
-        $("button").addClass('btn');
-    }
-
-    //Dropdown effect
-    $('.dropdown-toggle').dropdown();
-
-    //Responsive effect
-    $(".collapse").collapse();
-
-    $(".accordion_jquery").accordion({
-        autoHeight: false,
-        active: false, // all items closed by default
-        collapsible: true,
-        header: ".accordion-heading"
-    });
-
-    //Global popup
-    $('.ajax').on('click', function() {
-        var url     = this.href;
-        var dialog  = $("#dialog");
-        if ($("#dialog").length == 0) {
-            dialog  = $('<div id="dialog" style="display:none"></div>').appendTo('body');
-        }
-
-        width_value = 580;
-        height_value = 450;
-        resizable_value = true;
-
-        new_param = get_url_params(url, 'width');
-        if (new_param) {
-            width_value = new_param;
-        }
-
-        new_param = get_url_params(url, 'height')
-        if (new_param) {
-            height_value = new_param;
-        }
-
-        new_param = get_url_params(url, 'resizable');
-        if (new_param) {
-            resizable_value = new_param;
-        }
-
-        // load remote content
-        dialog.load(
-                        url,
-                        {},
-                        function(responseText, textStatus, XMLHttpRequest) {
-                                dialog.dialog({
-                                        modal       : true,
-                                        width       : width_value,
-                                        height      : height_value,
-                                        resizable   : resizable_value
-                                });
-        });
-        //prevent the browser to follow the link
-        return false;
-    });
-
-    //old jquery.menu.js
-    $('#navigation a').stop().animate({
-        'marginLeft':'50px'
-    },1000);
-
-    $('#navigation > li').hover(
-        function () {
-            $('a',$(this)).stop().animate({
-                'marginLeft':'1px'
-            },200);
-        },
-        function () {
-            $('a',$(this)).stop().animate({
-                'marginLeft':'50px'
-            },200);
-        }
-    );
-    /*
-    $(".td_actions").hide();
-
-    $(".td_actions").parent('tr').mouseover(function() {
-       $(".td_actions").show();
-    });
+{% endblock header_end %}
 
-    $(".td_actions").parent('tr').mouseout(function() {
-        $(".td_actions").hide();
-    });*/
-});
-</script>
-{{ header_extra_content }}

+ 3 - 27
main/template/jquery_mobile/layout/hot_course_item.tpl

@@ -1,27 +1,3 @@
-{% for hot_course in hot_courses %}               
-    {% if hot_course.extra_info.title %}        
-        <div class="span9 hot-course-box">
-            <div class="well_border">
-                <div class="row">
-                    <div class="span2">
-                        <div class="thumbnail">
-                            <img src="{{ hot_course.extra_info.course_image }}" alt="" /> 
-                        </div>
-                    </div>
-                    <div class="span6">
-                        <div class="categories-course-description">
-                            <h3>{{ hot_course.extra_info.title}}</h3>
-                            <h5>{{ hot_course.extra_info.teachers }}</h5>
-                            {{ hot_course.extra_info.rating_html }}
-                        </div>
-                        <p>                                                            
-                            {{ hot_course.extra_info.description_button }}
-                            {{ hot_course.extra_info.go_to_course_button }}
-                            {{ hot_course.extra_info.register_button }}
-                        </p>
-                    </div>
-                </div>
-            </div>
-        </div>
-    {% endif %}
-{% endfor %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/hot_course_item.tpl" %}
+

+ 3 - 27
main/template/jquery_mobile/layout/hot_course_item_popup.tpl

@@ -1,27 +1,3 @@
-{% for hot_course in hot_courses %}               
-    {% if hot_course.extra_info.title %}        
-        <div class="span5">
-            <div class="well_border">
-                <div class="row">
-                    <div class="span2">
-                        <div class="thumbnail">
-                            <img src="{{ hot_course.extra_info.course_image }}" />                                    
-                        </div>
-                    </div>
-                    <div class="span2">
-                        <div class="categories-course-description">
-                            <h3>{{ hot_course.extra_info.title}}</h3>
-                            <h5>{{ hot_course.extra_info.teachers }}</h5>
-                            {# hot_course.extra_info.rating_html #}
-                        </div>
-                        <p>
-                            {{ hot_course.extra_info.description_button }}
-                            {{ hot_course.extra_info.go_to_course_button }}
-                            {{ hot_course.extra_info.register_button }}
-                        </p>
-                    </div>
-                </div>
-            </div>
-        </div>
-    {% endif %}
-{% endfor %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/hot_course_item_popup.tpl" %}
+

+ 2 - 41
main/template/jquery_mobile/layout/hot_courses.tpl

@@ -1,41 +1,2 @@
-{% if hot_courses is not null and hot_courses is not empty %}
-
-<script>
-$(document).ready( function() {
-    $('.star-rating li a').live('click', function(event) {
-        var id = $(this).parents('ul').attr('id');
-        $('#vote_label2_' + id).html("{{'Loading'|get_lang}}");
-        $.ajax({
-            url: $(this).attr('data-link'),
-            success: function(data) {
-                $("#rating_wrapper_"+id).html(data);
-                if (data == 'added') {
-                    //$('#vote_label2_' + id).html("{{'Saved'|get_lang}}");
-                }
-                if (data == 'updated') {
-                    //$('#vote_label2_' + id).html("{{'Saved'|get_lang}}");
-                }
-            }
-        });
-    });
-
-});
-</script>
-
-    <section id="hot_courses">
-        <div class="row">
-            <div class="span9">
-                {% if _u.is_admin %}
-                <span class="pull-right">
-                    <a title="{{ "Hide"|get_lang }}" alt="{{ "Hide"|get_lang }}" href="{{ _p.web_main }}admin/settings.php?search_field=show_hot_courses&submit_button=&_qf__search_settings=&category=search_setting">
-                        <img src="{{ "visible.png"|icon(32) }}">
-                    </a>
-                </span>
-                {% endif %}
-                {{ "HottestCourses"|display_page_subheader }}
-            </div>            
-                
-            {% include 'jquery_mobile/layout/hot_course_item.tpl' %}
-        </div>
-    </section>
-{% endif %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/hot_courses.tpl" %}

+ 2 - 21
main/template/jquery_mobile/layout/login_form.tpl

@@ -1,22 +1,3 @@
-<div id="login_block" class="well sidebar-nav">
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/login_form.tpl" %}
 
-	{{ login_language_form }}
-
-    {% if plugin_login_top is not null %}
-        <div id="plugin_login_top">
-            {{ plugin_login_top }}
-        </div>
-    {% endif %}
-
-	{{login_form}}
-
-	{{login_failed}}
-
-	{{login_options}}
-
-    {% if plugin_login_bottom is not null %}
-        <div id="plugin_login_bottom">
-            {{ plugin_login_bottom }}
-        </div>
-    {% endif %}
-</div>

+ 2 - 20
main/template/jquery_mobile/layout/main.tpl

@@ -1,21 +1,3 @@
-{% block header %}
-{% include "jquery_mobile/layout/main_header.tpl" %}
-{% endblock %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/main.tpl" %}
 
-{% block body %}
-	{% if show_sniff == 1 %}
-	 	{% include "jquery_mobile/layout/sniff.tpl" %}
-	{% endif %}
-{% endblock %}
-
-{% block footer %}
-    {#  Footer  #}
-    {% if show_footer == true %}
-        </div> <!-- end of #row" -->
-        </div> <!-- end of #main" -->
-        <div class="push"></div>
-        </div> <!-- end of #wrapper section -->
-    {% endif %}
-{% include "jquery_mobile/layout/main_footer.tpl" %}
-{{ xhprof }}
-{% endblock %}

+ 10 - 82
main/template/jquery_mobile/layout/main_header.tpl

@@ -1,83 +1,11 @@
-<!DOCTYPE html>
-<!--[if lt IE 7]> <html lang="{{ document_language }}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
-<!--[if IE 7]>    <html lang="{{ document_language }}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
-<!--[if IE 8]>    <html lang="{{ document_language }}" class="no-js lt-ie9"> <![endif]-->
-<!--[if gt IE 8]><!--><html lang="{{ document_language }}" class="no-js"> <!--<![endif]-->
-<head>
-{% include "jquery_mobile/layout/head.tpl" %}
-</head>
-<body dir="{{ text_direction }}" class="{{ section_name }}">
-<noscript>{{ "NoJavascript"|get_lang }}</noscript>
-
-{% if show_header == true %}
-    <div class="skip">
-        <ul>
-            <li><a href="#menu">{{ "WCAGGoMenu"|get_lang }}</a></li>
-            <li><a href="#content" accesskey="2">{{ "WCAGGoContent"|get_lang }}</a></li>
-        </ul>
-    </div>
-    <div id="wrapper">
-
-        {# Bug and help notifications are disabled in mobile template #}
-
-        {# topbar is disabled in mobile template #}
-
-        <div id="main" class="container" data-role="page">
-            <header data-role="header">
-                <div class="row">
-                    <div id="header_left" class="span4">
-                        {# logo #}
-                        {{ logo }}
-
-                        {# plugin_header left #}
-                        {% if plugin_header_left is not null %}
-                            <div id="plugin_header_left">
-                                {{ plugin_header_left }}
-                            </div>
-                        {% endif %}
-                    </div>
-                    <div id="header_center" class="span3">
-                        {# plugin_header center #}
-                        {% if plugin_header_center is not null %}
-                            <div id="plugin_header_center">
-                                {{ plugin_header_center }}
-                            </div>
-                        {% endif %}
-                        &nbsp;
-                    </div>
-                    <div id="header_right" class="span5">
-                        <ul id="notifications" class="nav nav-pills pull-right">
-                            {{ notification_menu }}
-                        </ul>
-
-                        {# plugin_header right #}
-                        {% if plugin_header_right is not null %}
-                            <div id="plugin_header_right">
-                                {{ plugin_header_right }}
-                            </div>
-                        {% endif %}
-                        &nbsp;
-                    </div>
-                </div>
-
-                {% if plugin_header_main %}
-                    <div class="row">
-                        <div class="span12">
-                            <div id="plugin_header_main">
-                                {{ plugin_header_main }}
-                            </div>
-                        </div>
-                    </div>
-                {% endif %}
-
-                {# menu #}
-                {% include "jquery_mobile/layout/menu.tpl" %}
-
-                {# breadcrumb #}
-                {{ breadcrumb }}
-            </header>
-
-            <div id="top_main_content" class="row">
-            {# course navigation links/shortcuts need to be activated by the admin #}
-            {% include "jquery_mobile/layout/course_navigation.tpl" %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/main_header.tpl" %}
+
+{% block main_div_container %}
+{% if app.full_width == 1 %}
+    <div id="main" class="container-fluid" data-role="page">
+{% else %}
+    <div id="main" class="container" data-role="page">
 {% endif %}
+{% endblock main_div_container %}
+

+ 2 - 49
main/template/jquery_mobile/layout/menu.tpl

@@ -1,50 +1,3 @@
-{% if menu is not null %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/menu.tpl" %}
 
-<div class="navbar subnav">
-    <div class="navbar-inner">
-        <div class="container">
-            <a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar">
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </a>
-            <a class="brand" href="{{ _p.web }}">{{ portal_name }}</a>
-            <div class="nav-collapse">
-                <ul class="nav">
-                    {{ menu }}
-                </ul>
-
-                {% if _u.logged == 1 %}
-                <ul class="nav pull-right">
-
-                    {% if user_notifications is not null %}
-                    <li>
-                        <a href="{{ profile_url }}">{{ user_notifications }}</a>
-                    </li>
-                    {% endif %}
-
-                    <li class="dropdown">
-                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
-                            {{ _u.messages_count }}  <img src="{{ _u.avatar_small }}"/>
-                            {{ _u.complete_name }}
-                            <b class="caret"></b>
-                        </a>
-                        <ul class="dropdown-menu">
-                            <li>
-                                {{ profile_link }}
-                                {{ message_link }}
-                            </li>
-                        </ul>
-
-                    <li>
-                        <a id="logout_button" class="logout" title="{{ "Logout"|get_lang }}" href="{{ logout_link }}" >
-                            <img src="{{ "exit.png"|icon(22) }}">
-                        </a>
-                    </li>
-                </ul>
-                {% endif %}
-            </div>
-        </div>
-    </div>
-</div>
-{% endif %}

+ 3 - 16
main/template/jquery_mobile/layout/no_layout.tpl

@@ -1,16 +1,3 @@
-<!DOCTYPE html>
-<!--[if lt IE 7]> <html lang="{{document_language}}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
-<!--[if IE 7]>    <html lang="{{document_language}}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
-<!--[if IE 8]>    <html lang="{{document_language}}" class="no-js lt-ie9"> <![endif]-->
-<!--[if gt IE 8]><!--><html lang="{{document_language}}" class="no-js"> <!--<![endif]-->
-<head>
-{% include "jquery_mobile/layout/head.tpl" %}
-</head>
-<body dir="{{text_direction}}" class="{{section_name}}">
-{% block name %}
-{% endblock %}
-{% block body %}
-    {{ content }}
-{% endblock %}
-</body>
-</html>
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/no_layout.tpl" %}
+

+ 2 - 30
main/template/jquery_mobile/layout/page_body.tpl

@@ -1,31 +1,3 @@
-{#  Actions  #}
-{% if actions != '' %}
-    <div class="actions">
-        {{ actions }}
-    </div>
-{% endif %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/page_body.tpl" %}
 
-{% if actions_menu != '' %}
-    {{ knp_menu_render('actions_menu', { 'currentClass': 'active'}) }}
-{% endif %}
-
-{#  Page header #}
-{% if header != '' %}
-    <div class="page-header">
-        <h1>{{ header }}</h1>
-    </div>
-{% endif %}
-
-{#  Show messages #}
-{% if message != '' %}
-    <section id="messages">
-        {{ message}}
-    </section>
-{% endif %}
-
-{#  Welcome to course block  #}
-{% if welcome_to_course_block %}
-    <section id="welcome_to_course">
-        {% include "jquery_mobile/layout/welcome_to_course.tpl" %}
-    </section>
-{% endif %}

+ 2 - 19
main/template/jquery_mobile/layout/show_footer.tpl

@@ -2,23 +2,6 @@
     show_header and show_footer templates are only called when using the Display::display_header and Display::display_footer
     for backward compatibility we suppose that the default layout is one column which means using a div with class span12
  #}
-{% if show_header == true %}
-    </section>
-</div>
-{% endif %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/show_footer.tpl" %}
 
-{# Plugin bottom  #}   
-{% if plugin_content_bottom is not null %}
-    <div id="plugin_content_bottom" class="span12">
-        {{ plugin_content_bottom}}
-    </div>
-{% endif %}
-
-{% if show_footer == true %}
-        </div> <!-- end of #row" -->
-    </div> <!-- end of #main" -->
-    <div class="push"></div>
-</div> <!-- end of #wrapper section -->
-{% endif %}
-
-{% include "jquery_mobile/layout/main_footer.tpl" %}

+ 3 - 11
main/template/jquery_mobile/layout/show_header.tpl

@@ -1,16 +1,8 @@
-{% include "jquery_mobile/layout/main_header.tpl" %}
 {#
     show_header and show_footer templates are only called when using the Display::display_header and Display::display_footer
     for backward compatibility we suppose that the default layout is one column which means using a div with class span12
 #}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/show_header.tpl" %}
 
-{% if show_header == true %}
-        {% if plugin_content_top is not null %}
-            <div id="plugin_content_top" class="span12">
-                {{ plugin_content_top }}
-            </div>
-        {% endif %}
-        <div class="span12">
-            {% include "jquery_mobile/layout/page_body.tpl" %}
-            <section id="main_content" data-role="content">
-{% endif %}
+{% block main_content_section_block %}<section id="main_content" data-role="content">{% endblock main_content_section_block %}

+ 2 - 133
main/template/jquery_mobile/layout/sniff.tpl

@@ -1,134 +1,3 @@
-{% raw %}
-<script LANGUAGE="JavaScript">
-var nav ="";
-var screen_size_w;
-var screen_size_h;
-var java="";
-var type_mimetypes="";
-var suffixes_mimetypes="";
-var list_plugins="";
-var check_some_activex="";
-var check_some_plugins="";
-var java_sun_ver="";
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/sniff.tpl" %}
 
-<!-- check Microsoft Internet Explorer -->
-if (navigator.userAgent.indexOf("MSIE") != -1) { var nav="ie";}
-
-<!-- check Screen Size -->
-screen_size_w=screen.width;
-screen_size_h=screen.height;
-
-<!-- list mimetypes types, suffixes and plugins (no for IE) -->
-if (nav!="ie"){
-        
-        if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
-        
-                for (i=0; i < navigator.mimeTypes.length; i++) {
-                        type_mimetypes=type_mimetypes+" "+navigator.mimeTypes[i].type;
-                        suffixes_mimetypes=suffixes_mimetypes+" "+navigator.mimeTypes[i].suffixes;
-                        if (navigator.mimeTypes[i].enabledPlugin!=null) {
-                                list_plugins=list_plugins+" "+navigator.mimeTypes[i].enabledPlugin.name;
-                        }               
-                }
-        }
-}
-<!-- check some activex for IE -->
-if (nav=="ie"){
-        //TODO:check wmediaplayer are too aggressive. Then we can assume that if there Windows, there Wmediaplayer?
-        
-        var check_some_activex = 
-        DetectActiveXObject("ShockwaveFlash.ShockwaveFlash.1", "flash_yes")+
-        DetectActiveXObject("QuickTime.QTElementBehavior", "quicktime_yes")+
-        //DetectActiveXObject("MediaPlayer.MediaPlayer.1","wmediaplayer_yes")+
-        DetectActiveXObject("acroPDF.PDF.1","acrobatreader_yes");
-        
-        function DetectActiveXObject(ObjectName, name) { 
-                result = false;
-                        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
-                        document.write('on error resume next \n');
-                        document.write('result = IsObject(CreateObject("' + ObjectName + '")) \n');
-                        document.write('</SCRIPT\> \n');
-                if (result) return name+' , '; else return '';
-        }
-}
-<!-- check some plugins for not IE -->
-if (nav!="ie"){
-
-        if (list_plugins.indexOf("Shockwave Flash")!=-1){
-                check_some_plugins=check_some_plugins+', flash_yes';
-        }
-        if (list_plugins.indexOf("QuickTime")!=-1){
-                check_some_plugins=check_some_plugins+', quicktime_yes';
-        }
-        if (list_plugins.indexOf("Windows Media Player")!=-1){
-                check_some_plugins=check_some_plugins+', wmediaplayer_yes';
-        }
-        if (list_plugins.indexOf("Adobe Acrobat")!=-1){
-                check_some_plugins=check_some_plugins+',acrobatreader_yes';
-        }
-}
-<!-- java -->
-if(navigator.javaEnabled()==true){java="java_yes";}else{java="java_no";}
-
-<!-- check java Sun ver -->
-//for not IE
-if (nav!="ie"){
-        if (navigator.mimeTypes["application/x-java-applet"]){ java_sun_ver="javasun_yes";}
-        if (navigator.mimeTypes["application/x-java-applet;jpi-version=1.6.0_24"]){ java_sun_ver=java_sun_ver+" , javasun_ver_1.6_24_yes"; }//This java version 1.6.0_24 is problematic, the user should be updated
-
-}
-//for IE
-if (nav=="ie"){
-        //1.5->end nov 2009
-        //TODO:extract minor version
-        var java_sun_ver =
-        DetectActiveXObject("JavaWebStart.isInstalled","javasun_yes")+
-        DetectActiveXObject("JavaWebStart.isInstalled.1.4.2.0","javasun_ver_1.4_yes")+
-        DetectActiveXObject("JavaWebStart.isInstalled.1.5.0.0","javasun_ver_1.5_yes")+
-        DetectActiveXObject("JavaWebStart.isInstalled.1.6.0.0","javasun_ver_1.6_yes")+
-        DetectActiveXObject("JavaWebStart.isInstalled.1.7.0.0","javasun_ver_1.7_yes");
-        
-        function DetectActiveXObject(ObjectName, name) { 
-                result = false;
-                        document.write('<SCRIPT LANGUAGE=VBScript\> \n');
-                        document.write('on error resume next \n');
-                        document.write('result = IsObject(CreateObject("' + ObjectName + '")) \n');
-                        document.write('</SCRIPT\> \n');
-                if (result) return name+' , '; else return '';
-        }
-}
-
-<!-- Send to server -->
-function sendSniff(){
-        document.forms.sniff_nav_form.sniff_navigator.value="checked";
-        document.forms.sniff_nav_form.sniff_navigator_screen_size_w.value=screen_size_w;
-        document.forms.sniff_nav_form.sniff_navigator_screen_size_h.value=screen_size_h;
-        document.forms.sniff_nav_form.sniff_navigator_type_mimetypes.value=type_mimetypes;
-        document.forms.sniff_nav_form.sniff_navigator_suffixes_mimetypes.value=suffixes_mimetypes;
-        document.forms.sniff_nav_form.sniff_navigator_list_plugins.value=list_plugins;
-        document.forms.sniff_nav_form.sniff_navigator_check_some_activex.value=check_some_activex;
-        document.forms.sniff_nav_form.sniff_navigator_check_some_plugins.value=check_some_plugins;
-        document.forms.sniff_nav_form.sniff_navigator_java.value=java;
-        document.forms.sniff_nav_form.sniff_navigator_java_sun_ver.value=java_sun_ver;
-        document.sniff_nav_form.submit(); 
-}
-</script>
-{% endraw %}
-
-<form name="sniff_nav_form" method="POST">
-<input type="hidden" name="sniff_navigator">
-<input type="hidden" name="sniff_navigator_screen_size_w">
-<input type="hidden" name="sniff_navigator_screen_size_h">
-<input type="hidden" name="sniff_navigator_type_mimetypes">
-<input type="hidden" name="sniff_navigator_suffixes_mimetypes">
-<input type="hidden" name="sniff_navigator_list_plugins">
-<input type="hidden" name="sniff_navigator_check_some_activex">
-<input type="hidden" name="sniff_navigator_check_some_plugins">
-<input type="hidden" name="sniff_navigator_java">
-<input type="hidden" name="sniff_navigator_java_sun_ver">
-</form>
-{#
-	<script>
-    	sendSniff();
-	</script>
-#}

+ 2 - 16
main/template/jquery_mobile/layout/social_layout.tpl

@@ -1,17 +1,3 @@
-{% extends "jquery_mobile/layout/layout_1_col.tpl" %}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/social_layout.tpl" %}
 
-{% block content %}
-    <div class="row">
-        <div class="span3">
-            {{ social_left_content }}
-            {{ social_left_menu }}
-        </div>
-        <div class="span9">
-            <div class="row">
-                <span id="message_ajax_reponse" class="span9"></span>
-                {{ social_right_content }}
-                <div id="display_response_id" class="span9"></div>
-            </div>
-        </div>
-    </div>
-{% endblock %}

+ 3 - 87
main/template/jquery_mobile/layout/topbar.tpl

@@ -1,88 +1,4 @@
-<!-- Topbar -->
-{% if show_toolbar == 1 %}
-    <div id="topbar" class="navbar navbar-fixed-top">
-        <div class="navbar-inner">
-            <div class="container">
-                <a class="brand" href="{{ _p.web }}">
-                    {{ "siteName" | get_setting }}
-                </a>
+{# Load the template basis from the default template #}
+{# No topbar in mobile app #}
+{# extends app.template_style ~ "/../default/layout/topbar.tpl" #}
 
-                {% if _u.logged %}
-                    <div class="nav-collapse">
-                        <ul class="nav">
-                            <li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li>
-                            {#
-                            <li class="dropdown">
-                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Teaching'|get_lang }}<b class="caret"></b></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ _p.web_main }}create_course/add_course.php">{{ "AddCourse"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}auth/courses.php">{{ "Catalog"|get_lang }}</a></li>
-                                </ul>
-                            </li>
-                            #}
-                            <li class="dropdown">
-                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Tracking'|get_lang }}<b class="caret"></b></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ _p.web_main }}mySpace/">{{ "CoursesReporting"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}mySpace/index.php?view=admin">{{ "AdminReports"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}tracking/exams.php">{{ "ExamsReporting"|get_lang }}</a></li>
-                                    <li class="divider"></li>
-                                    <li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li>
-                                </ul>
-                            </li>
-                            {% if _u.is_admin == 1 %}
-                            <li class="dropdown">
-                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ _p.web_main }}admin/">{{ "Home"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}admin/user_list.php">{{ "UserList"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}admin/course_list.php">{{ "CourseList"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}session/session_list.php">{{ "SessionList"|get_lang }}</a></li>
-                                    <li class="divider"></li>
-                                    <li><a href="{{ _p.web_main }}admin/settings.php">{{ "Settings"|get_lang }}</a></li>
-                                    <li class="divider"></li>
-                                    <li><a href="{{ _p.web_main }}admin/settings.php?category=Plugins">{{ "Plugins"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}admin/settings.php?category=Regions">{{ "Regions"|get_lang }}</a></li>
-                                </ul>
-                            </li>
-
-                            <li class="dropdown">
-                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ 'Add'|get_lang }}<b class="caret"></b></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ _p.web_main }}admin/user_add.php">{{ "User"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}admin/course_add.php">{{ "Course"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}session/session_add.php">{{ "Session"|get_lang }}</a></li>
-                                </ul>
-                            </li>
-                            {% endif %}
-                        </ul>
-
-
-                        {% if _u.is_admin == 1 %}
-                        <form class="navbar-search pull-left" action="{{ _p.web_main }}admin/user_list.php" method="get">
-                            <input type="text" class="search-query span2" placeholder="{{'SearchUsers'|get_lang }}" name="keyword">
-                        </form>
-                        {% endif %}
-
-                        <ul class="nav pull-right">
-                            <li><a href="{{ _p.web_main }}social/home.php"><img src="{{ _u.avatar_small }}"/></a></li>
-                            <li class="dropdown">
-                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _u.complete_name }}<b class="caret"></b></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ _p.web_main }}social/home.php">{{ "Profile"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}calendar/agenda_js.php?type=personal">{{ "MyAgenda"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}messages/inbox.php">{{ "Inbox"|get_lang }}</a></li>
-                                    <li><a href="{{ _p.web_main }}auth/my_progress.php">{{ "MyReporting"|get_lang }}</a></li>
-                                    <!--<li class="divider"></li>
-                                    <li><a href="{{ _p.web_main }}social/invitations.php">{{ "PendingInvitations"|get_lang }}</a></li> -->
-                                </ul>
-                            </li>
-                            <li><a href="{{ _p.public_web }}logout">{{ "Logout"|get_lang }}</a></li>
-                        </ul>
-                    </div> <!-- /nav collapse -->
-                {% endif %}
-            </div> <!-- /container-fluid-->
-        </div><!-- /navbar-inner -->
-    </div><!-- /topbar -->
-    <div id="topbar_push"></div>
-{% endif %}

+ 2 - 17
main/template/jquery_mobile/layout/welcome_to_course.tpl

@@ -1,18 +1,3 @@
-{{ "HelloXAsYouCanSeeYourCourseListIsEmpty"|get_lang | format(_u.complete_name) }}
+{# Load the template basis from the default template #}
+{% extends app.template_style ~ "/../default/layout/welcome_to_course.tpl" %}
 
-{% if count_courses  == 0 %}
-    {{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
-{% else %}
-
-    {% if "allow_students_to_browse_courses"|get_setting  == 'true' %}
-        
-        {{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }}
-        
-        <a class="btn btn-primary btn-large" href="{{ course_catalog_url }}">
-            {{ "CourseCatalog"|get_lang }}
-        </a>
-    {% else %}
-        {{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
-    {% endif %}
-
-{% endif %}