diff --git a/composer.json b/composer.json index 03c4e7e11..301496fa9 100755 --- a/composer.json +++ b/composer.json @@ -31,7 +31,9 @@ "smarty/smarty": "v3.1.13", "kriswallsmith/assetic": "1.2.*@dev", "leafo/lessphp": "0.3.*@dev", - "ptachoire/cssembed": "dev-master" + "ptachoire/cssembed": "dev-master", + + "simplepie/simplepie": "dev-master" }, "require-dev" : { "fzaninotto/faker": "dev-master" diff --git a/core/lib/Thelia/Admin/Controller/BaseAdminController.php b/core/lib/Thelia/Admin/Controller/BaseAdminController.php index 1c193a966..4c0120ad4 100755 --- a/core/lib/Thelia/Admin/Controller/BaseAdminController.php +++ b/core/lib/Thelia/Admin/Controller/BaseAdminController.php @@ -79,4 +79,14 @@ class BaseAdminController extends ContainerAware return $parser; } -} \ No newline at end of file + + public function getFormFactory() + { + return BaseForm::getFormFactory($this->getRequest(), ConfigQuery::read("form.secret.admin", md5(__DIR__))); + } + + public function getFormBuilder() + { + return $this->getFormFactory()->createBuilder("form"); + } +} diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index f4140d5a6..63f5079b9 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -7,6 +7,7 @@ + @@ -113,4 +114,4 @@ - \ No newline at end of file + diff --git a/core/lib/Thelia/Core/Security/Role/Role.php b/core/lib/Thelia/Core/Security/Role/Role.php new file mode 100644 index 000000000..b47e1c089 --- /dev/null +++ b/core/lib/Thelia/Core/Security/Role/Role.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace use Thelia\Core\Security\Role; + +/** + * Role is a simple implementation of a RoleInterface where the role is a + * string. + * + * @author Fabien Potencier + */ +class Role implements RoleInterface +{ + private $role; + + /** + * Constructor. + * + * @param string $role The role name + */ + public function __construct($role) + { + $this->role = (string) $role; + } + + /** + * {@inheritdoc} + */ + public function getRole() + { + return $this->role; + } +} diff --git a/core/lib/Thelia/Core/Security/Role/RoleInterface.php b/core/lib/Thelia/Core/Security/Role/RoleInterface.php new file mode 100644 index 000000000..1a27ae092 --- /dev/null +++ b/core/lib/Thelia/Core/Security/Role/RoleInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Thelia\Core\Security\Role; + +/** + * RoleInterface represents a role granted to a user. + * + * A role must either have a string representation or it needs to be explicitly + * supported by at least one AccessDecisionManager. + * + * @author Fabien Potencier + */ +interface RoleInterface +{ + /** + * Returns the role. + * + * This method returns a string representation whenever possible. + * + * When the role cannot be represented with sufficient precision by a + * string, it should return null. + * + * @return string|null A string representation of the role, or null + */ + public function getRole(); +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Security/User/UserInterface.php b/core/lib/Thelia/Core/Security/User/UserInterface.php index 9057504ca..be158e88c 100644 --- a/core/lib/Thelia/Core/Security/User/UserInterface.php +++ b/core/lib/Thelia/Core/Security/User/UserInterface.php @@ -30,6 +30,20 @@ interface UserInterface { */ public function getAlgo(); + /** + * Returns the roles granted to the user. + * + * + * public function getRoles() + * { + * return array('ROLE_USER'); + * } + * + * + * @return Role[] The user roles + */ + public function getRoles(); + /** * Removes sensitive data from the user. * diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 8345ae06a..f7a958cad 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -38,16 +38,14 @@ abstract class BaseLoop /** * @var \Symfony\Component\HttpFoundation\Request */ - public $request; + protected $request; /** * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ - public $dispatcher; + protected $dispatcher; - public $limit; - public $page; - public $offset; + private $args; protected function getDefaultArgs() { @@ -59,6 +57,8 @@ abstract class BaseLoop } /** + * Create a new Loop + * * @param \Symfony\Component\HttpFoundation\Request $request * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher */ @@ -66,14 +66,94 @@ abstract class BaseLoop { $this->request = $request; $this->dispatcher = $dispatcher; + + $this->args = $this->getArgDefinitions()->addArguments($this->getDefaultArgs()); } /** - * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection + * Initialize the loop arguments. + * + * @param array $nameValuePairs a array of name => value pairs. The name is the name of the argument. + * + * @throws \InvalidArgumentException if somùe argument values are missing, or invalid */ - public function getArgs() - { - return $this->defineArgs()->addArguments($this->getDefaultArgs()); + public function initializeArgs(array $nameValuePairs) { + + $faultActor = array(); + $faultDetails = array(); + + while (($argument = $this->args->current()) !== false) { + + $value = isset($nameValuePairs[$argument->name]) ? $nameValuePairs[$argument->name] : null; + + /* check if mandatory */ + if($value === null && $argument->mandatory) { + $faultActor[] = $argument->name; + $faultDetails[] = sprintf('"%s" parameter is missing', $argument->name); + continue; + } + + /* check if empty */ + if($value === '' && !$argument->empty) { + $faultActor[] = $argument->name; + $faultDetails[] = sprintf('"%s" parameter cannot be empty', $argument->name); + continue; + } + + /* check type */ + if($value !== null && !$argument->type->isValid($value)) { + $faultActor[] = $argument->name; + $faultDetails[] = sprintf('Invalid value for "%s" argument', $argument->name); + continue; + } + + /* set default */ + /* did it as last checking for we consider default value is acceptable no matter type or empty restriction */ + if($value === null) { + $value = $argument->default; + } + + $argument->setValue($value); + + $this->args->next(); + } + + if (!empty($faultActor)) { + + $complement = sprintf('[%s]', implode(', ', $faultDetails)); + throw new \InvalidArgumentException($complement); + } + } + + /** + * Return a loop argument + * + * @param string $argumentName the argument name + * + * @throws \InvalidArgumentException if argument is not found in loop argument list + * @return Argument the loop argument. + */ + public function getArg($argumentName) { + + $arg = $this->args->get($argumentName); + + if ($arg === null) + throw new \InvalidArgumentException("Undefined loop argument '$argumentName'"); + + return $arg; + } + + /** + * Return a loop argument value + * + * @param string $argumentName the argument name + * + * @throws \InvalidArgumentException if argument is not found in loop argument list + * @return Argument the loop argument. + */ + public function getArgValue($argumentName) { + + return $this->getArg($argumentName)->getValue(); } /** @@ -84,7 +164,7 @@ abstract class BaseLoop */ public function search(ModelCriteria $search, &$pagination = null) { - if($this->page !== null) { + if($this->getArgValue('page') !== null) { return $this->searchWithPagination($search, $pagination); } else { return $this->searchWithOffset($search); @@ -98,10 +178,10 @@ abstract class BaseLoop */ public function searchWithOffset(ModelCriteria $search) { - if($this->limit >= 0) { - $search->limit($this->limit); + if($this->getArgValue('limit') >= 0) { + $search->limit($this->getArgValue('limit')); } - $search->offset($this->offset); + $search->offset($this->getArgValue('offset')); return $search->find(); } @@ -114,9 +194,9 @@ abstract class BaseLoop */ public function searchWithPagination(ModelCriteria $search, &$pagination) { - $pagination = $search->paginate($this->page, $this->limit); + $pagination = $search->paginate($this->getArgValue('page'), $this->getArgValue('limit')); - if($this->page > $pagination->getLastPage()) { + if($this->getArgValue('page') > $pagination->getLastPage()) { return array(); } else { return $pagination; @@ -148,7 +228,8 @@ abstract class BaseLoop * @param $pagination * * @return mixed - */abstract public function exec(&$pagination); + */ + abstract public function exec(&$pagination); /** * @@ -169,6 +250,6 @@ abstract class BaseLoop * * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection */ - abstract protected function defineArgs(); + abstract protected function getArgDefinitions(); } diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php index 86c11edfb..721dde312 100755 --- a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php @@ -38,12 +38,25 @@ class Argument public $mandatory; public $empty; - public function __construct($name, \Thelia\Type\TypeCollection $type, $default = null, $mandatory = false, $empty = true) + private $value; + + public function __construct($name, \Thelia\Type\TypeCollection $type, $default = null, $mandatory = false, $empty = true, $value = null) { $this->name = $name; $this->type = $type; $this->mandatory = $mandatory ? true : false; $this->default = $default; + $this->empty = $empty; + + $this->setValue($value); + } + + public function getValue() { + return $this->value; + } + + public function setValue($value) { + $this->value = $value; } public static function createAnyTypeArgument($name, $default=null, $mandatory=false, $empty=true) diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php index 6aec1fd9b..b4b680e08 100755 --- a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php @@ -30,14 +30,21 @@ namespace Thelia\Core\Template\Loop\Argument; class ArgumentCollection implements \Iterator { - private $position; - protected $arguments = array(); + private $arguments = array(); public function __construct() { $this->addArguments(func_get_args()); } + public function hasKey($key) { + return isset($this->arguments[$key]); + } + + public function get($key) { + return $this->hasKey($key) ? $this->arguments[$key] : null; + } + public function isEmpty() { return count($this->arguments) == 0; @@ -64,7 +71,8 @@ class ArgumentCollection implements \Iterator */ public function addArgument(Argument $argument) { - $this->arguments[] = $argument; + $this->arguments[$argument->name] = $argument; + return $this; } @@ -81,7 +89,7 @@ class ArgumentCollection implements \Iterator */ public function current() { - return $this->arguments[$this->position]; + return current($this->arguments); } /** @@ -92,7 +100,7 @@ class ArgumentCollection implements \Iterator */ public function next() { - $this->position++; + next($this->arguments); } /** @@ -103,7 +111,7 @@ class ArgumentCollection implements \Iterator */ public function key() { - return $this->position; + return key($this->arguments); } /** @@ -115,7 +123,7 @@ class ArgumentCollection implements \Iterator */ public function valid() { - return isset($this->arguments[$this->position]); + return $this->key() !== null; } /** @@ -126,6 +134,6 @@ class ArgumentCollection implements \Iterator */ public function rewind() { - $this->position = 0; + reset($this->arguments); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 44874ed59..a80f42549 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -68,20 +68,10 @@ use Thelia\Type; */ class Category extends BaseLoop { - public $id; - public $parent; - public $current; - public $not_empty; - public $visible; - public $link; - public $order; - public $random; - public $exclude; - /** * @return ArgumentCollection */ - protected function defineArgs() + protected function getArgDefinitions() { return new ArgumentCollection( Argument::createIntListTypeArgument('id'), @@ -110,31 +100,45 @@ class Category extends BaseLoop { $search = CategoryQuery::create(); - if (!is_null($this->id)) { - $search->filterById($this->id, Criteria::IN); + $id = $this->getArgValue('id'); + + if (!is_null($id)) { + $search->filterById($id, Criteria::IN); } - if (!is_null($this->parent)) { - $search->filterByParent($this->parent); + + $parent = $this->getArgValue('parent'); + + if (!is_null($parent)) { + $search->filterByParent($parent); } - if ($this->current === true) { + + $current = $this->getArgValue('current'); + + if ($current === true) { $search->filterById($this->request->get("category_id")); - } elseif ($this->current === false) { + } elseif ($current === false) { $search->filterById($this->request->get("category_id"), Criteria::NOT_IN); } - if (!is_null($this->exclude)) { - $search->filterById($this->exclude, Criteria::NOT_IN); + + $exclude = $this->getArgValue('exclude'); + + if (!is_null($exclude)) { + $search->filterById($exclude, Criteria::NOT_IN); } - if (!is_null($this->link)) { - $search->filterByLink($this->link); + + $link = $this->getArgValue('link'); + + if (!is_null($link)) { + $search->filterByLink($link); } - $search->filterByVisible($this->visible ? 1 : 0); + $search->filterByVisible($this->getArgValue('visible') ? 1 : 0); - switch ($this->order) { + switch ($this->getArgValue('order')) { case "alpha": $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); break; @@ -149,7 +153,8 @@ class Category extends BaseLoop break; } - if ($this->random === true) { + + if ($this->getArgValue('random') === true) { $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); } @@ -161,7 +166,7 @@ class Category extends BaseLoop */ $search->joinWithI18n( - $this->request->getSession()->get('locale', 'en_US'), + $this->request->getSession()->getLocale(), (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN ); @@ -189,5 +194,4 @@ class Category extends BaseLoop return $loopResult; } - -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Loop/Feed.php b/core/lib/Thelia/Core/Template/Loop/Feed.php new file mode 100644 index 000000000..8d6626013 --- /dev/null +++ b/core/lib/Thelia/Core/Template/Loop/Feed.php @@ -0,0 +1,115 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Loop; + +use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\LoopResult; +use Thelia\Core\Template\Element\LoopResultRow; + +use Thelia\Core\Template\Loop\Argument\ArgumentCollection; +use Thelia\Core\Template\Loop\Argument\Argument; + +use Thelia\Type\TypeCollection; +use Thelia\Type; + +/** + * + * @package Thelia\Core\Template\Loop + * + * @author Franck Allimant + */ +class Feed extends BaseLoop +{ + public function getArgDefinitions() + { + return new ArgumentCollection( + new Argument( + 'url', + new TypeCollection(new Type\AnyType()) + ), + new Argument( + 'timeout', + new TypeCollection( + new Type\IntType() + ), + 10 + ) + ); + } + + /** + * + * + * @return \Thelia\Core\Template\Element\LoopResult + */ + public function exec(&$pagination) + { + $cachedir = THELIA_ROOT . 'cache/feeds'; + + if (! is_dir($cachedir)) { + if (! mkdir($cachedir)) { + throw new \Exception(sprintf("Failed to create cache directory '%s'", $cachedir)); + } + } + + $feed = new \SimplePie($this->getArgValue('url'), THELIA_ROOT . 'cache/feeds'); + + $feed->init(); + + $feed->handle_content_type(); + + $feed->set_timeout($this->getArgValue('timeout')); + + $items = $feed->get_items(); + + $limit = min(count($items), $this->getArgValue('limit')); + + $loopResult = new LoopResult(); + + for($idx = 0; $idx < $limit; $idx++) { + + $item = $items[$idx]; + + $link = $item->get_permalink(); + + $title = $item->get_title(); + $author = $item->get_author(); + $description = $item->get_description(); + + $date = $item->get_date('d/m/Y'); + + $loopResultRow = new LoopResultRow(); + + $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 + + $loopResult->addRow($loopResultRow); + } + + return $loopResult; + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index c80a47ade..2d427d6b7 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -52,24 +52,6 @@ use Thelia\Type; */ class Product extends BaseLoop { - public $id; - public $ref; - public $category; - public $new; - public $promo; - public $min_price; - public $max_price; - public $min_stock; - public $min_weight; - public $max_weight; - public $current; - public $current_category; - public $depth; - public $visible; - public $order; - public $random; - public $exclude; - /** * @return ArgumentCollection */ @@ -115,19 +97,27 @@ class Product extends BaseLoop { $search = ProductQuery::create(); - if (!is_null($this->id)) { - $search->filterById($this->id, Criteria::IN); + $id = $this->getArgValue('id'); + + if (!is_null($id)) { + $search->filterById($id, Criteria::IN); } - if (!is_null($this->ref)) { - $search->filterByRef($this->ref, Criteria::IN); + $ref = $this->getArgValue('ref'); + + if (!is_null($ref)) { + $search->filterByRef($ref, Criteria::IN); } - if (!is_null($this->category)) { - $categories = CategoryQuery::create()->filterById($this->category, Criteria::IN)->find(); + $category = $this->getArgValue('category'); - if(null !== $this->depth) { - foreach(CategoryQuery::findAllChild($this->category, $this->depth) as $subCategory) { + if (!is_null($category)) { + $categories = CategoryQuery::create()->filterById($category, Criteria::IN)->find(); + + $depth = $this->getArgValue('depth'); + + if(null !== $depth) { + foreach(CategoryQuery::findAllChild($category, $depth) as $subCategory) { $categories->prepend($subCategory); } } @@ -138,57 +128,75 @@ class Product extends BaseLoop ); } - if ($this->new === true) { + $new = $this->getArgValue('new'); + + if ($new === true) { $search->filterByNewness(1, Criteria::EQUAL); - } else if($this->new === false) { + } else if($new === false) { $search->filterByNewness(0, Criteria::EQUAL); } - if ($this->promo === true) { + $promo = $this->getArgValue('promo'); + + if ($promo === true) { $search->filterByPromo(1, Criteria::EQUAL); - } else if($this->promo === false) { + } else if($promo === false) { $search->filterByNewness(0, Criteria::EQUAL); } - if (null != $this->min_stock) { - $search->filterByQuantity($this->min_stock, Criteria::GREATER_EQUAL); + $min_stock = $this->getArgValue('min_stock'); + + if (null != $min_stock) { + $search->filterByQuantity($min_stock, Criteria::GREATER_EQUAL); } - if(null !== $this->min_price) { + $min_price = $this->getArgValue('min_price'); + + if(null !== $min_price) { $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1') ->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_EQUAL . '1') - ->condition('min_price2', ProductPeer::PRICE2 . Criteria::GREATER_EQUAL . '?', $this->min_price) - ->condition('min_price', ProductPeer::PRICE . Criteria::GREATER_EQUAL . '?', $this->min_price) + ->condition('min_price2', ProductPeer::PRICE2 . Criteria::GREATER_EQUAL . '?', $min_price) + ->condition('min_price', ProductPeer::PRICE . Criteria::GREATER_EQUAL . '?', $min_price) ->combine(array('in_promo', 'min_price2'), Criteria::LOGICAL_AND, 'in_promo_min_price') ->combine(array('not_in_promo', 'min_price'), Criteria::LOGICAL_AND, 'not_in_promo_min_price') ->where(array('not_in_promo_min_price', 'in_promo_min_price'), Criteria::LOGICAL_OR); } - if(null !== $this->max_price) { + $max_price = $this->getArgValue('max_price'); + + if(null !== $max_price) { $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1') ->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_EQUAL . '1') - ->condition('max_price2', ProductPeer::PRICE2 . Criteria::LESS_EQUAL . '?', $this->max_price) - ->condition('max_price', ProductPeer::PRICE . Criteria::LESS_EQUAL . '?', $this->max_price) + ->condition('max_price2', ProductPeer::PRICE2 . Criteria::LESS_EQUAL . '?', $max_price) + ->condition('max_price', ProductPeer::PRICE . Criteria::LESS_EQUAL . '?', $max_price) ->combine(array('in_promo', 'max_price2'), Criteria::LOGICAL_AND, 'in_promo_max_price') ->combine(array('not_in_promo', 'max_price'), Criteria::LOGICAL_AND, 'not_in_promo_max_price') ->where(array('not_in_promo_max_price', 'in_promo_max_price'), Criteria::LOGICAL_OR); } - if(null !== $this->min_weight) { - $search->filterByWeight($this->min_weight, Criteria::GREATER_EQUAL); + $min_weight = $this->getArgValue('min_weight'); + + if(null !== $min_weight) { + $search->filterByWeight($min_weight, Criteria::GREATER_EQUAL); } - if(null !== $this->max_weight) { - $search->filterByWeight($this->max_weight, Criteria::LESS_EQUAL); + $max_weight = $this->getArgValue('max_weight'); + + if(null !== $max_weight) { + $search->filterByWeight($max_weight, Criteria::LESS_EQUAL); } - if ($this->current === true) { + $current = $this->getArgValue('current'); + + if ($current === true) { $search->filterById($this->request->get("product_id")); - } elseif($this->current === false) { + } elseif($current === false) { $search->filterById($this->request->get("product_id"), Criteria::NOT_IN); } - if ($this->current_category === true) { + $current_category = $this->getArgValue('current_category'); + + if ($current_category === true) { $search->filterByCategory( CategoryQuery::create()->filterByProduct( ProductCategoryQuery::create()->filterByProductId( @@ -199,7 +207,7 @@ class Product extends BaseLoop )->find(), Criteria::IN ); - } elseif($this->current_category === false) { + } elseif($current_category === false) { $search->filterByCategory( CategoryQuery::create()->filterByProduct( ProductCategoryQuery::create()->filterByProductId( @@ -212,9 +220,9 @@ class Product extends BaseLoop ); } - $search->filterByVisible($this->visible); + $search->filterByVisible($this->getArgValue('visible')); - switch ($this->order) { + switch ($this->getArgValue('order')) { case "alpha": $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); break; @@ -254,13 +262,15 @@ class Product extends BaseLoop break; } - if ($this->random === true) { + if ($this->getArgValue('random') === true) { $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); } - if (!is_null($this->exclude)) { - $search->filterById($this->exclude, Criteria::NOT_IN); + $exclude = $this->getArgValue('exclude'); + + if (!is_null($exclude)) { + $search->filterById($exclude, Criteria::NOT_IN); } /** @@ -270,7 +280,7 @@ class Product extends BaseLoop */ $search->joinWithI18n( - $this->request->getSession()->get('locale', 'en_US'), + $this->request->getSession()->getLocale(), (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN ); diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php index 86a29da6d..8af1e0884 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php @@ -35,7 +35,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; class TheliaLoop implements SmartyPluginInterface { - protected static $pagination = null; + protected $pagination = null; protected $loopDefinition = array(); @@ -43,8 +43,9 @@ class TheliaLoop implements SmartyPluginInterface protected $dispatcher; - protected $loopstack = array(); protected $varstack = array(); + protected $loopstack = array(); + public function __construct(Request $request, EventDispatcherInterface $dispatcher) { @@ -57,13 +58,13 @@ class TheliaLoop implements SmartyPluginInterface * * @return \PropelModelPager */ - public static function getPagination($loopId) + protected function getPagination($loopId) { - if(!empty(self::$pagination[$loopId])) { - return self::$pagination[$loopId]; - } else { - return null; - } + if(!empty($this->pagination[$loopId])) { + return $this->pagination[$loopId]; + } else { + return null; + } } /** @@ -92,13 +93,12 @@ class TheliaLoop implements SmartyPluginInterface throw new \InvalidArgumentException("A loop named '$name' already exists in the current scope."); } - $loop = $this->createLoopInstance(strtolower($params['type'])); + $loop = $this->createLoopInstance($params); - $this->getLoopArgument($loop, $params); + $this->pagination[$name] = null; - self::$pagination[$name] = null; + $loopResults = $loop->exec($this->pagination[$name]); - $loopResults = $loop->exec(self::$pagination[$name]); $this->loopstack[$name] = $loopResults; } else { @@ -130,12 +130,12 @@ class TheliaLoop implements SmartyPluginInterface $template->assign($var, $val); } - $repeat = true; - } + // Assign meta information + $template->assign('LOOP_COUNT', 1 + $loopResults->key()); + $template->assign('LOOP_TOTAL', $loopResults->getCount()); - // Assign meta information - $template->assign('LOOP_COUNT', 1 + $loopResults->key()); - $template->assign('LOOP_TOTAL', $loopResults->getCount()); + $repeat = $loopResults->valid(); + } // Loop is terminated. Cleanup. if (! $repeat) { @@ -187,6 +187,7 @@ class TheliaLoop implements SmartyPluginInterface */ public function theliaIfLoop($params, $content, $template, &$repeat) { + // When encountering close tag, check if loop has results. if ($repeat === false) { return $this->checkEmptyLoop($params, $template) ? '' : $content; @@ -206,41 +207,43 @@ class TheliaLoop implements SmartyPluginInterface */ public function theliaPageLoop($params, $content, $template, &$repeat) { - if (empty($params['rel'])) - throw new \InvalidArgumentException("Missing 'rel' parameter in page loop"); + if (empty($params['rel'])) + throw new \InvalidArgumentException("Missing 'rel' parameter in page loop"); - $loopName = $params['rel']; + $loopName = $params['rel']; - // Find loop results in the current template vars - /* $loopResults = $template->getTemplateVars($loopName); - if (empty($loopResults)) { - throw new \InvalidArgumentException("Loop $loopName is not defined."); - }*/ + // Find loop results in the current template vars + if (! isset($this->loopstack[$loopName])) { + throw new \InvalidArgumentException("Loop $loopName is not defined."); + } - // Find pagination - $pagination = self::getPagination($loopName); - if ($pagination === null) { - throw new \InvalidArgumentException("Loop $loopName : no pagination found."); - } + $loopResults = $this->loopstack[$loopName]; - if ($content === null) { - $page = 1; - } else { - $page = $template->getTemplateVars('PAGE'); - $page++; - } + // Find pagination + $pagination = $this->getPagination($loopName); - if ($page <= $pagination->getLastPage()) { - $template->assign('PAGE', $page); - $template->assign('CURRENT', $pagination->getPage()); - $template->assign('LAST', $pagination->getLastPage()); + if ($pagination === null) { + throw new \InvalidArgumentException("Loop $loopName : no pagination found."); + } - $repeat = true; - } + if ($content === null) { + $page = 1; + } else { + $page = $template->getTemplateVars('PAGE'); + $page++; + } - if ($content !== null) { - return $content; - } + if ($page <= $pagination->getLastPage()) { + $template->assign('PAGE', $page); + $template->assign('CURRENT', $pagination->getPage()); + $template->assign('LAST', $pagination->getLastPage()); + + $repeat = true; + } + + if ($content !== null) { + return $content; + } } /** @@ -272,27 +275,33 @@ class TheliaLoop implements SmartyPluginInterface * * @param string $name * @return \Thelia\Core\Template\Element\BaseLoop - * @throws InvalidElementException - * @throws ElementNotFoundException + * @throws \Thelia\Tpex\Exception\InvalidElementException + * @throws \Thelia\Tpex\Exception\ElementNotFoundException */ - protected function createLoopInstance($name) + protected function createLoopInstance($smartyParams) { - if (! isset($this->loopDefinition[$name])) { - throw new ElementNotFoundException(sprintf("%s loop does not exists", $name)); + $type = strtolower($smartyParams['type']); + + if (! isset($this->loopDefinition[$type])) { + throw new ElementNotFoundException(sprintf("%s loop does not exists", $type)); } - $class = new \ReflectionClass($this->loopDefinition[$name]); + $class = new \ReflectionClass($this->loopDefinition[$type]); if ($class->isSubclassOf("Thelia\Core\Template\Element\BaseLoop") === false) { throw new InvalidElementException(sprintf("%s Loop class have to extends Thelia\Core\Template\Element\BaseLoop", - $name)); + $type)); } - return $class->newInstance( + $loop = $class->newInstance( $this->request, $this->dispatcher ); + + $loop->initializeArgs($smartyParams); + + return $loop; } /** @@ -304,10 +313,11 @@ class TheliaLoop implements SmartyPluginInterface */ protected function getLoopArgument(BaseLoop $loop, $smartyParam) { - $faultActor = array(); - $faultDetails = array(); + $faultActor = array(); + $faultDetails = array(); $argumentsCollection = $loop->getArgs(); + foreach( $argumentsCollection as $argument ) { $value = isset($smartyParam[$argument->name]) ? (string)$smartyParam[$argument->name] : null; @@ -364,7 +374,7 @@ class TheliaLoop implements SmartyPluginInterface * "myLoop" => "My\Own\Loop" * ); * - * @param array $loopDefinition + * @param array $loops * @throws \InvalidArgumentException if loop name already exists */ public function setLoopList(array $loopDefinition) diff --git a/core/lib/Thelia/Form/AdminLogin.php b/core/lib/Thelia/Form/AdminLogin.php index 71e18d3c3..37efd05e7 100644 --- a/core/lib/Thelia/Form/AdminLogin.php +++ b/core/lib/Thelia/Form/AdminLogin.php @@ -52,4 +52,4 @@ class AdminLogin extends BaseForm { return "admin_login"; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Model/Admin.php b/core/lib/Thelia/Model/Admin.php index d5b0dbf46..6d3627294 100644 --- a/core/lib/Thelia/Model/Admin.php +++ b/core/lib/Thelia/Model/Admin.php @@ -2,8 +2,40 @@ namespace Thelia\Model; +use Thelia\Core\Security\User\UserInterface; use Thelia\Model\Base\Admin as BaseAdmin; -class Admin extends BaseAdmin { +/** + * Skeleton subclass for representing a row from the 'admin' table. + * + * + * + * You should add additional methods to this class to meet the + * application requirements. This class will only be generated as + * long as it does not already exist in the output directory. + * + * @package propel.generator.Thelia.Model + */ +class Admin extends BaseAdmin implements UserInterface +{ + /** + * {@inheritDoc} + */ + public function getUsername() { + return $this->getLogin(); + } + /** + * {@inheritDoc} + */ + public function eraseCredentials() { + $this->setPassword(null); + } + + /** + * {@inheritDoc} + */ + public function getRoles() { + return array(new Role('USER_ADMIN')); + } } diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index 8b894140c..b9adade3f 100644 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -6,11 +6,26 @@ use Thelia\Model\Base\Customer as BaseCustomer; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; + use Thelia\Core\Event\CustomRefEvent; use Thelia\Core\Event\TheliaEvents; +use Thelia\Core\Security\User\UserInterface; + use Propel\Runtime\Connection\ConnectionInterface; -class Customer extends BaseCustomer { +/** + * Skeleton subclass for representing a row from the 'customer' table. + * + * + * + * You should add additional methods to this class to meet the + * application requirements. This class will only be generated as + * long as it does not already exist in the output directory. + * + * @package propel.generator.Thelia.Model + */ +class Customer extends BaseCustomer implements UserInterface +{ /** * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ @@ -97,4 +112,26 @@ class Customer extends BaseCustomer { { $this->dispatcher = $dispatcher; } + + /** + * {@inheritDoc} + */ + + public function getUsername() { + return $this->getEmail(); + } + + /** + * {@inheritDoc} + */ + public function eraseCredentials() { + $this->setPassword(null); + } + + /** + * {@inheritDoc} + */ + public function getRoles() { + return array(new Role('USER_CUSTOMER')); + } } diff --git a/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php index 02a20540e..14fc79eeb 100644 --- a/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php @@ -151,7 +151,7 @@ class AttributeAvI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute_av', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/AttributeAvTableMap.php b/core/lib/Thelia/Model/Map/AttributeAvTableMap.php index 0c5c2e1c9..138f0fa9c 100644 --- a/core/lib/Thelia/Model/Map/AttributeAvTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeAvTableMap.php @@ -106,7 +106,7 @@ class AttributeAvTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php b/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php index 8471d3e26..b60cae5b8 100644 --- a/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeI18nTableMap.php @@ -151,7 +151,7 @@ class AttributeI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/AttributeTableMap.php b/core/lib/Thelia/Model/Map/AttributeTableMap.php index 773e13cab..dca811cbc 100644 --- a/core/lib/Thelia/Model/Map/AttributeTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeTableMap.php @@ -101,7 +101,7 @@ class AttributeTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php b/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php index 8c52aa7b2..1611b2ebf 100644 --- a/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryI18nTableMap.php @@ -151,7 +151,7 @@ class CategoryI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CategoryTableMap.php b/core/lib/Thelia/Model/Map/CategoryTableMap.php index a301a5efe..83010e4fa 100644 --- a/core/lib/Thelia/Model/Map/CategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/CategoryTableMap.php @@ -131,7 +131,7 @@ class CategoryTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php b/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php index b953b0ac9..a83f87b76 100644 --- a/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ConfigI18nTableMap.php @@ -151,7 +151,7 @@ class ConfigI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'config', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ConfigTableMap.php b/core/lib/Thelia/Model/Map/ConfigTableMap.php index ebd5d6edf..8bd68a964 100644 --- a/core/lib/Thelia/Model/Map/ConfigTableMap.php +++ b/core/lib/Thelia/Model/Map/ConfigTableMap.php @@ -116,7 +116,7 @@ class ConfigTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ContentI18nTableMap.php b/core/lib/Thelia/Model/Map/ContentI18nTableMap.php index f718623b0..ee9122a6c 100644 --- a/core/lib/Thelia/Model/Map/ContentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentI18nTableMap.php @@ -151,7 +151,7 @@ class ContentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ContentTableMap.php b/core/lib/Thelia/Model/Map/ContentTableMap.php index b794c7244..60b04ae36 100644 --- a/core/lib/Thelia/Model/Map/ContentTableMap.php +++ b/core/lib/Thelia/Model/Map/ContentTableMap.php @@ -121,7 +121,7 @@ class ContentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CountryI18nTableMap.php b/core/lib/Thelia/Model/Map/CountryI18nTableMap.php index 272231464..cc60b09d2 100644 --- a/core/lib/Thelia/Model/Map/CountryI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CountryI18nTableMap.php @@ -151,7 +151,7 @@ class CountryI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'country', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/CountryTableMap.php b/core/lib/Thelia/Model/Map/CountryTableMap.php index 3060da70f..c4b96c8bd 100644 --- a/core/lib/Thelia/Model/Map/CountryTableMap.php +++ b/core/lib/Thelia/Model/Map/CountryTableMap.php @@ -116,7 +116,7 @@ class CountryTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php index 5344099c5..d403756fa 100644 --- a/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTitleI18nTableMap.php @@ -141,7 +141,7 @@ class CustomerTitleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'customer_title', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('SHORT', 'Short', 'VARCHAR', false, 10, null); $this->addColumn('LONG', 'Long', 'VARCHAR', false, 45, null); } // initialize() diff --git a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php index 8e91631cf..a392ee4dd 100644 --- a/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php +++ b/core/lib/Thelia/Model/Map/CustomerTitleTableMap.php @@ -106,7 +106,7 @@ class CustomerTitleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php b/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php index 70314ea02..d0356e8c6 100644 --- a/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/DocumentI18nTableMap.php @@ -151,7 +151,7 @@ class DocumentI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'document', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/DocumentTableMap.php b/core/lib/Thelia/Model/Map/DocumentTableMap.php index d53263a06..50bb37b95 100644 --- a/core/lib/Thelia/Model/Map/DocumentTableMap.php +++ b/core/lib/Thelia/Model/Map/DocumentTableMap.php @@ -126,7 +126,7 @@ class DocumentTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php index ba592b4b0..b3114e7ba 100644 --- a/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php @@ -151,7 +151,7 @@ class FeatureAvI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature_av', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php index 972a25744..f447f8dc5 100644 --- a/core/lib/Thelia/Model/Map/FeatureAvTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureAvTableMap.php @@ -101,7 +101,7 @@ class FeatureAvTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php b/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php index dba05fb67..af0dfc263 100644 --- a/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureI18nTableMap.php @@ -151,7 +151,7 @@ class FeatureI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FeatureTableMap.php b/core/lib/Thelia/Model/Map/FeatureTableMap.php index b1f309603..8d851559e 100644 --- a/core/lib/Thelia/Model/Map/FeatureTableMap.php +++ b/core/lib/Thelia/Model/Map/FeatureTableMap.php @@ -106,7 +106,7 @@ class FeatureTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/FolderI18nTableMap.php b/core/lib/Thelia/Model/Map/FolderI18nTableMap.php index d10344811..fc85b17ec 100644 --- a/core/lib/Thelia/Model/Map/FolderI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderI18nTableMap.php @@ -151,7 +151,7 @@ class FolderI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/FolderTableMap.php b/core/lib/Thelia/Model/Map/FolderTableMap.php index c26e23dc8..794e3691c 100644 --- a/core/lib/Thelia/Model/Map/FolderTableMap.php +++ b/core/lib/Thelia/Model/Map/FolderTableMap.php @@ -131,7 +131,7 @@ class FolderTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/GroupI18nTableMap.php b/core/lib/Thelia/Model/Map/GroupI18nTableMap.php index 57788593a..585127821 100644 --- a/core/lib/Thelia/Model/Map/GroupI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/GroupI18nTableMap.php @@ -151,7 +151,7 @@ class GroupI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'group', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/GroupTableMap.php b/core/lib/Thelia/Model/Map/GroupTableMap.php index 881a2fa84..a8c830005 100644 --- a/core/lib/Thelia/Model/Map/GroupTableMap.php +++ b/core/lib/Thelia/Model/Map/GroupTableMap.php @@ -101,7 +101,7 @@ class GroupTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ImageI18nTableMap.php index a78e7667c..4f3b197a6 100644 --- a/core/lib/Thelia/Model/Map/ImageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ImageI18nTableMap.php @@ -151,7 +151,7 @@ class ImageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'image', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ImageTableMap.php b/core/lib/Thelia/Model/Map/ImageTableMap.php index c49f24527..0f8d82b20 100644 --- a/core/lib/Thelia/Model/Map/ImageTableMap.php +++ b/core/lib/Thelia/Model/Map/ImageTableMap.php @@ -126,7 +126,7 @@ class ImageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/MessageI18nTableMap.php b/core/lib/Thelia/Model/Map/MessageI18nTableMap.php index bb9bfdd2e..f084515c0 100644 --- a/core/lib/Thelia/Model/Map/MessageI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/MessageI18nTableMap.php @@ -146,7 +146,7 @@ class MessageI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'message', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'LONGVARCHAR', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION_HTML', 'DescriptionHtml', 'CLOB', false, null, null); diff --git a/core/lib/Thelia/Model/Map/MessageTableMap.php b/core/lib/Thelia/Model/Map/MessageTableMap.php index 392dac824..de2a205f9 100644 --- a/core/lib/Thelia/Model/Map/MessageTableMap.php +++ b/core/lib/Thelia/Model/Map/MessageTableMap.php @@ -126,7 +126,7 @@ class MessageTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php b/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php index a8e680f1c..67b7a34ef 100644 --- a/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ModuleI18nTableMap.php @@ -151,7 +151,7 @@ class ModuleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php index cccaa890a..5370c1da1 100644 --- a/core/lib/Thelia/Model/Map/ModuleTableMap.php +++ b/core/lib/Thelia/Model/Map/ModuleTableMap.php @@ -116,7 +116,7 @@ class ModuleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php index 1b2052c2e..5d78c474c 100644 --- a/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php @@ -151,7 +151,7 @@ class OrderStatusI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order_status', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php index 18406d9aa..eecfe5a03 100644 --- a/core/lib/Thelia/Model/Map/OrderStatusTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderStatusTableMap.php @@ -101,7 +101,7 @@ class OrderStatusTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ProductI18nTableMap.php b/core/lib/Thelia/Model/Map/ProductI18nTableMap.php index 79a01514a..8da33f15d 100644 --- a/core/lib/Thelia/Model/Map/ProductI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductI18nTableMap.php @@ -151,7 +151,7 @@ class ProductI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ProductTableMap.php b/core/lib/Thelia/Model/Map/ProductTableMap.php index 40200ce10..b009a97af 100644 --- a/core/lib/Thelia/Model/Map/ProductTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductTableMap.php @@ -166,7 +166,7 @@ class ProductTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php b/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php index ec22e2fd3..8a8ce501a 100644 --- a/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ResourceI18nTableMap.php @@ -151,7 +151,7 @@ class ResourceI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'resource', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); diff --git a/core/lib/Thelia/Model/Map/ResourceTableMap.php b/core/lib/Thelia/Model/Map/ResourceTableMap.php index 8d7708ddd..e56960892 100644 --- a/core/lib/Thelia/Model/Map/ResourceTableMap.php +++ b/core/lib/Thelia/Model/Map/ResourceTableMap.php @@ -101,7 +101,7 @@ class ResourceTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php index a06230c37..2c4c92f4f 100644 --- a/core/lib/Thelia/Model/Map/TaxI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxI18nTableMap.php @@ -141,7 +141,7 @@ class TaxI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null); } // initialize() diff --git a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php index 1f0ed1e96..689f30728 100644 --- a/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php @@ -131,7 +131,7 @@ class TaxRuleI18nTableMap extends TableMap $this->setUseIdGenerator(false); // columns $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax_rule', 'ID', true, null, null); - $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); + $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN'); } // initialize() /** diff --git a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php index cc5f628b9..9b862de99 100644 --- a/core/lib/Thelia/Model/Map/TaxRuleTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxRuleTableMap.php @@ -111,7 +111,7 @@ class TaxRuleTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Model/Map/TaxTableMap.php b/core/lib/Thelia/Model/Map/TaxTableMap.php index 6d43f20e9..b941e7b52 100644 --- a/core/lib/Thelia/Model/Map/TaxTableMap.php +++ b/core/lib/Thelia/Model/Map/TaxTableMap.php @@ -101,7 +101,7 @@ class TaxTableMap extends TableMap * * @var string */ - const DEFAULT_LOCALE = 'en_US'; + const DEFAULT_LOCALE = 'en_EN'; /** * holds an array of fieldnames diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php index b7556c10c..21d1f132b 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php @@ -35,7 +35,7 @@ use Thelia\Type\TypeCollection; */ class ArgumentTest extends \PHPUnit_Framework_TestCase { - public function testArgumentCollectionConstruction() + public function testArgumentCollectionCreateAndWalk() { $collection = new ArgumentCollection( new Argument( @@ -61,30 +61,19 @@ class ArgumentTest extends \PHPUnit_Framework_TestCase ) ); - $this->assertAttributeEquals( - array( - 0 => new Argument( - 'arg0', - new TypeCollection( - new Type\AnyType() - ) - ), - 1 => new Argument( - 'arg1', - new TypeCollection( - new Type\AnyType() - ) - ), - 2 => new Argument( - 'arg2', - new TypeCollection( - new Type\AnyType() - ) - ), - ), - 'arguments', - $collection - ); + $this->assertTrue($collection->getCount() == 3); + + $this->assertTrue($collection->key() == 'arg0'); + $collection->next(); + $this->assertTrue($collection->key() == 'arg1'); + $collection->next(); + $this->assertTrue($collection->key() == 'arg2'); + $collection->next(); + + $this->assertFalse($collection->valid()); + + $collection->rewind(); + $this->assertTrue($collection->key() == 'arg0'); } public function testArgumentCollectionFetch() diff --git a/templates/admin/default/assets/css/admin.less b/templates/admin/default/assets/css/admin.less index a4ff763cd..fb3b8f8b7 100755 --- a/templates/admin/default/assets/css/admin.less +++ b/templates/admin/default/assets/css/admin.less @@ -56,16 +56,64 @@ a { // Bootstrap Adjustements ------------------------------------------------------ -.btn-primary, .row h3 .btn-large, .row-fluid h3 .btn-large, .row-fluid h4 .btn-large { - background: -moz-linear-gradient(center bottom , #E3530B 0%, #F39922 100%) repeat scroll 0 0 #E9730F; - box-shadow: 0 0 2px rgba(250, 250, 250, 0.5) inset, 0 1px 3px rgba(0, 0, 0, 0.2); - color: white; +hr { + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid rgba(250, 250, 250, 0.1); + width: 90%; + margin: 0 auto; + clear: both; + margin-top: 20px; +} + +.btn-primary, .btn-large { + background: #e9730f; + background-image: linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -o-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -moz-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -webkit-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -ms-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -webkit-gradient( + linear, + left bottom, + left top, + color-stop(0, rgb(227,83,11)), + color-stop(1, rgb(243,153,34)) + ); + box-shadow: inset 0px 0px 2px rgba(250,250,250,0.5), 0px 1px 3px rgba(0,0,0,0.2); + color: white; +} + +.btn-large:hover, .btn-primary:hover { + background: #e9730f; + background-image: linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -o-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -moz-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -webkit-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -ms-linear-gradient(bottom, rgb(227,83,11) 0%, rgb(243,153,34) 100%); + background-image: -webkit-gradient( + linear, + left bottom, + left top, + color-stop(0, rgb(227,83,11)), + color-stop(1, rgb(243,153,34)) + ); + box-shadow: inset 0px 0px 2px rgba(250,250,250,0.8), 0px 1px 3px rgba(0,0,0,0.2); + color: white; +} + +.modal-footer { + background: none repeat scroll 0 0 transparent; + border: medium none; + box-shadow: none; + color: #7D756A; + margin-bottom: 0; + padding: 35px 15px 15px; + text-align: left; } // -- Brandbar ---------------------------------------------------------------- -/* --- BRAND BAR ---*/ - .loginpage { .brandbar { width: 100%; @@ -73,6 +121,10 @@ a { .hero-unit { background-color: transparent !important; + + h1 { + margin-bottom: 25px; + } } .well { @@ -146,7 +198,33 @@ a { } } +// -- Feed list on home page -------------------------------------------------- +.feed-list { + h2 { + font-size: 24px; + line-height: 120%; + color: #E9730F; + + a { + &:hover { + color: inherit; + text-decoration: none; + } + } + } + + h3 { + margin-bottom: 0; + padding-bottom: 0; + font-size: 90%; + line-height: 100%; + } + + .feed-list-item{ + padding: 10px 20px; + } +} // -- Login form -------------------------------------------------------------- .form-signin { diff --git a/templates/admin/default/includes/footer.inc.html b/templates/admin/default/includes/footer.inc.html index 3d0e58427..5fd1a6b8f 100755 --- a/templates/admin/default/includes/footer.inc.html +++ b/templates/admin/default/includes/footer.inc.html @@ -1,4 +1,16 @@ - {* Include required JS files *} +
+ + + {* Include required JS files *} {javascripts file='../assets/js/jquery.min.js'} diff --git a/templates/admin/default/includes/header.inc.html b/templates/admin/default/includes/header.inc.html index 64cf0605c..712a0a600 100755 --- a/templates/admin/default/includes/header.inc.html +++ b/templates/admin/default/includes/header.inc.html @@ -7,10 +7,6 @@ - {stylesheets file='../assets/css/*' filters='less,cssembed'} - - {/stylesheets} - {stylesheets file='../assets/bootstrap/css/bootstrap.css' filters='cssembed'} {/stylesheets} @@ -19,6 +15,10 @@ {/stylesheets} + {stylesheets file='../assets/css/*' filters='less,cssembed'} + + {/stylesheets} + {* TODO allow modules to include CSS here *} \ No newline at end of file diff --git a/templates/admin/default/login.html b/templates/admin/default/login.html index 20fadb19b..9c64612ac 100755 --- a/templates/admin/default/login.html +++ b/templates/admin/default/login.html @@ -1,16 +1,14 @@ -{$page_title={intl l='Thelia'}} +{$page_title={intl l='Welcome'}} {include file='includes/header.inc.html'}
- {{intl l='abcd'}|capitalize}
- {* - {thelia_module action='index_top'} - *} + + {module_include location='index_top'}

{intl l='Thelia Back Office'}

@@ -31,34 +29,26 @@ {/form_field} - +
-
+ {module_include location='index_middle'} -
- -
-

We DO display loops in back-office !

-
    - {loop type="category" name="catloop1"} -
  • {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}, children: {$NB_CHILD} - {ifloop rel="inner1"} -
      - {loop type="category" name="inner1" parent="{$ID}"} -
    • Sub cat {$ID} (parent is {$PARENT}): {$TITLE}
    • - {/loop} -
    - {/ifloop} -
  • - {/loop} -
+
+ {loop type="feed" name="thelia_feeds" url="http://thelia.net/Flux-rss.html?id_rubrique=8" limit="3"} +
+

{$DATE}

+

{$TITLE|strip_tags}

+

{$DESCRIPTION|strip_tags|truncate:250:"...":true}

+

{intl l='Lire la suite »'}

+
+ {/loop}
- {* - {thelia_module action='index_bottom'} - *} + + {module_include location='index_bottom'} +
{include file='includes/footer.inc.html'} \ No newline at end of file diff --git a/web/.htaccess b/web/.htaccess deleted file mode 100755 index 57b1cf491..000000000 --- a/web/.htaccess +++ /dev/null @@ -1,12 +0,0 @@ -Options +FollowSymlinks -Indexes - -AddDefaultCharset UTF-8 - - - RewriteEngine on - - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - - RewriteRule ^(.*)$ index_dev.php [L,QSA] - \ No newline at end of file