From 3661e17003cdbbeb64fb0a2b69203529c8a6540c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 21 Jun 2011 17:41:42 +0200 Subject: [PATCH] Setting course catalog random by default --- main/auth/courses.php | 4 +- main/css/base.css | 6 +- .../default/auth/courses_categories.php | 98 +++++++++---------- 3 files changed, 53 insertions(+), 55 deletions(-) diff --git a/main/auth/courses.php b/main/auth/courses.php index a8f0a81c00..7e95172fd9 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -65,7 +65,7 @@ if (!(api_is_platform_admin() || api_is_course_admin() || api_is_allowed_to_crea // filter actions $actions = array('sortmycourses', 'createcoursecategory', 'subscribe', 'deletecoursecategory', 'unsubscribe', 'display_courses','display_random_courses'); -$action = 'subscribe'; +$action = 'display_random_courses'; $nameTools = get_lang('SortMyCourses'); if (isset($_GET['action']) && in_array($_GET['action'],$actions)) { @@ -85,7 +85,7 @@ if (empty($nameTools)) { $nameTools = get_lang('CourseManagement'); } else { $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'auth/courses.php', 'name' => get_lang('CourseManagement')); - $interbreadcrumb[] = array('url' => '#', 'name' => $nameTools); + $interbreadcrumb[] = array('url' => '#', 'name' => $nameTools); } diff --git a/main/css/base.css b/main/css/base.css index 90e22fd385..78f8f2fa84 100644 --- a/main/css/base.css +++ b/main/css/base.css @@ -809,9 +809,9 @@ button:hover { margin-top:5px; } -.course-block-main-item { - height: 32px; - padding: 3px 0px 3px 0px; +.course-block-main-item { + height: 45px; + padding: 5px 0px; } .categories-block-course { diff --git a/main/template/default/auth/courses_categories.php b/main/template/default/auth/courses_categories.php index c02178cff5..a18cd11b0f 100755 --- a/main/template/default/auth/courses_categories.php +++ b/main/template/default/auth/courses_categories.php @@ -8,10 +8,9 @@ */ $stok = Security::get_token(); -?> - +// Actions: The menu with the different options in cathe course management - +if (intval($_GET['hidden_links']) != 1) { ?>
@@ -32,69 +31,68 @@ $stok = Security::get_token();
- - +} +?>
- - '.get_lang('RandomPick').''; - $code = ''; + '.get_lang('RandomPick').''; + $code = ''; + } else { + echo ''.get_lang('RandomPick').''; + } + // level 1 + foreach ($browse_course_categories[0] as $category) { + $category_name = $category['name']; + $category_code = $category['code']; + $count_courses_lv1 = $category['count_courses']; + + if ($code == $category_code) { + $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; } else { - echo ''.get_lang('RandomPick').''; - } - // level 1 - foreach ($browse_course_categories[0] as $category) { - $category_name = $category['name']; - $category_code = $category['code']; - $count_courses_lv1 = $category['count_courses']; - - if ($code == $category_code) { - $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; + if (!empty($count_courses_lv1)) { + $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; } else { - if (!empty($count_courses_lv1)) { - $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; + $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; + } + } + echo '
'.$category_link.'
'; + // level 2 + if (!empty($browse_course_categories[$category_code])) { + foreach ($browse_course_categories[$category_code] as $subcategory1) { + $subcategory1_name = $subcategory1['name']; + $subcategory1_code = $subcategory1['code']; + $count_courses_lv2 = $subcategory1['count_courses']; + if ($code == $subcategory1_code) { + $subcategory1_link = ''.$subcategory1_name.' ('.$count_courses_lv2.')'; } else { - $category_link = ''.$category_name.' ('.$count_courses_lv1.')'; + $subcategory1_link = ''.$subcategory1_name.' ('.$count_courses_lv2.')'; } - } - echo '
'.$category_link.'
'; - // level 2 - if (!empty($browse_course_categories[$category_code])) { - foreach ($browse_course_categories[$category_code] as $subcategory1) { - $subcategory1_name = $subcategory1['name']; - $subcategory1_code = $subcategory1['code']; - $count_courses_lv2 = $subcategory1['count_courses']; - if ($code == $subcategory1_code) { - $subcategory1_link = ''.$subcategory1_name.' ('.$count_courses_lv2.')'; + echo '
'.$subcategory1_link.'
'; + } + // level 3 + if (!empty($browse_course_categories[$subcategory1_code])) { + foreach ($browse_course_categories[$subcategory1_code] as $subcategory2) { + $subcategory2_name = $subcategory2['name']; + $subcategory2_code = $subcategory2['code']; + $count_courses_lv3 = $subcategory2['count_courses']; + if ($code == $subcategory2_code) { + $subcategory2_link = ''.$subcategory2_name.' ('.$count_courses_lv3.')'; } else { - $subcategory1_link = ''.$subcategory1_name.' ('.$count_courses_lv2.')'; - } - echo '
'.$subcategory1_link.'
'; - } - // level 3 - if (!empty($browse_course_categories[$subcategory1_code])) { - foreach ($browse_course_categories[$subcategory1_code] as $subcategory2) { - $subcategory2_name = $subcategory2['name']; - $subcategory2_code = $subcategory2['code']; - $count_courses_lv3 = $subcategory2['count_courses']; - if ($code == $subcategory2_code) { - $subcategory2_link = ''.$subcategory2_name.' ('.$count_courses_lv3.')'; - } else { - $subcategory2_link = ''.$subcategory2_name.' ('.$count_courses_lv3.')'; - } - echo '
'.$subcategory2_link.'
'; + $subcategory2_link = ''.$subcategory2_name.' ('.$count_courses_lv3.')'; } + echo '
'.$subcategory2_link.'
'; } } } + } } ?>