display good content_folder on content_edit admin template

This commit is contained in:
Manuel Raynaud
2013-09-30 18:10:05 +02:00
parent e6e95b2516
commit cd5c89a33b
2 changed files with 101 additions and 88 deletions

View File

@@ -31,6 +31,7 @@ use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ContentQuery;
use Thelia\Model\FolderQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
@@ -55,6 +56,7 @@ class Folder extends BaseI18nLoop
return new ArgumentCollection(
Argument::createIntListTypeArgument('id'),
Argument::createIntTypeArgument('parent'),
Argument::createIntTypeArgument('content'),
Argument::createBooleanTypeArgument('current'),
Argument::createBooleanTypeArgument('not_empty', 0),
Argument::createBooleanOrBothTypeArgument('visible', 1),
@@ -107,6 +109,16 @@ class Folder extends BaseI18nLoop
$search->filterById($exclude, Criteria::NOT_IN);
}
$content = $this->getContent();
if (null !== $content) {
$obj = ContentQuery::create()->findPk($content);
if($obj) {
$search->filterByContent($obj, Criteria::IN);
}
}
$visible = $this->getVisible();
if ($visible != BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);