Browse Source

fix buttons catalog of courses CT#7539

aragonc 9 years ago
parent
commit
0f198aa631
2 changed files with 6 additions and 7 deletions
  1. 1 1
      main/inc/lib/course.lib.php
  2. 5 6
      main/template/default/auth/courses_categories.php

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

@@ -4559,7 +4559,7 @@ class CourseManager
             if ($access_link && in_array('register', $access_link)) {
                 $my_course['extra_info']['register_button'] = Display::url(get_lang('Subscribe'),
                     api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok,
-                    array('class' => 'btn btn-primary'));
+                    array('class' => 'btn btn-success btn-block btn-sm'));
             }
 
             if ($access_link && in_array('enter',

+ 5 - 6
main/template/default/auth/courses_categories.php

@@ -192,7 +192,7 @@ $code = isset($code) ? $code : null;
 
             $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
             $user_id = api_get_user_id();
-
+            
             if (!empty($browse_courses_in_category)) {
                 foreach ($browse_courses_in_category as $course) {
                     $course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN);
@@ -208,6 +208,7 @@ $code = isset($code) ? $code : null;
                     $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM);
                     $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED);
                     $course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED);
+                  
                     $course_subscribe_allowed = ($course['subscribe'] == 1);
                     $course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
                     $count_connections = $course['count_connections'];
@@ -228,15 +229,13 @@ $code = isset($code) ? $code : null;
                     $html .= '<div class="btn-toolbar">';
                     // if user registered as student
                     if ($user_registerd_in_course_as_student) {
-                        if (!$course_closed) {
-                            //$html .= return_goto_button($course);
-                            
+                        if (!$course_closed) {                        
                             if ($course_unsubscribe_allowed) {
                                 $html .= return_unregister_button($course, $stok, $search_term, $code);
                             }
                             $html .= return_already_registered_label('student');
-                            $html .= return_description_button($course, $icon_title);
                         }
+                        $html .= return_description_button($course, $icon_title);
                     } elseif ($user_registerd_in_course_as_teacher) {
                         // if user registered as teacher
                         //$html .= return_goto_button($course);
@@ -255,8 +254,8 @@ $code = isset($code) ? $code : null;
                                     $html .= return_register_button($course, $stok, $code, $search_term);
                                 }
                             }
-                            $html .= return_description_button($course, $icon_title);
                         }
+                        $html .= return_description_button($course, $icon_title);
                     }
                     
                     $html .= '</div>';