diff --git a/include/db_filter_ui.php b/include/db_filter_ui.php index d928b84..ed2f270 100644 --- a/include/db_filter_ui.php +++ b/include/db_filter_ui.php @@ -165,32 +165,45 @@ class FilterInterface $oColumn = $this->aFilterInfo[$oFilter->getColumn()]; $sId = ($iId == -1) ? '' : $iId; - $shEditor = $oColumn->getDisplayName(); + $shEditor = $oColumn->getDisplayName().' '; - $shEditor .= " "; + + /* Printing 'equal to' sounds weird if it is the only choice */ + if($aTypes[0] != FILTER_EQUALS) + $shEditor .= $oColumn->getOpName($aTypes[0]); } else { - $sSel = ''; - $sText = 'remove'; - } + $shEditor .= " '; + $shEditor .= ""; + + foreach($aTypes as $iType) + { + if($oFilter->getOperatorId() == $iType) + $sSel = " selected='selected'"; + else + $sSel = ''; + $shEditor .= "
'; + } + $shEditor .= ' '; + } switch($oColumn->getValueType()) { @@ -344,7 +357,7 @@ class FilterInterface $sData = $aClean["s{$sColumn}Data"]; $iOp = $aClean["i{$sColumn}Op"]; - if($iOp) + if($iOp && $sData) { $oFilter = new Filter($oOption->getColumn(), $iOp, $sData); $aReturn[] = $oFilter;