diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php index 00162ffcf..9644d6651 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeController.php @@ -157,23 +157,6 @@ class AttributeController extends AbstractCrudController 'postscriptum' => $object->getPostscriptum() ); - // Setup attributes values - /* - * FIXME : doesn't work. "We get a This form should not contain extra fields." error - $attr_av_list = AttributeAvQuery::create() - ->joinWithI18n($this->getCurrentEditionLocale()) - ->filterByAttributeId($object->getId()) - ->find(); - - $attr_array = array(); - - foreach ($attr_av_list as $attr_av) { - $attr_array[$attr_av->getId()] = $attr_av->getTitle(); - } - - $data['attribute_values'] = $attr_array; - */ - // Setup the object form return new AttributeModificationForm($this->getRequest(), "form", $data); } diff --git a/core/lib/Thelia/Core/Template/Loop/Feed.php b/core/lib/Thelia/Core/Template/Loop/Feed.php index cf29cf3b7..11f872432 100755 --- a/core/lib/Thelia/Core/Template/Loop/Feed.php +++ b/core/lib/Thelia/Core/Template/Loop/Feed.php @@ -29,6 +29,7 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Tools\DateTimeFormat; /** * @@ -90,15 +91,15 @@ class Feed extends BaseLoop $author = $item->get_author(); $description = $item->get_description(); - $date = $item->get_date('d/m/Y'); - $loopResultRow = new LoopResultRow($loopResult, null, $this->versionable, $this->timestampable, $this->countable); - $loopResultRow->set("URL", $item->get_permalink()); - $loopResultRow->set("TITLE", $item->get_title()); - $loopResultRow->set("AUTHOR", $item->get_author()); - $loopResultRow->set("DESCRIPTION", $item->get_description()); - $loopResultRow->set("DATE", $item->get_date('d/m/Y')); // FIXME - date format should be an intl parameter + $loopResultRow + ->set("URL" , $item->get_permalink()) + ->set("TITLE" , $item->get_title()) + ->set("AUTHOR" , $item->get_author()) + ->set("DESCRIPTION" , $item->get_description()) + ->set("DATE" , $item->get_date('U')) // FIXME - date format should be an intl parameter + ; $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php index 01491e6fd..7b9e12eb8 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php @@ -73,7 +73,14 @@ class Format extends AbstractSmartyPlugin $date = $this->getParam($params, "date", false); if ($date === false) { - throw new SmartyPluginException("date is a mandatory parameter in format_date function"); + $timestamp = $this->getParam($params, "timestamp", false); + + if ($timestamp === false) + throw new SmartyPluginException("Either date or timestamp is a mandatory parameter in format_date function"); + else { + $date = new \DateTime(); + $date->setTimestamp($timestamp); + } } if (!$date instanceof \DateTime) { diff --git a/templates/admin/default/ajax/thelia_news_feed.html b/templates/admin/default/ajax/thelia_news_feed.html index f1b7e3133..360ca696b 100755 --- a/templates/admin/default/ajax/thelia_news_feed.html +++ b/templates/admin/default/ajax/thelia_news_feed.html @@ -7,7 +7,7 @@

- {$TITLE|strip_tags nofilter} - {$DATE} + {$TITLE|strip_tags nofilter} - {format_date timestamp=$DATE}

@@ -20,7 +20,7 @@ {intl l='Lire la suite'} - + {/loop} \ No newline at end of file