Lot of fixes in the new Smarty templates + adding star average , user vote + improving hot courses block (new tpl file hot_courses.tpl)

skala
Julio Montoya 14 years ago
parent d444e1634e
commit 2bd6f4fd64
  1. 15
      main/inc/lib/auth.lib.php
  2. 91
      main/inc/lib/course.lib.php
  3. 39
      main/inc/lib/display.lib.php
  4. 15
      main/inc/lib/main_api.lib.php
  5. 4
      main/inc/lib/template.lib.php
  6. 15
      main/template/default/auth/courses_categories.php
  7. 2
      main/template/default/layout/footer.tpl
  8. 4
      main/template/default/layout/head.tpl
  9. 44
      main/template/default/layout/header.tpl
  10. 60
      main/template/default/layout/hot_courses.tpl
  11. 13
      main/template/default/layout/layout_1_col.tpl
  12. 70
      main/template/default/layout/layout_2_col.tpl
  13. 1
      main/template/default/layout/layout_3_col.tpl

@ -464,9 +464,6 @@ class Auth
ON (url_rel_course.course_code=$tbl_course.code) WHERE access_url_id = $url_access_id ) AS someRandId
WHERE course.id AND course.id >= someRandId.randId $without_special_courses $without_special_courses";
}
} else {
$category_code = Database::escape_string($category_code);
$sql = "SELECT * FROM $tbl_course WHERE category_code='$category_code' $without_special_courses ORDER BY title ";
@ -492,19 +489,11 @@ class Auth
$row['tutor_name'] = get_lang('NoManager');
}
$point_info = CourseManager::get_course_ranking($row['id'], 0);
$points = 0;
$users_who_voted = 0;
if (!empty($point_info['users'])) {
$users_who_voted = $point_info['users'];
$points = $point_info['points']/$point_info['users'] * 100 / 5;
}
$point_info = CourseManager::get_course_ranking($row['id'], 0);
$courses[] = array(
'real_id' => $row['id'],
'point_average' => $points,
'users_who_voted' => $users_who_voted,
'point_info' => $point_info,
'code' => $row['code'],
'directory' => $row['directory'],
'db' => $row['db_name'],

@ -3432,6 +3432,32 @@ class CourseManager {
$result = Database::query($sql);
}
}
public function get_user_course_vote($user_id, $course_id, $session_id = null, $url_id = null) {
$table_user_course_vote = Database::get_main_table(TABLE_MAIN_USER_REL_COURSE_VOTE);
$session_id = !isset($session_id) ? api_get_session_id() : intval($session_id);
$url_id = empty($url_id) ? api_get_current_access_url_id() : intval($url_id);
$user_id = intval($user_id);
if (empty($user_id)) {
return false;
}
$params = array(
'user_id' => $user_id,
'c_id' => $course_id,
'session_id' => $session_id,
'url_id' => $url_id
);
$result = Database::select('vote', $table_user_course_vote, array('where' => array('user_id = ? AND c_id = ? AND session_id = ? AND url_id = ?' => $params)), 'first');
if (!empty($result)) {
return $result['vote'];
}
return false;
}
public function get_course_ranking($course_id, $session_id = null, $url_id = null) {
$table_course_ranking = Database::get_main_table(TABLE_STATISTIC_TRACK_COURSE_RANKING);
@ -3445,8 +3471,29 @@ class CourseManager {
'url_id' => $url_id,
'creation_date' => $now,
);
$result = Database::select('id, accesses, points, users', $table_course_ranking, array('where' => array('c_id = ? AND session_id = ? AND url_id = ?' => $params)), 'first');
$result = Database::select('c_id, accesses, points, users', $table_course_ranking, array('where' => array('c_id = ? AND session_id = ? AND url_id = ?' => $params)), 'first');
$point_average_in_percentage = 0;
$point_average_in_star = 0;
$users_who_voted = 0;
if (!empty($result['users'])) {
$users_who_voted = $result['users'];
$point_average_in_percentage = round($result['points']/$result['users'] * 100 / 5, 2);
$point_average_in_star = round($result['points']/$result['users'], 1);
}
$result['user_vote'] = false;
if (!api_is_anonymous()) {
$result['user_vote'] = self::get_user_course_vote(api_get_user_id(), $course_id, $session_id,$url_id);
}
$result['point_average'] = $point_average_in_percentage;
$result['point_average_star'] = $point_average_in_star;
$result['users_who_voted'] = $users_who_voted;
return $result;
}
@ -3524,16 +3571,22 @@ class CourseManager {
*/
public function add_course_vote($user_id, $vote, $course_id, $session_id = null, $url_id = null) {
$table_user_course_vote = Database::get_main_table(TABLE_MAIN_USER_REL_COURSE_VOTE);
$table_user_course_vote = Database::get_main_table(TABLE_MAIN_USER_REL_COURSE_VOTE);
$course_id = empty($course_id) ? api_get_course_int_id() : intval($course_id);
if (empty($course_id) || empty($user_id)) {
return false;
}
if (!in_array($vote, array(1,2,3,4,5))) {
return false;
}
$session_id = !isset($session_id) ? api_get_session_id() : intval($session_id);
$url_id = empty($url_id) ? api_get_current_access_url_id() : intval($url_id);
$vote = intval($vote);
if (!in_array($vote, array(1,2,3,4,5))) {
return false;
}
$params = array(
'user_id' => intval($user_id),
@ -3546,7 +3599,7 @@ class CourseManager {
$action_done = false;
$result = Database::select('id, vote', $table_user_course_vote, array('where' => array('user_id = ? AND c_id = ? AND session_id = ? AND url_id = ?' => $params)), 'first');
if (empty($result)) {
$result = Database::insert($table_user_course_vote, $params);
$points_to_add = $vote;
@ -3556,11 +3609,12 @@ class CourseManager {
$my_params = array('vote' => $vote);
$points_to_add = $vote - $result['vote'];
$add_user = false;
$result = Database::update($table_user_course_vote, $my_params, array('user_id = ? AND c_id = ? AND session_id = ? AND url_id = ?' => $params));
$action_done = 'updated';
}
//Current points
}
//Current points
if (!empty($points_to_add)) {
self::update_course_ranking($course_id, $session_id, $url_id, $points_to_add, false, $add_user);
}
@ -3596,10 +3650,15 @@ class CourseManager {
function return_hot_courses($days = 30, $limit = 5) {
$limit = intval($limit);
$table_course_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$table_course_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
//@todo all dates in the tracking_course_access, last_access are in the DB time (NOW) not UTC
/*
$today = api_get_utc_datetime();
$today_diff = time() -intval($days)*24*60*60;
$today_diff = api_get_utc_datetime($today_diff);
* */
//WHERE login_course_date <= '$today' AND login_course_date >= '$today_diff'
//$table_course_access table uses the now() and interval ...
@ -3609,12 +3668,18 @@ class CourseManager {
GROUP BY course_code
ORDER BY course_count DESC
LIMIT $limit";
$result = Database::query($sql);
$courses = array();
if (Database::num_rows($result)) {
$courses = Database::store_result($result, 'ASSOC');
foreach ($courses as &$my_course) {
$my_course['extra_info'] = api_get_course_info($my_course['course_code']);
$course_info = api_get_course_info($my_course['course_code']);
$my_course['extra_info'] = $course_info;
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
$point_info = self::get_course_ranking($course_info['real_id'], 0);
$my_course['extra_info']['rating_html'] = Display::return_rating_system($course_info['code'].'_rating', $ajax_url.'&course_id='.$course_info['real_id'], $point_info);
}
}
return $courses;

@ -1273,29 +1273,40 @@ class Display {
}
/**
* Return the five star HTML
*
*
* @param int id of the class
* @param string id of the rating ul
* @param int percentage 0-100 %
* @param string url that will be added (for the jquery stuff)
* @param string show number of persons who voted for that item
* @todo use smarty
**/
public function return_rating_system($id, $percentage, $url, $number_of_users_who_voted = null) {
$percentage = intval($percentage);
if (!empty($percentage)) {
public function return_rating_system($id, $url, $point_info = array()) {
$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
if (!empty($percentage)) {
$percentage = $percentage*125/100;
}
$accesses = isset($point_info['accesses']) ? $point_info['accesses'] : null;
$html = '<ul id = "'.$id.'" class="star-rating">
<li class="current-rating" style="width:'.$percentage.'px;"></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=1" title="'.get_lang('OneStarOutOf5').'" class="one-star">1</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=2" title="'.get_lang('TwoStarsOutOf5').'" class="two-stars">2</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=3" title="'.get_lang('ThreeStarsOutOf5').'" class="three-stars">3</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=4" title="'.get_lang('FourStarsOutOf5').'" class="four-stars">4</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=5" title="'.get_lang('FiveStarsOutOf5').'" class="five-stars">5</a></li>
</ul>';
<li class="current-rating" style="width:'.$percentage.'px;"></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=1" title="'.get_lang('OneStarOutOf5').'" class="one-star">1</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=2" title="'.get_lang('TwoStarsOutOf5').'" class="two-stars">2</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=3" title="'.get_lang('ThreeStarsOutOf5').'" class="three-stars">3</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=4" title="'.get_lang('FourStarsOutOf5').'" class="four-stars">4</a></li>
<li><a href="javascript:void(0)" rel="'.$url.'&star=5" title="'.get_lang('FiveStarsOutOf5').'" class="five-stars">5</a></li>
</ul>';
//if (!isset($number_of_users_who_voted)) {
$label = $number_of_users_who_voted == 1 ? get_lang('Vote') : get_lang('Votes');
$html .= Display::span($number_of_users_who_voted.' '.$label, array('id' => 'vote_label_'.$id));
$label = $number_of_users_who_voted == 1 ? get_lang('Vote') : get_lang('Votes');
$label_accesses = $accesses == 1 ? get_lang('Visite') : get_lang('Visites');
$label_average = $point_info['point_average_star'].' '.get_lang('Average');
$label_user = $point_info['user_vote'] ? get_lang('YouAlreadyVoted').' '.$point_info['user_vote'] : '';
$html .= Display::span($number_of_users_who_voted.' '.$label.' '.$accesses.' '.$label_accesses.' '.$label_average.' '.$label_user, array('id' => 'vote_label_'.$id));
$html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id));
//}
return $html;

@ -1149,6 +1149,14 @@ function api_get_course_info($course_code = null) {
// The real_id is an integer. It is mandatory for future implementations.
$_course['real_id' ] = $course_data['id' ];
$_course['course_language'] = $course_data['course_language'];
//I know this is bad, but this reflects that it was a bad decistion to not add a flag in the DB if an image exists
if (file_exists(api_get_path(SYS_COURSE_PATH).$course_data['directory'].'/course-pic85x85.png')) {
$url_image = api_get_path(WEB_COURSE_PATH).$course_data['directory'].'/course-pic85x85.png';
} else {
$url_image = api_get_path(WEB_IMG_PATH).'without_picture.png';
}
$_course['course_image'] = $url_image;
}
return $_course;
}
@ -1209,6 +1217,13 @@ function api_get_course_info_by_id($id = null) {
$_course['real_id' ] = $course_data['id' ];
$_course['title' ] = $course_data['title' ];
$_course['course_language'] = $course_data['course_language'];
if (file_exists(api_get_path(SYS_COURSE_PATH).$course_data['directory'].'/course-pic85x85.png')) {
$url_image = api_get_path(WEB_COURSE_PATH).$course_data['directory'].'/course-pic85x85.png';
} else {
$url_image = api_get_path(WEB_IMG_PATH).'without_picture.png';
}
$_course['course_image'] = $url_image;
}
return $_course;

@ -21,7 +21,7 @@ class Template extends Smarty {
$this->setConfigDir(api_get_path(SYS_ARCHIVE_PATH));
//Caching settings
$this->caching = true;
$this->caching = false;
//$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->cache_lifetime = Smarty::CACHING_OFF; // no caching
//$this->cache_lifetime = 120;
@ -38,6 +38,8 @@ class Template extends Smarty {
//Creating a Smarty modifier - Now we can call the get_lang from a template!!! Just use {"MyString"|get_lang}
$this->registerPlugin("modifier","get_lang", "get_lang");
//Not recomended to use get_path, use {$_p['xxx']} see set_system_parameters(functions)
$this->registerPlugin("modifier","get_path", "api_get_path");
$this->registerPlugin("modifier","get_setting", "api_get_setting");

@ -21,14 +21,13 @@ $stok = Security::get_token();
*/
?>
<script>
<script type="text/javascript">
$(document).ready( function() {
$('.star-rating li a').click(function(){
var id = $(this).parents('ul').attr('id');
$('#vote_label2_' + id).html('<?php echo Display::return_icon('loading1.gif');?>');
$('#vote_label2_' + id).html('<?php echo get_lang('Loading');?>');
$.ajax({
url: $(this).attr('rel'),
@ -40,7 +39,7 @@ $stok = Security::get_token();
if(data == 'updated') {
$('#vote_label2_' + id).html("<?php echo get_lang('Saved')?>");
}
},
}
})
});
});
@ -139,7 +138,6 @@ $stok = Security::get_token();
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
if (!empty($browse_courses_in_category)) {
foreach ($browse_courses_in_category as $course) {
@ -151,14 +149,13 @@ $stok = Security::get_token();
$course_path = api_get_path(SYS_COURSE_PATH).$course['directory']; // course path
if (file_exists($course_path.'/course-pic85x85.png')) {
$course_web_path = api_get_path(WEB_COURSE_PATH).$course['directory']; // course web path
$course_medium_image = $course_web_path.'/course-pic85x85.png'; // redimensioned image 85x85
if (file_exists($course_path.'/course-pic85x85.png')) {
$course_medium_image = api_get_path(WEB_COURSE_PATH).$course['directory'].'/course-pic85x85.png'; // redimensioned image 85x85
} else {
$course_medium_image = api_get_path(WEB_IMG_PATH).'without_picture.png'; // without picture
}
$rating = Display::return_rating_system($course['code'].'_rating', $course['point_average'], $ajax_url.'&course_id='.$course['real_id'], $course['users_who_voted']);
$rating = Display::return_rating_system($course['code'].'_rating', $ajax_url.'&course_id='.$course['real_id'], $course['point_info']);
//<div class="course-block-main-item"><div class="left">'.get_lang('Teacher').'</div><div class="course-block-teacher right">'.$tutor_name.'</div></div>
//<div class="course-block-main-item"><div class="left">'.get_lang('CreationDate').'</div><div class="course-block-date">'.api_format_date($creation_date,DATE_FORMAT_SHORT).'</div></div>

@ -21,7 +21,7 @@
</div> <!-- end of #footer -->
{$footer_extra_content}
{literal}
<script>
<script type="text/javascript">
$(document).ready( function() {
$(".chzn-select").chosen();

@ -2,9 +2,9 @@
<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" />
<link rel="top" href="{$_p.web_main}index.php" title="" />
<link rel="top" href="{$_p.web_main}index.php" title="" />
<link rel="courses" href="{$_p.web_main}auth/courses.php" title="{"OtherCourses"|get_lang}"/>
<link rel="profil" href="{$_p.web_main}auth/profile.php" title="{"ModifyProfile"|get_lang}"/>
<link rel="profil" href="{$_p.web_main}auth/profile.php" title="{"ModifyProfile"|get_lang}"/>
<meta http-equiv="Content-Type" content="text/html; charset={$system_charset}" />
<meta name="Generator" content="{$_s.software_name} {$_s.system_version|substr:0:1}" />

@ -3,37 +3,37 @@
<div class="topbar">
<div class="topbar-inner">
<div class="container-fluid">
<h3><a href="{'WEB_PATH'|get_path}">{"siteName"|api_get_setting}</a></h3>
<h3><a href="{$_p.web}">{"siteName"|api_get_setting}</a></h3>
{if $_u.logged}
<ul class="nav">
<li class="active"><a href="{'WEB_PATH'|get_path}/user_portal.php">{"MyCourses"|get_lang}</a></li>
<li class="active"><a href="{$_p.web}user_portal.php">{"MyCourses"|get_lang}</a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#">{'Teaching'|get_lang}</a>
<ul class="dropdown-menu">
<li><a href="{'WEB_CODE_PATH'|get_path}create_course/add_course.php">{"AddCourse"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}auth/courses.php">{"Catalog"|get_lang}</a></li>
<li><a href="{$_p.main}create_course/add_course.php">{"AddCourse"|get_lang}</a></li>
<li><a href="{$_p.main}auth/courses.php">{"Catalog"|get_lang}</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" href="#">{'Tracking'|get_lang}</a>
<ul class="dropdown-menu">
<li><a href="{'WEB_CODE_PATH'|get_path}mySpace/">{"CoursesReporting"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}mySpace/index.php?view=admin">{"AdminReports"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}tracking/exams.php">{"ExamsReporting"|get_lang}</a></li>
<li><a href="{$_p.main}mySpace/">{"CoursesReporting"|get_lang}</a></li>
<li><a href="{$_p.main}mySpace/index.php?view=admin">{"AdminReports"|get_lang}</a></li>
<li><a href="{$_p.main}tracking/exams.php">{"ExamsReporting"|get_lang}</a></li>
<li class="divider"></li>
<li><a href="{'WEB_CODE_PATH'|get_path}dashboard/">{"Dashboard"|get_lang}</a></li>
<li><a href="{$_p.main}dashboard/">{"Dashboard"|get_lang}</a></li>
</ul>
</li>
{if $_u.is_admin == 1}
<li class="dropdown">
<a class="dropdown-toggle" href="#">{'Administration'|get_lang}</a>
<ul class="dropdown-menu">
<li><a href="{'WEB_CODE_PATH'|get_path}admin/">{"Home"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}admin/user_list.php">{"UserList"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}admin/course_list.php">{"CourseList"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}admin/session_list.php">{"SessionsList"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}admin/settings.php">{"Settings"|get_lang}</a></li>
<li><a href="{$_p.main}admin/">{"Home"|get_lang}</a></li>
<li><a href="{$_p.main}admin/user_list.php">{"UserList"|get_lang}</a></li>
<li><a href="{$_p.main}admin/course_list.php">{"CourseList"|get_lang}</a></li>
<li><a href="{$_p.main}admin/session_list.php">{"SessionsList"|get_lang}</a></li>
<li><a href="{$_p.main}admin/settings.php">{"Settings"|get_lang}</a></li>
</ul>
</li>
{/if}
@ -41,26 +41,26 @@
{/if}
{if $_u.is_admin == 1}
<form action="{'WEB_CODE_PATH'|get_path}admin/user_list.php" method="get">
<form action="{$_p.main}admin/user_list.php" method="get">
<input type="text" placeholder="{'SearchUsers'|get_lang}" name="keyword">
</form>
{/if}
{if $_u.logged}
<ul class="nav secondary-nav">
<li><a href="{'WEB_CODE_PATH'|get_path}social/home.php"><img src="{$_u.avatar_small}"/></a></li>
<li><a href="{$_p.main}social/home.php"><img src="{$_u.avatar_small}"/></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#">{$_u.complete_name}</a>
<ul class="dropdown-menu">
<li><a href="{'WEB_CODE_PATH'|get_path}social/home.php">{"Profile"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}calendar/agenda_js.php?type=personal">{"MyAgenda"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}messages/inbox.php">{"Messages"|get_lang}</a></li>
<li><a href="{'WEB_CODE_PATH'|get_path}auth/my_progress.php">{"MyReporting"|get_lang}</a></li>
<li><a href="{$_p.main}social/home.php">{"Profile"|get_lang}</a></li>
<li><a href="{$_p.main}calendar/agenda_js.php?type=personal">{"MyAgenda"|get_lang}</a></li>
<li><a href="{$_p.main}messages/inbox.php">{"Messages"|get_lang}</a></li>
<li><a href="{$_p.main}auth/my_progress.php">{"MyReporting"|get_lang}</a></li>
<li class="divider"></li>
<li><a href="{'WEB_CODE_PATH'|get_path}social/invitations.php">{"PendingInvitations"|get_lang}</a></li>
<li><a href="{$_p.main}social/invitations.php">{"PendingInvitations"|get_lang}</a></li>
</ul>
</li>
<li><a href="{'WEB_PATH'|get_path}index.php?logout=logout">Logout</a></li>
<li><a href="{$_p.web}index.php?logout=logout">Logout</a></li>
</ul>
{/if}
</div>
@ -73,7 +73,7 @@
{* header *}
{$header1}
{* header right *}
{* header 2 *}
{$header2}
</div>

@ -0,0 +1,60 @@
<script type="text/javascript">
$(document).ready( function() {
$('.star-rating li a').click(function(){
var id = $(this).parents('ul').attr('id');
$('#vote_label2_' + id).html("{'Loading'|get_lang}");
$.ajax({
url: $(this).attr('rel'),
success: function(data) {
if(data == 'added') {
$('#vote_label2_' + id).html("{'Saved'|get_lang}");
}
if(data == 'updated') {
$('#vote_label2_' + id).html("{'Saved'|get_lang}");
}
}
})
});
});
</script>
{if !(empty($hot_courses)) }
<h3>{"HottestCourses"|get_lang}</h3>
{foreach $hot_courses as $hot_course}
<div class="categories-block-course">
<div class="categories-content-course">
<div class="categories-course-picture">
{html_image file=$hot_course.extra_info.course_image}
</div>
<div class="categories-course-description">
<div class="course-block-title">{$hot_course.extra_info.name|truncate:60}</div>
{$hot_course.extra_info.rating_html}
</div>
</div>
<div class="categories-course-links">
<div class="course-link-desc right">
{if ($hot_course.extra_info.visibility == 3)}
<a class="ajax a_button white small" title="" href="{$_p.web_ajax}course_home.ajax.php?a=show_course_information&code={$hot_course.course_code}">
{"Description"|get_lang}
</a>
{/if}
</div>
{* World *}
{if ($hot_course.extra_info.visibility == 3)}
<div class="course-link-desc right">
<a class="a_button gray small" title="" href="{$_p.web_course}{$hot_course.extra_info.path}/index.php">
{"GoToCourse"|get_lang}
</a>
</div>
{/if}
</div>
</div>
{/foreach}
{/if}

@ -1,25 +1,32 @@
{extends file="default/layout/main.tpl"}
{* Header *}
{block name=header}
{if $show_header == 1}
{include file="default/layout/header.tpl"}
{/if}
{/block}
{* 1 column *}
{block name=body}
{* Actions *}
{if (!empty($actions) ) }
<div class="actions">
{$actions}
</div>
{/if}
{* Notifications*}
{$message}
{* Main content *}
{$content}
{/block}
{* Footer *}
{block name=footer}
{if $show_header == 1}
{include file="default/layout/footer.tpl"}
{/if}
{/block}
{/block}

@ -5,63 +5,77 @@
{/block}
{block name=body}
{* Main content*}
{if $show_sniff == 1 }
{include file="default/layout/sniff.tpl"}
{/if}
<div id="maincontent" class="maincontent">
{* Course plugin block*}
{$plugin_courses_block}
{* ?? *}
{$home_page_block}
{* ?? *}
{$sniff_notification}
{* Show messages*}
{$message}
{* Main content*}
{$content}
{* Announcements *}
{$announcements_block}
{if !(empty($hot_courses)) }
<h3>{"HottestCourses"|get_lang}</h3>
{foreach $hot_courses as $hot_course}
<div class="categories-block-course">
<div class="categories-content-course">
<h4>{$hot_course.extra_info.name}</h4>
{"Visits"|get_lang} : {$hot_course.course_count}
{if ($hot_course.extra_info.visibility == 3)}
<a class="ajax a_button white small" title="" href="{'WEB_AJAX_PATH'|get_path}course_home.ajax.php?a=show_course_information&code={$hot_course.course_code}">
{"Description"|get_lang}
</a>
{/if}
{* World *}
{if ($hot_course.extra_info.visibility == 3)}
<a class="a_button gray small" title="" href="{'WEB_COURSE_PATH'|get_path}{$hot_course.extra_info.path}/index.php">
{"GoToCourse"|get_lang}
</a>
{/if}
</div>
</div>
{/foreach}
{/if}
{* Hot courses template *}
{include file="default/layout/hot_courses.tpl"}
</div>
{* Right column *}
<div id="menu-wrapper">
{*if user is not login show the login form*}
{if $_u.logged == 0}
{include file="default/layout/login_form.tpl"}
{/if}
{* My account - user picture *}
{$profile_block}
{$account_block}
{$teacher_block}
{* Notices *}
{$notice_block}
{* Links that are not added in the tabs*}
{$navigation_course_links}
{* Plugin courses sidebar *}
{$plugin_courses_right_block}
{* Reservation block *}
{$reservation_block}
{* Search (xapian)*}
{$search_block}
{* Classes *}
{$classes_block}
{* Skills*}
{$skills_block}
</div>
{/block}
{block name=footer}
{* Footer *}
{block name=footer}
{include file="default/layout/footer.tpl"}
{/block}

@ -1,3 +1,4 @@
{* This template is NOT used in chamilo 1.9 *}
{extends file="default/layout/main.tpl"}
{block name=header}

Loading…
Cancel
Save