mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +00:00
add searching for mime types
This commit is contained in:
parent
a5edba86ae
commit
ae66ec223c
|
@ -574,6 +574,21 @@ if($fullsearch) {
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
// Check to see if the search has been restricted to a particular
|
||||||
|
// mimetype. {{{
|
||||||
|
$mimetype = [];
|
||||||
|
if (isset($_GET["mimetype"])) {
|
||||||
|
if (!is_array($_GET['mimetype'])) {
|
||||||
|
if(!empty($_GET['mimetype']))
|
||||||
|
$mimetype[] = $_GET['mimetype'];
|
||||||
|
} else {
|
||||||
|
foreach($_GET["mimetype"] as $l) {
|
||||||
|
if($l)
|
||||||
|
$mimetype[] = $l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
// status
|
// status
|
||||||
$status = isset($_GET['status']) ? $_GET['status'] : array();
|
$status = isset($_GET['status']) ? $_GET['status'] : array();
|
||||||
/*
|
/*
|
||||||
|
@ -661,6 +676,7 @@ if($fullsearch) {
|
||||||
'startFolder'=>$startFolder,
|
'startFolder'=>$startFolder,
|
||||||
'owner'=>$ownerobjs,
|
'owner'=>$ownerobjs,
|
||||||
'status'=>$status,
|
'status'=>$status,
|
||||||
|
'mimetype'=>$mimetype,
|
||||||
'creationstartdate'=>$created['from'], //$createstartdate ? $createstartdate : array(),
|
'creationstartdate'=>$created['from'], //$createstartdate ? $createstartdate : array(),
|
||||||
'creationenddate'=>$created['to'], //$createenddate ? $createenddate : array(),
|
'creationenddate'=>$created['to'], //$createenddate ? $createenddate : array(),
|
||||||
'modificationstartdate'=>$modified['from'],
|
'modificationstartdate'=>$modified['from'],
|
||||||
|
|
|
@ -707,6 +707,8 @@ $(document).ready(function() {
|
||||||
$openfilterdlg = true;
|
$openfilterdlg = true;
|
||||||
if($status)
|
if($status)
|
||||||
$openfilterdlg = true;
|
$openfilterdlg = true;
|
||||||
|
if($mimetype)
|
||||||
|
$openfilterdlg = true;
|
||||||
if($modifyenddate || $modifystartdate)
|
if($modifyenddate || $modifystartdate)
|
||||||
$openfilterdlg = true;
|
$openfilterdlg = true;
|
||||||
if($expenddate || $expstartdate)
|
if($expenddate || $expstartdate)
|
||||||
|
@ -761,6 +763,22 @@ $(document).ready(function() {
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$options = [];
|
||||||
|
foreach($dms->getMimeTypes() as $m) {
|
||||||
|
$options[] = array($m['mimeType'], $m['mimeType'], in_array($m['mimeType'], $mimetype)/*, array(array('data-subtitle', htmlspecialchars($m['c'].' ×')))*/);
|
||||||
|
}
|
||||||
|
$this->formField(
|
||||||
|
getMLText("mimetype"),
|
||||||
|
array(
|
||||||
|
'element'=>'select',
|
||||||
|
'class'=>'chzn-select',
|
||||||
|
'name'=>'mimetype[]',
|
||||||
|
'multiple'=>true,
|
||||||
|
'attributes'=>array(array('data-placeholder', getMLText('select_mimetype')), array('data-no_results_text', getMLText('unknown_mimetype'))),
|
||||||
|
'options'=>$options
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("modified")." (".getMLText('from').")",
|
getMLText("modified")." (".getMLText('from').")",
|
||||||
$this->getDateChooser(!empty($modifystartdate) ? getReadableDate($modifystartdate) : null, "modified[from]", $this->params['session']->getLanguage())
|
$this->getDateChooser(!empty($modifystartdate) ? getReadableDate($modifystartdate) : null, "modified[from]", $this->params['session']->getLanguage())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user