Skip to content

Commit

Permalink
MED-48: Add filter reset to library
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Thies committed Jan 24, 2024
1 parent dcf6f2b commit 1951a16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classes/form/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public function definition() {
$this->tag_elements();

$this->add_action_buttons(false, get_string('search'));
$mform->addElement('cancel', 'reset', get_string('reset'));
$mform->disabledIf('reset', 'query', 'eq', '');
}

/**
Expand Down
5 changes: 5 additions & 0 deletions classes/media_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public function __construct(string $source, ?stdClass $record = null, int $page
'class' => 'form-inline',
]);

if ($this->search->is_cancelled()) {
$url = new moodle_url('/admin/tool/mediatime/index.php');
redirect($url);
}

$rs = self::search((array)$this->search->get_data());
foreach ($rs as $media) {
if (in_array($media->source, $plugins)) {
Expand Down

0 comments on commit 1951a16

Please sign in to comment.