Skip to content

Commit 34f1447

Browse files
committed
Add setting 'hide_search_form_in_session_list'
Hide search form in session list See BT#13027
1 parent ee1f9cc commit 34f1447

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

main/install/configuration.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,5 @@
509509
//ALTER TABLE c_quiz ADD show_previous_button TINYINT(1) DEFAULT 1;
510510
//$_configuration['allow_quiz_show_previous_button_setting'] = false;
511511
// ------
512+
// Hide search form in session list
513+
//$_configuration['hide_search_form_in_session_list'] = false;

main/session/session_list.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
)
128128
);
129129

130+
$hideSearch = api_get_configuration_value('hide_search_form_in_session_list');
131+
130132
//With this function we can add actions to the jgrid (edit, delete, etc)
131133
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
132134
return \'<a href="session_edit.php?page=resume_session.php&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
@@ -220,7 +222,16 @@ function show_cols(grid, added_cols) {
220222
}
221223

222224
<?php
223-
echo Display::grid_js('sessions', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
225+
echo Display::grid_js(
226+
'sessions',
227+
$url,
228+
$columns,
229+
$column_model,
230+
$extra_params,
231+
array(),
232+
$action_links,
233+
true
234+
);
224235
?>
225236

226237
setSearchSelect("status");
@@ -271,8 +282,12 @@ function show_cols(grid, added_cols) {
271282
prmSearch
272283
);
273284

285+
<?php
274286
// Create the searching dialog.
275-
grid.searchGrid(prmSearch);
287+
if ($hideSearch !== true) {
288+
echo 'grid.searchGrid(prmSearch);';
289+
}
290+
?>
276291

277292
// Fixes search table.
278293
var searchDialogAll = $("#fbox_"+grid[0].id);

0 commit comments

Comments
 (0)