Quellcode durchsuchen

Merge branch 'danbarretodev-7273' into 1.9.x

Yannick Warnier vor 10 Jahren
Ursprung
Commit
e5580e8fc5

+ 2 - 0
main/auth/courses.php

@@ -53,6 +53,8 @@ if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
     </script>';
 }
 
+// Get Limit data
+$limit = getLimitArray();
 
 // Section for the tabs.
 $this_section = SECTION_COURSES;

+ 2 - 0
main/auth/courses_controller.php

@@ -96,6 +96,7 @@ class CoursesController
         if ($action == 'display_random_courses') {
             // Random value is used instead limit filter
             $data['browse_courses_in_category'] = $this->model->browse_courses_in_category(null, 10);
+            $data['countCoursesInCategory'] = count($data['browse_courses_in_category']);
         } else {
             if (!isset($category_code)) {
                 $category_code = $browse_course_categories[0][1]['code']; // by default first category
@@ -155,6 +156,7 @@ class CoursesController
     public function search_courses($search_term, $message = '', $error = '', $content = null, $limit = array())
     {
         $data = array();
+        $limit = !empty($limit) ? $limit : getLimitArray();
 
         $browse_course_categories = $this->model->browse_course_categories();
         $data['countCoursesInCategory'] = $this->model->count_courses_in_category('ALL', $search_term);

+ 1 - 1
main/template/default/auth/courses_categories.php

@@ -138,7 +138,7 @@ $userInfo = api_get_user_info();
              * it, as this can considerably slow down your system
              */
             if (!empty($browse_course_categories)) {
-                //echo '<a class="btn" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a><br /><br />';
+                echo '<a class="btn" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a><br /><br />';
             ?>
             </ul>
         </div>

+ 1 - 1
main/template/default/auth/sessions_catalog.tpl

@@ -71,7 +71,7 @@
                 {% endif %}
 
                 {% if coursesCategoriesList is not empty %}
-                    <!-- a class="btn" href="{{ api_get_self }}?action=display_random_courses">{{ 'RandomPick' | get_lang }}</a-->
+                    <a class="btn" href="{{ api_get_self }}?action=display_random_courses">{{ 'RandomPick' | get_lang }}</a>
                 {% endif %}
             </div>