From 430baa6cdaf14e9930bf18a4dcfa8ad84168589d Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Mon, 26 Aug 2013 14:44:39 +0200 Subject: [PATCH] url output in loops --- core/lib/Thelia/Core/Template/Loop/Content.php | 1 + core/lib/Thelia/Core/Template/Loop/Folder.php | 1 + core/lib/Thelia/Core/Template/Loop/Product.php | 1 + core/lib/Thelia/Model/Category.php | 4 +++- core/lib/Thelia/Model/Content.php | 6 +++++- core/lib/Thelia/Model/Folder.php | 5 +++++ core/lib/Thelia/Model/Product.php | 7 ++++++- 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index e97d63c55..6632a184c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -226,6 +226,7 @@ class Content extends BaseLoop ->set("DESCRIPTION", $content->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $content->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("POSITION", $content->getPosition()) + ->set("URL", $content->getUrl()) ; $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 502e0895f..c95b0dc42 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -168,6 +168,7 @@ class Folder extends BaseLoop ->set("DESCRIPTION", $folder->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM')) ->set("PARENT", $folder->getParent()) + ->set("URL", $folder->getUrl()) ->set("CONTENT_COUNT", $folder->countChild()) ->set("VISIBLE", $folder->getVisible() ? "1" : "0") ->set("POSITION", $folder->getPosition()) diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 2f3d25f87..10112ef28 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -520,6 +520,7 @@ class Product extends BaseLoop ->set("CHAPO", $product->getVirtualColumn('i18n_CHAPO')) ->set("DESCRIPTION", $product->getVirtualColumn('i18n_DESCRIPTION')) ->set("POSTSCRIPTUM", $product->getVirtualColumn('i18n_POSTSCRIPTUM')) + ->set("URL", $product->getUrl()) ->set("BEST_PRICE", $product->getVirtualColumn('real_lowest_price')) ->set("IS_PROMO", $product->getVirtualColumn('main_product_is_promo')) ->set("IS_NEW", $product->getVirtualColumn('main_product_is_new')) diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 35ac49e0e..a05b46b71 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -5,7 +5,8 @@ namespace Thelia\Model; use Thelia\Model\Base\Category as BaseCategory; use Propel\Runtime\ActiveQuery\Criteria; -class Category extends BaseCategory { +class Category extends BaseCategory +{ /** * @return int number of child for the current category */ @@ -18,6 +19,7 @@ class Category extends BaseCategory { { } + /** * Create a new category. * diff --git a/core/lib/Thelia/Model/Content.php b/core/lib/Thelia/Model/Content.php index 19b76bba2..3b5af9ede 100755 --- a/core/lib/Thelia/Model/Content.php +++ b/core/lib/Thelia/Model/Content.php @@ -4,6 +4,10 @@ namespace Thelia\Model; use Thelia\Model\Base\Content as BaseContent; -class Content extends BaseContent { +class Content extends BaseContent +{ + public function getUrl() + { + } } diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index a19ab6796..1179f6e72 100755 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -14,6 +14,11 @@ class Folder extends BaseFolder return FolderQuery::countChild($this->getId()); } + public function getUrl() + { + + } + /** * * count all products for current category and sub categories diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index ca26317e0..ae693e0aa 100755 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -5,5 +5,10 @@ namespace Thelia\Model; use Thelia\Model\Base\Product as BaseProduct; use Thelia\Model\ProductSaleElements; -class Product extends BaseProduct { +class Product extends BaseProduct +{ + public function getUrl() + { + + } }