Adding teacher's name in hot courses and catalog of courses + adding an admin setting to turn off/on the hot courses see #

skala
Julio Montoya 14 years ago
parent 74e8c44b3b
commit 159b7f6e26
  1. 4
      index.php
  2. 1
      main/inc/lib/course.lib.php
  3. 7
      main/install/db_main.sql
  4. 7
      main/install/migrate-db-1.8.8-1.9.0-pre.sql
  5. 4
      main/template/default/auth/courses_categories.php
  6. 1
      main/template/default/layout/hot_courses.tpl

@ -155,7 +155,9 @@ $announcements_block = null;
// When loading a chamilo page do not include the hot courses and news // When loading a chamilo page do not include the hot courses and news
if (!isset($_REQUEST['include'])) { if (!isset($_REQUEST['include'])) {
$hot_courses = $controller->return_hot_courses(); if (api_get_setting('show_hot_courses') == 'true') {
$hot_courses = $controller->return_hot_courses();
}
$announcements_block = $controller->return_announcements(); $announcements_block = $controller->return_announcements();
} }

@ -3673,6 +3673,7 @@ class CourseManager {
foreach ($courses as &$my_course) { foreach ($courses as &$my_course) {
$course_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; $my_course['extra_info'] = $course_info;
$my_course['extra_info']['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($my_course['course_code']);
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; $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); $point_info = self::get_course_ranking($course_info['real_id'], 0);

@ -868,7 +868,8 @@ VALUES
('platform_unsubscribe_allowed', NULL, 'radio', 'Platform', 'false', 'PlatformUnsubscribeTitle', 'PlatformUnsubscribeComment', NULL, NULL, 1), ('platform_unsubscribe_allowed', NULL, 'radio', 'Platform', 'false', 'PlatformUnsubscribeTitle', 'PlatformUnsubscribeComment', NULL, NULL, 1),
('activate_email_template', NULL, 'radio', 'Platform', 'false', 'ActivateEmailTemplateTitle', 'ActivateEmailTemplateComment', NULL, NULL, 0), ('activate_email_template', NULL, 'radio', 'Platform', 'false', 'ActivateEmailTemplateTitle', 'ActivateEmailTemplateComment', NULL, NULL, 0),
('enable_iframe_inclusion', NULL, 'radio', 'Editor', 'false', 'EnableIframeInclusionTitle', 'EnableIframeInclusionComment', NULL, NULL, 1), ('enable_iframe_inclusion', NULL, 'radio', 'Editor', 'false', 'EnableIframeInclusionTitle', 'EnableIframeInclusionComment', NULL, NULL, 1),
('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.18149','DatabaseVersion','', NULL, NULL, 0); ('show_hot_courses', NULL, 'radio', 'Platform', 'true', 'ShowHotCoursesTitle', 'ShowHotCoursesComment', NULL, NULL, 1),
('chamilo_database_version', NULL, 'textfield',NULL, '1.9.0.18163','DatabaseVersion','', NULL, NULL, 0);
/* /*
@ -1222,7 +1223,9 @@ VALUES
('activate_email_template', 'true', 'Yes'), ('activate_email_template', 'true', 'Yes'),
('activate_email_template', 'false', 'No'), ('activate_email_template', 'false', 'No'),
('enable_iframe_inclusion', 'true', 'Yes'), ('enable_iframe_inclusion', 'true', 'Yes'),
('enable_iframe_inclusion', 'false', 'No'); ('enable_iframe_inclusion', 'false', 'No'),
('show_hot_courses', 'true', 'Yes'),
('show_hot_courses', 'false', 'No');
UNLOCK TABLES; UNLOCK TABLES;

@ -171,6 +171,11 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_iframe_inclusion', 'true', 'Yes'); INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_iframe_inclusion', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_iframe_inclusion', 'false', 'No'); INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_iframe_inclusion', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_hot_courses', NULL, 'radio', 'Platform', 'true', 'ShowHotCoursesTitle', 'ShowHotCoursesComment', NULL, NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_hot_courses', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_hot_courses', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_grade_model_id', NULL, 'select', 'Gradebook', '', 'GradebookDefaultGradeModelTitle', 'GradebookDefaultGradeModelComment', NULL, NULL, 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_grade_model_id', NULL, 'select', 'Gradebook', '', 'GradebookDefaultGradeModelTitle', 'GradebookDefaultGradeModelComment', NULL, NULL, 1);
@ -255,7 +260,7 @@ INSERT INTO settings_options (variable, value, display_text) values ('platform_u
-- Do not move this query -- Do not move this query
UPDATE settings_current SET selected_value = '1.9.0.18149' WHERE variable = 'chamilo_database_version'; UPDATE settings_current SET selected_value = '1.9.0.18163' WHERE variable = 'chamilo_database_version';
-- xxSTATSxx -- xxSTATSxx
ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT ''; ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';

@ -153,7 +153,9 @@ $stok = Security::get_token();
echo '</div>'; echo '</div>';
echo '<div class="span4">'; echo '<div class="span4">';
echo '<div class="categories-course-description"><h3>'.cut($title, 60).'</h3>'.$rating.'</div>'; $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
$teachers = '<h5>'.$teachers.'</h5>';
echo '<div class="categories-course-description"><h3>'.cut($title, 60).'</h3>'.$teachers.$rating.'</div>';
echo '<p>'; echo '<p>';
// we display the icon to subscribe or the text already subscribed // we display the icon to subscribe or the text already subscribed

@ -41,6 +41,7 @@ $(document).ready( function() {
<div class="span6"> <div class="span6">
<div class="categories-course-description"> <div class="categories-course-description">
<h3>{{ hot_course.extra_info.name }}</h3> <h3>{{ hot_course.extra_info.name }}</h3>
<h5>{{ hot_course.extra_info.teachers }}</h5>
{{ hot_course.extra_info.rating_html }} {{ hot_course.extra_info.rating_html }}
</div> </div>
<p> <p>

Loading…
Cancel
Save