Skip to content

Commit 9034c03

Browse files
committed
Add catalog_settings option to hide search by title in catalog BT#16817
1 parent 307c848 commit 9034c03

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

main/auth/courses.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,13 @@
203203
api_not_allowed(true);
204204
}
205205

206+
$settings = CoursesAndSessionsCatalog::getCatalogSearchSettings();
206207
$form = new FormValidator('search', 'get', '', null, null, FormValidator::LAYOUT_BOX);
207208
$form->addHidden('action', 'search_course');
208-
$form->addText('search_term', get_lang('Title'));
209+
if (true === $settings['courses']['by_title']) {
210+
$form->addText('search_term', get_lang('Title'));
211+
}
212+
209213
$select = $form->addSelect('category_code', get_lang('CourseCategories'));
210214

211215
$defaults = [];

main/install/configuration.dist.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,18 @@
13771377
//$_configuration['hide_session_dates_in_user_portal'] = false;
13781378

13791379
// Catalog search settings visibility
1380-
//$_configuration['catalog_settings'] = ['sessions' => ['by_title' => true, 'by_date' => true, 'by_tag' => true, 'show_session_info' => true, 'show_session_date' => true]];
1380+
/*$_configuration['catalog_settings'] = [
1381+
'sessions' => [
1382+
'by_title' => true,
1383+
'by_date' => true,
1384+
'by_tag' => true,
1385+
'show_session_info' => true,
1386+
'show_session_date' => true,
1387+
],
1388+
'courses' => [
1389+
'by_title' => true,
1390+
],
1391+
];*/
13811392

13821393
// Enable learning paths with only one SCO item to use the score returned by
13831394
// the SCO as an indicator of progress of the whole learning path
@@ -1437,6 +1448,7 @@
14371448
'title_url' => 'course_home', // Course home URL
14381449
'image_url' => 'course_about', // Course about URL
14391450
],
1451+
'hide_course_title'
14401452
'redirect_after_subscription' => 'course_home', // or 'course_catalog' to stay in the page
14411453
'extra_fields_in_search_form' => ['variable1', 'variable2'],
14421454
'extra_fields_in_course_block' => ['variable3', 'variable4'],

0 commit comments

Comments
 (0)