Merge branch 'frontend' of https://github.com/thelia/thelia into frontend

This commit is contained in:
touffies
2013-10-18 12:43:27 +02:00
10 changed files with 279 additions and 110 deletions

View File

@@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="home" path="/" >
<route id="home" path="/">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">index</default>
</route>
@@ -16,6 +16,11 @@
<default key="_view">search</default>
</route>
<route id="view_all" path="/view_all" methods="get">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">view_all</default>
</route>
<!-- Customer routes : Register -->
<route id="customer.create.process" path="/register" methods="post">
<default key="_controller">Thelia\Controller\Front\CustomerController::createAction</default>

View File

@@ -86,6 +86,7 @@ class Content extends BaseI18nLoop
*/
public function exec(&$pagination)
{
$search = ContentQuery::create();
/* manage translations */
@@ -138,27 +139,15 @@ class Content extends BaseI18nLoop
$current_folder = $this->getCurrent_folder();
if ($current_folder === true) {
$search->filterByFolder(
FolderQuery::create()->filterByContent(
ContentFolderQuery::create()->filterByContentId(
$this->request->get("content_id"),
Criteria::EQUAL
)->find(),
Criteria::IN
)->find(),
Criteria::IN
);
$current = ContentQuery::create()->findPk($this->request->get("content_id"));
$search->filterByFolder($current->getFolders(), Criteria::IN);
} elseif ($current_folder === false) {
$search->filterByFolder(
FolderQuery::create()->filterByContent(
ContentFolderQuery::create()->filterByContentId(
$this->request->get("content_id"),
Criteria::EQUAL
)->find(),
Criteria::IN
)->find(),
Criteria::NOT_IN
);
$current = ContentQuery::create()->findPk($this->request->get("content_id"));
$search->filterByFolder($current->getFolders(), Criteria::NOT_IN);
}
$visible = $this->getVisible();