Merge branch 'admin'

Conflicts:
	core/lib/Thelia/Admin/Controller/BaseAdminController.php
	core/lib/Thelia/Config/Resources/config.xml
	core/lib/Thelia/Core/Template/Element/BaseLoop.php
	core/lib/Thelia/Core/Template/Loop/Category.php
	core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php
	core/lib/Thelia/Model/Admin.php
	core/lib/Thelia/Model/Customer.php
This commit is contained in:
franck
2013-07-08 11:27:37 +02:00
62 changed files with 752 additions and 282 deletions

View File

@@ -31,7 +31,9 @@
"smarty/smarty": "v3.1.13", "smarty/smarty": "v3.1.13",
"kriswallsmith/assetic": "1.2.*@dev", "kriswallsmith/assetic": "1.2.*@dev",
"leafo/lessphp": "0.3.*@dev", "leafo/lessphp": "0.3.*@dev",
"ptachoire/cssembed": "dev-master" "ptachoire/cssembed": "dev-master",
"simplepie/simplepie": "dev-master"
}, },
"require-dev" : { "require-dev" : {
"fzaninotto/faker": "dev-master" "fzaninotto/faker": "dev-master"

View File

@@ -79,4 +79,14 @@ class BaseAdminController extends ContainerAware
return $parser; return $parser;
} }
}
public function getFormFactory()
{
return BaseForm::getFormFactory($this->getRequest(), ConfigQuery::read("form.secret.admin", md5(__DIR__)));
}
public function getFormBuilder()
{
return $this->getFormFactory()->createBuilder("form");
}
}

View File

@@ -7,6 +7,7 @@
<loops> <loops>
<loop class="Thelia\Core\Template\Loop\Category" name="category"/> <loop class="Thelia\Core\Template\Loop\Category" name="category"/>
<loop class="Thelia\Core\Template\Loop\Product" name="product"/> <loop class="Thelia\Core\Template\Loop\Product" name="product"/>
<loop class="Thelia\Core\Template\Loop\Feed" name="feed"/>
</loops> </loops>
@@ -113,4 +114,4 @@
<service id="kernel" synthetic="true" /> <service id="kernel" synthetic="true" />
</services> </services>
</config> </config>

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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 <fabien@symfony.com>
*/
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;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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 <fabien@symfony.com>
*/
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();
}

View File

@@ -30,6 +30,20 @@ interface UserInterface {
*/ */
public function getAlgo(); public function getAlgo();
/**
* Returns the roles granted to the user.
*
* <code>
* public function getRoles()
* {
* return array('ROLE_USER');
* }
* </code>
*
* @return Role[] The user roles
*/
public function getRoles();
/** /**
* Removes sensitive data from the user. * Removes sensitive data from the user.
* *

View File

@@ -38,16 +38,14 @@ abstract class BaseLoop
/** /**
* @var \Symfony\Component\HttpFoundation\Request * @var \Symfony\Component\HttpFoundation\Request
*/ */
public $request; protected $request;
/** /**
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/ */
public $dispatcher; protected $dispatcher;
public $limit; private $args;
public $page;
public $offset;
protected function getDefaultArgs() protected function getDefaultArgs()
{ {
@@ -59,6 +57,8 @@ abstract class BaseLoop
} }
/** /**
* Create a new Loop
*
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Symfony\Component\HttpFoundation\Request $request
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
*/ */
@@ -66,14 +66,94 @@ abstract class BaseLoop
{ {
$this->request = $request; $this->request = $request;
$this->dispatcher = $dispatcher; $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() public function initializeArgs(array $nameValuePairs) {
{
return $this->defineArgs()->addArguments($this->getDefaultArgs()); $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) public function search(ModelCriteria $search, &$pagination = null)
{ {
if($this->page !== null) { if($this->getArgValue('page') !== null) {
return $this->searchWithPagination($search, $pagination); return $this->searchWithPagination($search, $pagination);
} else { } else {
return $this->searchWithOffset($search); return $this->searchWithOffset($search);
@@ -98,10 +178,10 @@ abstract class BaseLoop
*/ */
public function searchWithOffset(ModelCriteria $search) public function searchWithOffset(ModelCriteria $search)
{ {
if($this->limit >= 0) { if($this->getArgValue('limit') >= 0) {
$search->limit($this->limit); $search->limit($this->getArgValue('limit'));
} }
$search->offset($this->offset); $search->offset($this->getArgValue('offset'));
return $search->find(); return $search->find();
} }
@@ -114,9 +194,9 @@ abstract class BaseLoop
*/ */
public function searchWithPagination(ModelCriteria $search, &$pagination) 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(); return array();
} else { } else {
return $pagination; return $pagination;
@@ -148,7 +228,8 @@ abstract class BaseLoop
* @param $pagination * @param $pagination
* *
* @return mixed * @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 * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
*/ */
abstract protected function defineArgs(); abstract protected function getArgDefinitions();
} }

View File

@@ -38,12 +38,25 @@ class Argument
public $mandatory; public $mandatory;
public $empty; 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->name = $name;
$this->type = $type; $this->type = $type;
$this->mandatory = $mandatory ? true : false; $this->mandatory = $mandatory ? true : false;
$this->default = $default; $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) public static function createAnyTypeArgument($name, $default=null, $mandatory=false, $empty=true)

View File

@@ -30,14 +30,21 @@ namespace Thelia\Core\Template\Loop\Argument;
class ArgumentCollection implements \Iterator class ArgumentCollection implements \Iterator
{ {
private $position; private $arguments = array();
protected $arguments = array();
public function __construct() public function __construct()
{ {
$this->addArguments(func_get_args()); $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() public function isEmpty()
{ {
return count($this->arguments) == 0; return count($this->arguments) == 0;
@@ -64,7 +71,8 @@ class ArgumentCollection implements \Iterator
*/ */
public function addArgument(Argument $argument) public function addArgument(Argument $argument)
{ {
$this->arguments[] = $argument; $this->arguments[$argument->name] = $argument;
return $this; return $this;
} }
@@ -81,7 +89,7 @@ class ArgumentCollection implements \Iterator
*/ */
public function current() public function current()
{ {
return $this->arguments[$this->position]; return current($this->arguments);
} }
/** /**
@@ -92,7 +100,7 @@ class ArgumentCollection implements \Iterator
*/ */
public function next() public function next()
{ {
$this->position++; next($this->arguments);
} }
/** /**
@@ -103,7 +111,7 @@ class ArgumentCollection implements \Iterator
*/ */
public function key() public function key()
{ {
return $this->position; return key($this->arguments);
} }
/** /**
@@ -115,7 +123,7 @@ class ArgumentCollection implements \Iterator
*/ */
public function valid() public function valid()
{ {
return isset($this->arguments[$this->position]); return $this->key() !== null;
} }
/** /**
@@ -126,6 +134,6 @@ class ArgumentCollection implements \Iterator
*/ */
public function rewind() public function rewind()
{ {
$this->position = 0; reset($this->arguments);
} }
} }

View File

@@ -68,20 +68,10 @@ use Thelia\Type;
*/ */
class Category extends BaseLoop 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 * @return ArgumentCollection
*/ */
protected function defineArgs() protected function getArgDefinitions()
{ {
return new ArgumentCollection( return new ArgumentCollection(
Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('id'),
@@ -110,31 +100,45 @@ class Category extends BaseLoop
{ {
$search = CategoryQuery::create(); $search = CategoryQuery::create();
if (!is_null($this->id)) { $id = $this->getArgValue('id');
$search->filterById($this->id, Criteria::IN);
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")); $search->filterById($this->request->get("category_id"));
} elseif ($this->current === false) { } elseif ($current === false) {
$search->filterById($this->request->get("category_id"), Criteria::NOT_IN); $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": case "alpha":
$search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE);
break; break;
@@ -149,7 +153,8 @@ class Category extends BaseLoop
break; break;
} }
if ($this->random === true) {
if ($this->getArgValue('random') === true) {
$search->clearOrderByColumns(); $search->clearOrderByColumns();
$search->addAscendingOrderByColumn('RAND()'); $search->addAscendingOrderByColumn('RAND()');
} }
@@ -161,7 +166,7 @@ class Category extends BaseLoop
*/ */
$search->joinWithI18n( $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 (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN
); );
@@ -189,5 +194,4 @@ class Category extends BaseLoop
return $loopResult; return $loopResult;
} }
}
}

View File

@@ -0,0 +1,115 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
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 <franck@cqfdev.fr>
*/
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;
}
}

View File

@@ -52,24 +52,6 @@ use Thelia\Type;
*/ */
class Product extends BaseLoop 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 * @return ArgumentCollection
*/ */
@@ -115,19 +97,27 @@ class Product extends BaseLoop
{ {
$search = ProductQuery::create(); $search = ProductQuery::create();
if (!is_null($this->id)) { $id = $this->getArgValue('id');
$search->filterById($this->id, Criteria::IN);
if (!is_null($id)) {
$search->filterById($id, Criteria::IN);
} }
if (!is_null($this->ref)) { $ref = $this->getArgValue('ref');
$search->filterByRef($this->ref, Criteria::IN);
if (!is_null($ref)) {
$search->filterByRef($ref, Criteria::IN);
} }
if (!is_null($this->category)) { $category = $this->getArgValue('category');
$categories = CategoryQuery::create()->filterById($this->category, Criteria::IN)->find();
if(null !== $this->depth) { if (!is_null($category)) {
foreach(CategoryQuery::findAllChild($this->category, $this->depth) as $subCategory) { $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); $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); $search->filterByNewness(1, Criteria::EQUAL);
} else if($this->new === false) { } else if($new === false) {
$search->filterByNewness(0, Criteria::EQUAL); $search->filterByNewness(0, Criteria::EQUAL);
} }
if ($this->promo === true) { $promo = $this->getArgValue('promo');
if ($promo === true) {
$search->filterByPromo(1, Criteria::EQUAL); $search->filterByPromo(1, Criteria::EQUAL);
} else if($this->promo === false) { } else if($promo === false) {
$search->filterByNewness(0, Criteria::EQUAL); $search->filterByNewness(0, Criteria::EQUAL);
} }
if (null != $this->min_stock) { $min_stock = $this->getArgValue('min_stock');
$search->filterByQuantity($this->min_stock, Criteria::GREATER_EQUAL);
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') $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1')
->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_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_price2', ProductPeer::PRICE2 . Criteria::GREATER_EQUAL . '?', $min_price)
->condition('min_price', ProductPeer::PRICE . Criteria::GREATER_EQUAL . '?', $this->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('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') ->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); ->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') $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1')
->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_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_price2', ProductPeer::PRICE2 . Criteria::LESS_EQUAL . '?', $max_price)
->condition('max_price', ProductPeer::PRICE . Criteria::LESS_EQUAL . '?', $this->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('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') ->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); ->where(array('not_in_promo_max_price', 'in_promo_max_price'), Criteria::LOGICAL_OR);
} }
if(null !== $this->min_weight) { $min_weight = $this->getArgValue('min_weight');
$search->filterByWeight($this->min_weight, Criteria::GREATER_EQUAL);
if(null !== $min_weight) {
$search->filterByWeight($min_weight, Criteria::GREATER_EQUAL);
} }
if(null !== $this->max_weight) { $max_weight = $this->getArgValue('max_weight');
$search->filterByWeight($this->max_weight, Criteria::LESS_EQUAL);
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")); $search->filterById($this->request->get("product_id"));
} elseif($this->current === false) { } elseif($current === false) {
$search->filterById($this->request->get("product_id"), Criteria::NOT_IN); $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( $search->filterByCategory(
CategoryQuery::create()->filterByProduct( CategoryQuery::create()->filterByProduct(
ProductCategoryQuery::create()->filterByProductId( ProductCategoryQuery::create()->filterByProductId(
@@ -199,7 +207,7 @@ class Product extends BaseLoop
)->find(), )->find(),
Criteria::IN Criteria::IN
); );
} elseif($this->current_category === false) { } elseif($current_category === false) {
$search->filterByCategory( $search->filterByCategory(
CategoryQuery::create()->filterByProduct( CategoryQuery::create()->filterByProduct(
ProductCategoryQuery::create()->filterByProductId( 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": case "alpha":
$search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE);
break; break;
@@ -254,13 +262,15 @@ class Product extends BaseLoop
break; break;
} }
if ($this->random === true) { if ($this->getArgValue('random') === true) {
$search->clearOrderByColumns(); $search->clearOrderByColumns();
$search->addAscendingOrderByColumn('RAND()'); $search->addAscendingOrderByColumn('RAND()');
} }
if (!is_null($this->exclude)) { $exclude = $this->getArgValue('exclude');
$search->filterById($this->exclude, Criteria::NOT_IN);
if (!is_null($exclude)) {
$search->filterById($exclude, Criteria::NOT_IN);
} }
/** /**
@@ -270,7 +280,7 @@ class Product extends BaseLoop
*/ */
$search->joinWithI18n( $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 (ConfigQuery::read("default_lang_without_translation", 1)) ? Criteria::LEFT_JOIN : Criteria::INNER_JOIN
); );

View File

@@ -35,7 +35,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class TheliaLoop implements SmartyPluginInterface class TheliaLoop implements SmartyPluginInterface
{ {
protected static $pagination = null; protected $pagination = null;
protected $loopDefinition = array(); protected $loopDefinition = array();
@@ -43,8 +43,9 @@ class TheliaLoop implements SmartyPluginInterface
protected $dispatcher; protected $dispatcher;
protected $loopstack = array();
protected $varstack = array(); protected $varstack = array();
protected $loopstack = array();
public function __construct(Request $request, EventDispatcherInterface $dispatcher) public function __construct(Request $request, EventDispatcherInterface $dispatcher)
{ {
@@ -57,13 +58,13 @@ class TheliaLoop implements SmartyPluginInterface
* *
* @return \PropelModelPager * @return \PropelModelPager
*/ */
public static function getPagination($loopId) protected function getPagination($loopId)
{ {
if(!empty(self::$pagination[$loopId])) { if(!empty($this->pagination[$loopId])) {
return self::$pagination[$loopId]; return $this->pagination[$loopId];
} else { } else {
return null; return null;
} }
} }
/** /**
@@ -92,13 +93,12 @@ class TheliaLoop implements SmartyPluginInterface
throw new \InvalidArgumentException("A loop named '$name' already exists in the current scope."); 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; $this->loopstack[$name] = $loopResults;
} else { } else {
@@ -130,12 +130,12 @@ class TheliaLoop implements SmartyPluginInterface
$template->assign($var, $val); $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 $repeat = $loopResults->valid();
$template->assign('LOOP_COUNT', 1 + $loopResults->key()); }
$template->assign('LOOP_TOTAL', $loopResults->getCount());
// Loop is terminated. Cleanup. // Loop is terminated. Cleanup.
if (! $repeat) { if (! $repeat) {
@@ -187,6 +187,7 @@ class TheliaLoop implements SmartyPluginInterface
*/ */
public function theliaIfLoop($params, $content, $template, &$repeat) public function theliaIfLoop($params, $content, $template, &$repeat)
{ {
// When encountering close tag, check if loop has results. // When encountering close tag, check if loop has results.
if ($repeat === false) { if ($repeat === false) {
return $this->checkEmptyLoop($params, $template) ? '' : $content; return $this->checkEmptyLoop($params, $template) ? '' : $content;
@@ -206,41 +207,43 @@ class TheliaLoop implements SmartyPluginInterface
*/ */
public function theliaPageLoop($params, $content, $template, &$repeat) public function theliaPageLoop($params, $content, $template, &$repeat)
{ {
if (empty($params['rel'])) if (empty($params['rel']))
throw new \InvalidArgumentException("Missing 'rel' parameter in page loop"); throw new \InvalidArgumentException("Missing 'rel' parameter in page loop");
$loopName = $params['rel']; $loopName = $params['rel'];
// Find loop results in the current template vars // Find loop results in the current template vars
/* $loopResults = $template->getTemplateVars($loopName); if (! isset($this->loopstack[$loopName])) {
if (empty($loopResults)) { throw new \InvalidArgumentException("Loop $loopName is not defined.");
throw new \InvalidArgumentException("Loop $loopName is not defined."); }
}*/
// Find pagination $loopResults = $this->loopstack[$loopName];
$pagination = self::getPagination($loopName);
if ($pagination === null) {
throw new \InvalidArgumentException("Loop $loopName : no pagination found.");
}
if ($content === null) { // Find pagination
$page = 1; $pagination = $this->getPagination($loopName);
} else {
$page = $template->getTemplateVars('PAGE');
$page++;
}
if ($page <= $pagination->getLastPage()) { if ($pagination === null) {
$template->assign('PAGE', $page); throw new \InvalidArgumentException("Loop $loopName : no pagination found.");
$template->assign('CURRENT', $pagination->getPage()); }
$template->assign('LAST', $pagination->getLastPage());
$repeat = true; if ($content === null) {
} $page = 1;
} else {
$page = $template->getTemplateVars('PAGE');
$page++;
}
if ($content !== null) { if ($page <= $pagination->getLastPage()) {
return $content; $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 * @param string $name
* @return \Thelia\Core\Template\Element\BaseLoop * @return \Thelia\Core\Template\Element\BaseLoop
* @throws InvalidElementException * @throws \Thelia\Tpex\Exception\InvalidElementException
* @throws ElementNotFoundException * @throws \Thelia\Tpex\Exception\ElementNotFoundException
*/ */
protected function createLoopInstance($name) protected function createLoopInstance($smartyParams)
{ {
if (! isset($this->loopDefinition[$name])) { $type = strtolower($smartyParams['type']);
throw new ElementNotFoundException(sprintf("%s loop does not exists", $name));
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) { if ($class->isSubclassOf("Thelia\Core\Template\Element\BaseLoop") === false) {
throw new InvalidElementException(sprintf("%s Loop class have to extends Thelia\Core\Template\Element\BaseLoop", 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->request,
$this->dispatcher $this->dispatcher
); );
$loop->initializeArgs($smartyParams);
return $loop;
} }
/** /**
@@ -304,10 +313,11 @@ class TheliaLoop implements SmartyPluginInterface
*/ */
protected function getLoopArgument(BaseLoop $loop, $smartyParam) protected function getLoopArgument(BaseLoop $loop, $smartyParam)
{ {
$faultActor = array(); $faultActor = array();
$faultDetails = array(); $faultDetails = array();
$argumentsCollection = $loop->getArgs(); $argumentsCollection = $loop->getArgs();
foreach( $argumentsCollection as $argument ) { foreach( $argumentsCollection as $argument ) {
$value = isset($smartyParam[$argument->name]) ? (string)$smartyParam[$argument->name] : null; $value = isset($smartyParam[$argument->name]) ? (string)$smartyParam[$argument->name] : null;
@@ -364,7 +374,7 @@ class TheliaLoop implements SmartyPluginInterface
* "myLoop" => "My\Own\Loop" * "myLoop" => "My\Own\Loop"
* ); * );
* *
* @param array $loopDefinition * @param array $loops
* @throws \InvalidArgumentException if loop name already exists * @throws \InvalidArgumentException if loop name already exists
*/ */
public function setLoopList(array $loopDefinition) public function setLoopList(array $loopDefinition)

View File

@@ -52,4 +52,4 @@ class AdminLogin extends BaseForm {
return "admin_login"; return "admin_login";
} }
} }

View File

@@ -2,8 +2,40 @@
namespace Thelia\Model; namespace Thelia\Model;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Model\Base\Admin as BaseAdmin; 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'));
}
} }

View File

@@ -6,11 +6,26 @@ use Thelia\Model\Base\Customer as BaseCustomer;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Event\CustomRefEvent; use Thelia\Core\Event\CustomRefEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\User\UserInterface;
use Propel\Runtime\Connection\ConnectionInterface; 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 * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/ */
@@ -97,4 +112,26 @@ class Customer extends BaseCustomer {
{ {
$this->dispatcher = $dispatcher; $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'));
}
} }

View File

@@ -151,7 +151,7 @@ class AttributeAvI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute_av', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -106,7 +106,7 @@ class AttributeAvTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class AttributeI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class AttributeTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class CategoryI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -131,7 +131,7 @@ class CategoryTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ConfigI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'config', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class ConfigTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ContentI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -121,7 +121,7 @@ class ContentTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class CountryI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'country', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class CountryTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -141,7 +141,7 @@ class CustomerTitleI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'customer_title', 'ID', true, null, null); $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('SHORT', 'Short', 'VARCHAR', false, 10, null);
$this->addColumn('LONG', 'Long', 'VARCHAR', false, 45, null); $this->addColumn('LONG', 'Long', 'VARCHAR', false, 45, null);
} // initialize() } // initialize()

View File

@@ -106,7 +106,7 @@ class CustomerTitleTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class DocumentI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'document', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -126,7 +126,7 @@ class DocumentTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FeatureAvI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature_av', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class FeatureAvTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FeatureI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -106,7 +106,7 @@ class FeatureTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FolderI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -131,7 +131,7 @@ class FolderTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class GroupI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'group', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class GroupTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ImageI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'image', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -126,7 +126,7 @@ class ImageTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -146,7 +146,7 @@ class MessageI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'message', 'ID', true, null, null); $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('TITLE', 'Title', 'LONGVARCHAR', false, null, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('DESCRIPTION_HTML', 'DescriptionHtml', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION_HTML', 'DescriptionHtml', 'CLOB', false, null, null);

View File

@@ -126,7 +126,7 @@ class MessageTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ModuleI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class ModuleTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class OrderStatusI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order_status', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class OrderStatusTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ProductI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -166,7 +166,7 @@ class ProductTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ResourceI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'resource', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null); $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class ResourceTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -141,7 +141,7 @@ class TaxI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax', 'ID', true, null, null); $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('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null); $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null);
} // initialize() } // initialize()

View File

@@ -131,7 +131,7 @@ class TaxRuleI18nTableMap extends TableMap
$this->setUseIdGenerator(false); $this->setUseIdGenerator(false);
// columns // columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax_rule', 'ID', true, null, null); $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() } // initialize()
/** /**

View File

@@ -111,7 +111,7 @@ class TaxRuleTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -101,7 +101,7 @@ class TaxTableMap extends TableMap
* *
* @var string * @var string
*/ */
const DEFAULT_LOCALE = 'en_US'; const DEFAULT_LOCALE = 'en_EN';
/** /**
* holds an array of fieldnames * holds an array of fieldnames

View File

@@ -35,7 +35,7 @@ use Thelia\Type\TypeCollection;
*/ */
class ArgumentTest extends \PHPUnit_Framework_TestCase class ArgumentTest extends \PHPUnit_Framework_TestCase
{ {
public function testArgumentCollectionConstruction() public function testArgumentCollectionCreateAndWalk()
{ {
$collection = new ArgumentCollection( $collection = new ArgumentCollection(
new Argument( new Argument(
@@ -61,30 +61,19 @@ class ArgumentTest extends \PHPUnit_Framework_TestCase
) )
); );
$this->assertAttributeEquals( $this->assertTrue($collection->getCount() == 3);
array(
0 => new Argument( $this->assertTrue($collection->key() == 'arg0');
'arg0', $collection->next();
new TypeCollection( $this->assertTrue($collection->key() == 'arg1');
new Type\AnyType() $collection->next();
) $this->assertTrue($collection->key() == 'arg2');
), $collection->next();
1 => new Argument(
'arg1', $this->assertFalse($collection->valid());
new TypeCollection(
new Type\AnyType() $collection->rewind();
) $this->assertTrue($collection->key() == 'arg0');
),
2 => new Argument(
'arg2',
new TypeCollection(
new Type\AnyType()
)
),
),
'arguments',
$collection
);
} }
public function testArgumentCollectionFetch() public function testArgumentCollectionFetch()

View File

@@ -56,16 +56,64 @@ a {
// Bootstrap Adjustements ------------------------------------------------------ // Bootstrap Adjustements ------------------------------------------------------
.btn-primary, .row h3 .btn-large, .row-fluid h3 .btn-large, .row-fluid h4 .btn-large { hr {
background: -moz-linear-gradient(center bottom , #E3530B 0%, #F39922 100%) repeat scroll 0 0 #E9730F; border: 0;
box-shadow: 0 0 2px rgba(250, 250, 250, 0.5) inset, 0 1px 3px rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(0, 0, 0, 0.1);
color: white; 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 ---------------------------------------------------------------- // -- Brandbar ----------------------------------------------------------------
/* --- BRAND BAR ---*/
.loginpage { .loginpage {
.brandbar { .brandbar {
width: 100%; width: 100%;
@@ -73,6 +121,10 @@ a {
.hero-unit { .hero-unit {
background-color: transparent !important; background-color: transparent !important;
h1 {
margin-bottom: 25px;
}
} }
.well { .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 -------------------------------------------------------------- // -- Login form --------------------------------------------------------------
.form-signin { .form-signin {

View File

@@ -1,4 +1,16 @@
{* Include required JS files *} <hr />
<footer class="modal-footer">
<div class="container">
<p>{intl l='&copy; Thelia 2012'}
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>
<span class="pull-right">{intl l='interface par <a target="_blank" href="http://www.steaw-webdesign.com/">Steaw-Webdesign</a>'}</span>
</p>
</div>
</footer>
{* Include required JS files *}
{javascripts file='../assets/js/jquery.min.js'} {javascripts file='../assets/js/jquery.min.js'}
<link rel="stylesheet" href="{$asset_url}" target="screen"> <link rel="stylesheet" href="{$asset_url}" target="screen">

View File

@@ -7,10 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
{stylesheets file='../assets/css/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{stylesheets file='../assets/bootstrap/css/bootstrap.css' filters='cssembed'} {stylesheets file='../assets/bootstrap/css/bootstrap.css' filters='cssembed'}
<link rel="stylesheet" href="{$asset_url}"> <link rel="stylesheet" href="{$asset_url}">
{/stylesheets} {/stylesheets}
@@ -19,6 +15,10 @@
<link rel="stylesheet" href="{$asset_url}"> <link rel="stylesheet" href="{$asset_url}">
{/stylesheets} {/stylesheets}
{stylesheets file='../assets/css/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{* TODO allow modules to include CSS here *} {* TODO allow modules to include CSS here *}
</head> </head>
<body> <body>

View File

@@ -1,16 +1,14 @@
{$page_title={intl l='Thelia'}} {$page_title={intl l='Welcome'}}
{include file='includes/header.inc.html'} {include file='includes/header.inc.html'}
<div class="loginpage"> <div class="loginpage">
{{intl l='abcd'}|capitalize}
<div class="brandbar container"> <div class="brandbar container">
<a class="brand" href="index.php">{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}</a> <a class="brand" href="index.php">{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}</a>
</div> </div>
<div id="wrapper" class="container"> <div id="wrapper" class="container">
{*
{thelia_module action='index_top'} {module_include location='index_top'}
*}
<div class="hero-unit"> <div class="hero-unit">
<h1>{intl l='Thelia Back Office'}</h1> <h1>{intl l='Thelia Back Office'}</h1>
@@ -31,34 +29,26 @@
<label class="checkbox"> <input type="checkbox" name="remember" value="yes"> {intl l='Remember me'}</label> <label class="checkbox"> <input type="checkbox" name="remember" value="yes"> {intl l='Remember me'}</label>
{/form_field} {/form_field}
<button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play"></i></button> <div class="pull-right"><button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play icon-white"></i></button></div>
</form> </form>
</div> </div>
<div class="row-fluid"> {module_include location='index_middle'}
</div> <div class="row-fluid feed-list">
{loop type="feed" name="thelia_feeds" url="http://thelia.net/Flux-rss.html?id_rubrique=8" limit="3"}
<div> <div class="span4 feed-list-item">
<h2>We DO display loops in back-office !</h2> <h3>{$DATE}</h3>
<ul> <h2><a href="#URL" target="_blank" title="{intl l='Lire la suite'}">{$TITLE|strip_tags}</a></h2>
{loop type="category" name="catloop1"} <p>{$DESCRIPTION|strip_tags|truncate:250:"...":true}</p>
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}, children: {$NB_CHILD} <p><a class="btn" href="#URL" target="_blank">{intl l='Lire la suite »'}</a></p>
{ifloop rel="inner1"} </div>
<ul> {/loop}
{loop type="category" name="inner1" parent="{$ID}"}
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
</li>
{/loop}
</ul>
</div> </div>
</div> </div>
{*
{thelia_module action='index_bottom'} {module_include location='index_bottom'}
*}
</div> </div>
{include file='includes/footer.inc.html'} {include file='includes/footer.inc.html'}

View File

@@ -1,12 +0,0 @@
Options +FollowSymlinks -Indexes
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index_dev.php [L,QSA]
</IfModule>