Added a new loop argument type to pass either true (1), false (0) or

both (*). Useful for visible argument for example.
This commit is contained in:
franck
2013-08-07 22:41:57 +02:00
parent 17b1c333c5
commit eb93049897
2 changed files with 56 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ class Category extends BaseLoop
Argument::createIntTypeArgument('parent'),
Argument::createBooleanTypeArgument('current'),
Argument::createBooleanTypeArgument('not_empty', 0),
Argument::createBooleanTypeArgument('visible', 1),
Argument::createBooleanOrBothTypeArgument('visible', 1),
new Argument(
'order',
new TypeCollection(
@@ -122,7 +122,8 @@ class Category extends BaseLoop
$search->filterById($exclude, Criteria::NOT_IN);
}
$search->filterByVisible($this->getVisible() ? 1 : 0);
if ($this->getVisible() != '*')
$search->filterByVisible($this->getVisible() ? 1 : 0);
$orders = $this->getOrder();