From dd485c16d49362695cebbdd4e2dbba09f74578c4 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 27 Dec 2011 15:01:11 +0100 Subject: [PATCH] Adding hot courses block (partial) see #4200 --- index.php | 3 ++ main/css/base.css | 11 +++-- main/inc/ajax/course_home.ajax.php | 12 ++++-- main/inc/lib/course.lib.php | 43 +++++++++++++++---- main/inc/lib/database.lib.php | 2 +- main/inc/lib/userportal.lib.php | 6 +-- main/inc/local.inc.php | 4 +- .../default/auth/courses_categories.php | 26 +++++------ main/template/default/layout/head.tpl | 26 ++++++++++- main/template/default/layout/layout_2_col.tpl | 20 +++++++-- user_portal.php | 4 +- 11 files changed, 116 insertions(+), 41 deletions(-) diff --git a/index.php b/index.php index 0dca4ef031..d6c16d6e68 100644 --- a/index.php +++ b/index.php @@ -26,6 +26,7 @@ if (!api_is_anonymous()) { $header_title = " "; } +$htmlHeadXtra[] = api_get_jquery_ui_js(); $htmlHeadXtra[] = api_get_jquery_libraries_js(array('bxslider')); $htmlHeadXtra[] =' diff --git a/main/template/default/layout/layout_2_col.tpl b/main/template/default/layout/layout_2_col.tpl index d6c992edeb..62f5b2705d 100644 --- a/main/template/default/layout/layout_2_col.tpl +++ b/main/template/default/layout/layout_2_col.tpl @@ -18,11 +18,25 @@ {$announcements_block} {if !(empty($hot_courses)) } -

Hottest courses

- {foreach $hot_courses as $hot_course} +

{"HottestCourses"|get_lang}

+ {foreach $hot_courses as $hot_course}
- Course id: {$hot_course.c_id} +

{$hot_course.extra_info.name}

+ {"Visits"|get_lang} : {$hot_course.course_count} + + {if ($hot_course.extra_info.visibility == 3)} + + {"Description"|get_lang} + + {/if} + + {* World *} + {if ($hot_course.extra_info.visibility == 3)} + + {"GoToCourse"|get_lang} + + {/if}
{/foreach} diff --git a/user_portal.php b/user_portal.php index 9b1fd44a7b..c2bd0622b1 100644 --- a/user_portal.php +++ b/user_portal.php @@ -35,6 +35,8 @@ if (isset($_SESSION['this_section'])) require_once './main/inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH).'userportal.lib.php'; +$htmlHeadXtra[] = api_get_jquery_ui_js(); + api_block_anonymous_users(); // Only users who are logged in can proceed. /* Constants and CONFIGURATION parameters */ @@ -226,7 +228,7 @@ if (stripos("flash_yes", $_SESSION['sniff_check_some_activex'])===0 || stripos(" //$controller->tpl->assign('sniff_notification', $sniff_notification); } -$controller->tpl->assign('hot_courses', $controller->return_hot_courses()); +//$controller->tpl->assign('hot_courses', $controller->return_hot_courses()); $controller->tpl->assign('plugin_courses_block', $controller->return_courses_main_plugin()); $controller->tpl->assign('profile_block', $controller->return_profile_block());