Skip to content

Commit

Permalink
Add UI for mime type search
Browse files Browse the repository at this point in the history
(fix #1460)
  • Loading branch information
zerocrates committed Nov 15, 2019
1 parent 813b131 commit 56b3cb1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 10 additions & 5 deletions application/view/common/advanced-search.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ $partials = [
if ($this->status()->isAdminRequest()) {
$partials[] = 'common/advanced-search/resource-template';
}
if ('item' === $resourceType) {
$partials[] = 'common/advanced-search/item-sets';
}
if ($this->status()->isAdminRequest() && 'item' === $resourceType) {
$partials[] = 'common/advanced-search/site-pool';
switch ($resourceType) {
case 'item':
$partials[] = 'common/advanced-search/item-sets';
if ($this->status()->isAdminRequest()) {
$partials[] = 'common/advanced-search/site-pool';
}
break;
case 'media':
$partials[] = 'common/advanced-search/media-type';
break;
}
if ($this->status()->isSiteRequest()) {
$partials[] = 'common/advanced-search/resource-template-restrict';
Expand Down
11 changes: 11 additions & 0 deletions application/view/common/advanced-search/media-type.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
$value = isset($query['media_type']) ? $query['media_type'] : null;
?>
<div class="field">
<div class="field-meta">
<label for="fulltext_search"><?php echo $this->translate('Search by MIME type'); ?></label>
</div>
<div class="inputs">
<input type="text" name="media_type" id="media_type" value="<?php echo $this->escapeHtml($value); ?>">
</div>
</div>

0 comments on commit 56b3cb1

Please sign in to comment.