Removes container from all Thelia actions, but Modules (#198)

This commit is contained in:
Franck Allimant
2014-01-31 20:04:25 +01:00
parent dfd34bad49
commit 89653f452b
132 changed files with 603 additions and 467 deletions

View File

@@ -0,0 +1,53 @@
<?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\Event\Module;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Module;
use Thelia\Model\Order;
/**
* Class PaymentEvent
* @package Thelia\Core\Event\Module
* @author Franck Allimant <franck@cqfdev.fr>
*/
class OrderPaymentEvent extends ActionEvent
{
/**
* @var Order
*/
protected $order;
public function __construct(Order $order) {
$this->order = $order;
}
/**
* @return \Thelia\Model\Order
*/
public function getOrder()
{
return $this->order;
}
}

View File

@@ -706,6 +706,10 @@ final class TheliaEvents
const MODULE_UPDATE = 'thelia.module.update';
const MODULE_DELETE = 'thelia.module.delete';
/* Invoke payment module */
const MODULE_PAY = 'thelia.module.pay';
/**
* sent for clearing cache
*/

View File

@@ -31,11 +31,11 @@ use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Response;
use Symfony\Component\Routing\Router;
use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\TemplateHelper;
use Thelia\Exception\OrderException;
use Thelia\Tools\Redirect;
use Thelia\Tools\URL;
use Thelia\Core\Security\Exception\AuthenticationException;
/**

View File

@@ -25,10 +25,10 @@
namespace Thelia\Core\Security\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Form;
use Thelia\Core\Security\UserProvider\AdminUserProvider;
use Thelia\Core\Security\Authentication\UsernamePasswordFormAuthenticator;
use Thelia\Form\AdminLogin;
class AdminUsernamePasswordFormAuthenticator extends UsernamePasswordFormAuthenticator

View File

@@ -25,7 +25,7 @@
namespace Thelia\Core\Security\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Security\Authentication\UsernamePasswordFormAuthenticator;
use Thelia\Form\CustomerLogin;
use Thelia\Core\Security\UserProvider\CustomerUserProvider;

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Security\Authentication;
use Thelia\Core\Security\Authentication\AuthenticatorInterface;
use Thelia\Core\Security\UserProvider\TokenUserProvider;
use Thelia\Core\Security\Exception\TokenAuthenticationException;

View File

@@ -23,10 +23,10 @@
namespace Thelia\Core\Security\Authentication;
use Thelia\Core\Security\Authentication\AuthenticatorInterface;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Security\UserProvider\UserProviderInterface;
use Symfony\Component\Form\Form;
use Thelia\Core\Security\Exception\WrongPasswordException;
use Thelia\Core\Security\Exception\UsernameNotFoundException;
use Symfony\Component\Validator\Exception\ValidatorException;

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Model\Admin;
use Thelia\Model\AdminQuery;
class AdminUserProvider implements UserProviderInterface

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Security\UserProvider;
use Thelia\Action\Customer;
use Thelia\Model\CustomerQuery;
class CustomerUserProvider implements UserProviderInterface
{

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Template\Element;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Template\Loop\Argument\Argument;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Model\Tools\ModelCriteriaTools;

View File

@@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Element;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Util\PropelModelPager;
use Thelia\Core\Template\Element\LoopResultRow;
class LoopResult implements \Iterator
{

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Template\Loop;
use Thelia\Core\Template\Loop\Product;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Template\Loop;
use Thelia\Core\Template\Loop\Content;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;

View File

@@ -15,7 +15,7 @@ use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\TaxEngine\TaxEngine;
use Thelia\Type;
class Cart extends BaseLoop implements ArraySearchLoopInterface
@@ -55,7 +55,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface
public function buildArray()
{
$cart = $this->getCart($this->request);
$cart = $this->getCart($this->getDispatcher(), $this->request);
if (null === $cart) {
return array();

View File

@@ -29,7 +29,7 @@ use Thelia\Exception\OrderException;
use Thelia\Model\CountryQuery;
use Thelia\Module\BaseModule;
use Thelia\Module\DeliveryModuleInterface;
use Thelia\TaxEngine\TaxEngine;
/**
* Class Delivery

View File

@@ -31,7 +31,7 @@ use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Element\SearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Model\Base\Customer;
use Thelia\Model\CustomerQuery;
use Thelia\Model\Map\CustomerTableMap;
use Thelia\Model\Map\OrderAddressTableMap;

View File

@@ -24,7 +24,7 @@
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Condition\ConditionFactory;
use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;

View File

@@ -43,7 +43,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
use Thelia\Model\Map\ProductTableMap;
use Thelia\Model\ProductCategoryQuery;
use Thelia\Model\ProductQuery;
use Thelia\TaxEngine\TaxEngine;
use Thelia\Type\TypeCollection;
use Thelia\Type;

View File

@@ -36,7 +36,7 @@ use Thelia\Exception\TaxEngineException;
use Thelia\Model\Base\ProductSaleElementsQuery;
use Thelia\Model\CurrencyQuery;
use Thelia\Model\Map\ProductSaleElementsTableMap;
use Thelia\TaxEngine\TaxEngine;
use Thelia\Type\TypeCollection;
use Thelia\Type;

View File

@@ -58,4 +58,12 @@ interface ParserInterface
* @return array: an array of defined templates directories for the given template type
*/
public function getTemplateDirectories($templateType);
/**
* Create a variable that will be available in the templates
*
* @param $variable the vatiable name
* @param $value the value of the variable
*/
public function assign($variable, $value);
}

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Template\Smarty\Assets;
use Thelia\Core\Template\TemplateDefinition;
use Thelia\Tools\URL;
use Thelia\Core\Template\Assets\AssetManagerInterface;

View File

@@ -37,7 +37,7 @@ use Thelia\Model\CountryQuery;
use Thelia\Model\CurrencyQuery;
use Thelia\Model\FolderQuery;
use Thelia\Model\OrderQuery;
use Thelia\Model\Product;
use Thelia\Model\ProductQuery;
use Thelia\Model\Tools\ModelCriteriaTools;
use Thelia\TaxEngine\TaxEngine;
@@ -190,7 +190,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin
self::$dataAccessCache['currentCountry'] = $taxCountry;
}
$cart = $this->getCart($this->request);
$cart = $this->getCart($this->getDispatcher(), $this->request);
$result = "";
switch ($params["attr"]) {
case "count_item":

View File

@@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Smarty\Plugins;
use Symfony\Component\Form\FormView;
use Thelia\Core\Form\Type\TheliaType;
use Thelia\Form\BaseForm;
use Thelia\Core\Template\Element\Exception\ElementNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;

View File

@@ -7,10 +7,10 @@ use \Symfony\Component\EventDispatcher\EventDispatcherInterface;
use \Smarty;
use Thelia\Core\HttpFoundation\Response;
use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserContext;
use Thelia\Core\Template\TemplateDefinition;

View File

@@ -47,7 +47,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Config\DatabaseConfiguration;
use Thelia\Config\DefinePropel;
use Thelia\Core\Template\TemplateDefinition;
use Thelia\Core\TheliaContainerBuilder;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;