diff --git a/lib/browse/Criteria.inc b/lib/browse/Criteria.inc
index 015d37e..232d79b 100644
--- a/lib/browse/Criteria.inc
+++ b/lib/browse/Criteria.inc
@@ -165,17 +165,27 @@ class BrowseCriterion {
if ($aPreValue != null) {
// !#@&)*( (*&!@# *(&@NOT (*&!@#
$k = array_keys($aPreValue);
- $k = $k[0];
+ $k = $this->getWidgetBase();
$preval = $aPreValue[$k];
- return $this->getNotWidget() . "getWidgetBase() . "\" value=\"" . $preval . "\"/>";
+ return $this->getNotWidget($aPreValue) . "getWidgetBase() . "\" value=\"" . $preval . "\"/>";
} else {
- return $this->getNotWidget() . "getWidgetBase() . "\" />";
+ return $this->getNotWidget($aPreValue) . "getWidgetBase() . "\" />";
}
}
- function getNotWidget() {
+ function getNotWidget($aPreValue=null) {
+ if (is_null($aPreValue)) {
+ $is_positive = true;
+ }
// not perfect, but acceptable.
$form_name = $this->getWidgetBase() . '_not';
+ $pos_select = '';
+ $neg_select = '';
+ if ($is_positive) {
+ $pos_select = ' selected="true"';
+ } else {
+ $neg_select = ' selected="true"';
+ }
if (!$this->bContains) {
$not_string = _kt('is not');
$is_string = _kt('is');
@@ -183,7 +193,7 @@ class BrowseCriterion {
$not_string = _kt('does not contain');
$is_string = _kt('contains');
}
- $widget = sprintf(' ', $form_name, $is_string, $not_string);
+ $widget = sprintf(' ', $form_name, $pos_select, $is_string, $neg_select, $not_string);
return $widget;
}
@@ -308,10 +318,10 @@ class CreatorCriterion extends BrowseCriterion {
if ($aPreValue != null) {
// !#@&)*( (*&!@# *(&@NOT (*&!@#
$k = array_keys($aPreValue);
- $k = $k[0];
+ $k = $this->getWidgetBase();
$preval = $aPreValue[$k];
}
- $sRet = $this->getNotWidget() . "