Skip to content

Commit b564fba

Browse files
committed
Plugin: ExerciseFocused: Add button to reset search - refs BT#21074
1 parent d7c2ac1 commit b564fba

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

plugin/exercisefocused/src/Controller/ReportingController.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __invoke(): HttpResponse
4747
'exercise-focused-tabs',
4848
[],
4949
[],
50-
1
50+
isset($_GET['submit']) ? 2 : 1
5151
);
5252

5353
$this->setBreadcrumb($exercise->getId());
@@ -86,14 +86,21 @@ private function generateTabSearch(CQuiz $exercise, string $courseCode, int $ses
8686
if ($form->validate()) {
8787
$formValues = $form->exportValues();
8888

89-
$action = Display::url(
89+
$actionLeft = Display::url(
9090
Display::return_icon('export_excel.png', get_lang('ExportExcel'), [], ICON_SIZE_MEDIUM),
9191
api_get_path(WEB_PLUGIN_PATH).'exercisefocused/pages/export.php?'.http_build_query($formValues)
9292
);
93+
$actionRight = Display::toolbarButton(
94+
get_lang('Clean'),
95+
api_get_path(WEB_PLUGIN_PATH)
96+
.'exercisefocused/pages/reporting.php?'
97+
.api_get_cidreq().'&'.http_build_query(['id' => $exercise->getId(), 'submit' => '']),
98+
'search'
99+
);
93100

94101
$actions = Display::toolbarAction(
95102
'em-actions',
96-
[$action]
103+
[$actionLeft, $actionRight]
97104
);
98105

99106
$results = $this->findResults($formValues);

0 commit comments

Comments
 (0)