+ */
+class CategoryTest extends TestCaseWithURLToolSetup
+{
+
+ protected function getRandomCategory()
+ {
+ $category = CategoryQuery::create()
+ ->addAscendingOrderByColumn('RAND()')
+ ->findOne();
+
+ if (null === $category) {
+ $this->fail('use fixtures before launching test, there is no category in database');
+ }
+
+ return $category;
+ }
+
+ public function getUpdateEvent(&$category)
+ {
+ if (!$category instanceof \Thelia\Model\Category) {
+ $category = $this->getRandomCategory();
+ }
+
+ $event = new CategoryUpdateEvent($category->getId());
+
+ $event
+ ->setLocale('en_US')
+ ->setTitle('bar')
+ ->setDescription('bar description')
+ ->setChapo('bar chapo')
+ ->setPostscriptum('bar postscriptum')
+ ->setVisible(0)
+ ->setParent(0)
+ ->setDispatcher($this->getDispatcher())
+ ;
+ }
+
+ public function getUpdateSeoEvent(&$category)
+ {
+ if (!$category instanceof \Thelia\Model\Category) {
+ $category = $this->getRandomCategory();
+ }
+
+ $event = new UpdateSeoEvent($category->getId());
+ $event->setDispatcher($this->getDispatcher());
+ $event
+ ->setLocale($category->getLocale())
+ ->setMetaTitle($category->getMetaTitle())
+ ->setMetaDescription($category->getMetaDescription())
+ ->setMetaKeywords($category->getMetaKeywords());
+
+ return $event;
+ }
+
+ public function processUpdateAction($event)
+ {
+ $action = new Category();
+ $action->update($event);
+
+ return $event->getCategory();
+ }
+
+ public function processUpdateSeoAction($event)
+ {
+ $action = new Category();
+
+ return $action->updateSeo($event);
+
+ }
+
+ public function testCreate()
+ {
+ $event = new CategoryCreateEvent();
+
+ $event
+ ->setLocale('en_US')
+ ->setParent(0)
+ ->setTitle('foo')
+ ->setVisible(1)
+ ->setDispatcher($this->getDispatcher());
+
+ $action = new Category();
+ $action->create($event);
+
+ $createdCategory = $event->getCategory();
+
+ $this->assertInstanceOf('Thelia\Model\Category', $createdCategory);
+
+ $this->assertFalse($createdCategory->isNew());
+
+ $this->assertEquals('en_US', $createdCategory->getLocale());
+ $this->assertEquals('foo', $createdCategory->getTitle());
+ $this->assertEquals(1, $createdCategory->getVisible());
+ $this->assertEquals(0, $createdCategory->getParent());
+ $this->assertNull($createdCategory->getDescription());
+ $this->assertNull($createdCategory->getChapo());
+ $this->assertNull($createdCategory->getPostscriptum());
+
+ return $createdCategory;
+ }
+
+ /**
+ * @param CategoryModel $category
+ * @depends testCreate
+ */
+ public function testUpdate(CategoryModel $category)
+ {
+ $event = new CategoryUpdateEvent($category->getId());
+
+ $event
+ ->setLocale('en_US')
+ ->setTitle('bar')
+ ->setDescription('bar description')
+ ->setChapo('bar chapo')
+ ->setPostscriptum('bar postscriptum')
+ ->setVisible(0)
+ ->setParent(0)
+ ->setDispatcher($this->getDispatcher())
+ ;
+
+ $action = new Category();
+ $action->update($event);
+
+ $updatedCategory = $event->getCategory();
+
+ $this->assertInstanceOf('Thelia\Model\Category', $updatedCategory);
+
+ $this->assertEquals('en_US', $updatedCategory->getLocale());
+ $this->assertEquals('bar', $updatedCategory->getTitle());
+ $this->assertEquals('bar description', $updatedCategory->getDescription());
+ $this->assertEquals('bar chapo', $updatedCategory->getChapo());
+ $this->assertEquals('bar postscriptum', $updatedCategory->getPostscriptum());
+ $this->assertEquals(0, $updatedCategory->getVisible());
+ $this->assertEquals(0, $updatedCategory->getParent());
+
+ return $updatedCategory;
+ }
+
+ /**
+ * @depends testUpdate
+ */
+ public function testDelete(CategoryModel $category)
+ {
+ $event = new CategoryDeleteEvent($category->getId());
+ $event->setDispatcher($this->getDispatcher());
+
+ $action = new Category();
+ $action->delete($event);
+
+ $deletedCategory = $event->getCategory();
+
+ $this->assertInstanceOf('Thelia\Model\Category', $deletedCategory);
+ $this->assertTrue($deletedCategory->isDeleted());
+ }
+}
\ No newline at end of file
diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php
index 1eca7d2ea..08e41815b 100644
--- a/core/lib/Thelia/Tests/Action/ContentTest.php
+++ b/core/lib/Thelia/Tests/Action/ContentTest.php
@@ -23,6 +23,7 @@
namespace Thelia\Tests\Action;
use Propel\Runtime\ActiveQuery\Criteria;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Action\Content;
use Thelia\Core\Event\Content\ContentAddFolderEvent;
use Thelia\Core\Event\Content\ContentCreateEvent;
@@ -44,6 +45,15 @@ use Thelia\Tests\TestCaseWithURLToolSetup;
*/
class ContentTest extends TestCaseWithURLToolSetup
{
+ /**
+ * @var EventDispatcherInterface
+ */
+ protected $dispatcher;
+
+ public function setUp()
+ {
+ $this->dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
+ }
public function getUpdateEvent(&$content)
{
@@ -52,6 +62,7 @@ class ContentTest extends TestCaseWithURLToolSetup
}
$event = new ContentUpdateEvent($content->getId());
+ $event->setDispatcher($this->dispatcher);
$event
->setVisible(1)
->setLocale($content->getLocale())
@@ -78,6 +89,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$folder = $this->getRandomFolder();
$event = new ContentCreateEvent();
+ $event->setDispatcher($this->dispatcher);
$event
->setVisible(1)
->setLocale('en_US')
@@ -103,6 +115,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$folder = $this->getRandomFolder();
$event = new ContentUpdateEvent($content->getId());
+ $event->setDispatcher($this->dispatcher);
$event
->setVisible(1)
->setLocale('en_US')
@@ -132,6 +145,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$content = $this->getRandomContent();
$event = new ContentDeleteEvent($content->getId());
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->delete($event);
@@ -150,6 +164,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$visibility = $content->getVisible();
$event = new ContentToggleVisibilityEvent($content);
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->toggleVisibility($event);
@@ -173,6 +188,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$newPosition = $content->getPosition()-1;
$event = new UpdatePositionEvent($content->getId(), UpdatePositionEvent::POSITION_UP);
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->updatePosition($event);
@@ -195,6 +211,7 @@ class ContentTest extends TestCaseWithURLToolSetup
$newPosition = $content->getPosition()+1;
$event = new UpdatePositionEvent($content->getId(), UpdatePositionEvent::POSITION_DOWN);
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->updatePosition($event);
@@ -215,6 +232,7 @@ class ContentTest extends TestCaseWithURLToolSetup
}
$event = new UpdatePositionEvent($content->getId(), UpdatePositionEvent::POSITION_ABSOLUTE, 1);
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->updatePosition($event);
@@ -237,6 +255,7 @@ class ContentTest extends TestCaseWithURLToolSetup
} while ($test->count() > 0);
$event = new ContentAddFolderEvent($content, $folder->getId());
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->addFolder($event);
@@ -260,6 +279,7 @@ class ContentTest extends TestCaseWithURLToolSetup
public function testRemoveFolder(ContentFolder $association)
{
$event = new ContentRemoveFolderEvent($association->getContent(), $association->getFolder()->getId());
+ $event->setDispatcher($this->dispatcher);
$contentAction = new Content($this->getContainer());
$contentAction->removeFolder($event);
diff --git a/core/lib/Thelia/Tests/Action/CustomerTest.php b/core/lib/Thelia/Tests/Action/CustomerTest.php
index 396eb5257..21918d79d 100644
--- a/core/lib/Thelia/Tests/Action/CustomerTest.php
+++ b/core/lib/Thelia/Tests/Action/CustomerTest.php
@@ -24,6 +24,9 @@
namespace Thelia\Tests\Action\ImageTest;
use Thelia\Action\Customer;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
+use Thelia\Core\HttpFoundation\Request;
+use Thelia\Core\Security\SecurityContext;
+use Thelia\Model\CustomerQuery;
/**
* Class CustomerTest
@@ -32,15 +35,12 @@ use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
*/
class CustomerTest extends \PHPUnit_Framework_TestCase
{
- public function getContainer()
+
+ public static function setUpBeforeClass()
{
- $container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
-
- $dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
-
- $container->set("event_dispatcher", $dispatcher);
-
- return $container;
+ CustomerQuery::create()
+ ->filterByRef('testRef')
+ ->delete();
}
public function testCreatedCustomer()
@@ -67,7 +67,9 @@ class CustomerTest extends \PHPUnit_Framework_TestCase
null
);
- $customerAction = new Customer($this->getContainer());
+ $customerCreateEvent->setDispatcher($this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface"));
+
+ $customerAction = new Customer(new SecurityContext(new Request()));
$customerAction->create($customerCreateEvent);
@@ -126,7 +128,9 @@ class CustomerTest extends \PHPUnit_Framework_TestCase
'testRef'
);
- $customerAction = new Customer($this->getContainer());
+ $customerCreateEvent->setDispatcher($this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface"));
+
+ $customerAction = new Customer(new SecurityContext(new Request()));
$customerAction->create($customerCreateEvent);
diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php
index cbf9a7c1e..96e07ed52 100644
--- a/core/lib/Thelia/Tests/Action/FolderTest.php
+++ b/core/lib/Thelia/Tests/Action/FolderTest.php
@@ -43,6 +43,16 @@ class FolderTest extends TestCaseWithURLToolSetup
{
use RewrittenUrlTestTrait;
+ /**
+ * @var EventDispatcherInterface
+ */
+ protected $dispatcher;
+
+ public function setUp()
+ {
+ $this->dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
+ }
+
public function getUpdateEvent(&$folder)
{
if (!$folder instanceof \Thelia\Model\Folder) {
@@ -50,6 +60,7 @@ class FolderTest extends TestCaseWithURLToolSetup
}
$event = new FolderUpdateEvent($folder->getId());
+ $event->setDispatcher($this->dispatcher);
$event
->setVisible(1)
->setLocale($folder->getLocale())
@@ -70,7 +81,7 @@ class FolderTest extends TestCaseWithURLToolSetup
}
$event = new UpdateSeoEvent($folder->getId());
-
+ $event->setDispatcher($this->dispatcher);
$event
->setLocale($folder->getLocale())
->setMetaTitle($folder->getMetaTitle())
@@ -82,14 +93,14 @@ class FolderTest extends TestCaseWithURLToolSetup
public function processUpdateSeoAction($event)
{
- $contentAction = new Folder($this->getContainer());
+ $contentAction = new Folder();
return $contentAction->updateSeo($event);
}
public function processUpdateAction($event)
{
- $contentAction = new Folder($this->getContainer());
+ $contentAction = new Folder();
$contentAction->update($event);
return $event->getFolder();
@@ -103,13 +114,14 @@ class FolderTest extends TestCaseWithURLToolSetup
{
$event = new FolderCreateEvent();
+ $event->setDispatcher($this->dispatcher);
$event
->setParent(0)
->setVisible(1)
->setLocale('en_US')
->setTitle('folder creation test');
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->create($event);
@@ -131,7 +143,7 @@ class FolderTest extends TestCaseWithURLToolSetup
$visible = !$folder->getVisible();
$event = new FolderUpdateEvent($folder->getId());
-
+ $event->setDispatcher($this->dispatcher);
$event
->setLocale('en_US')
->setTitle('test update folder')
@@ -142,7 +154,7 @@ class FolderTest extends TestCaseWithURLToolSetup
->setParent(0)
;
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->update($event);
$updatedFolder = $event->getFolder();
@@ -165,8 +177,8 @@ class FolderTest extends TestCaseWithURLToolSetup
$folder = $this->getRandomFolder();
$event = new FolderDeleteEvent($folder->getId());
-
- $folderAction = new Folder($this->getContainer());
+ $event->setDispatcher($this->dispatcher);
+ $folderAction = new Folder();
$folderAction->delete($event);
$deletedFolder = $event->getFolder();
@@ -185,8 +197,9 @@ class FolderTest extends TestCaseWithURLToolSetup
$visible = $folder->getVisible();
$event = new FolderToggleVisibilityEvent($folder);
+ $event->setDispatcher($this->dispatcher);
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->toggleVisibility($event);
$updatedFolder = $event->getFolder();
@@ -208,8 +221,9 @@ class FolderTest extends TestCaseWithURLToolSetup
$newPosition = $folder->getPosition()-1;
$event = new UpdatePositionEvent($folder->getId(), UpdatePositionEvent::POSITION_UP);
+ $event->setDispatcher($this->dispatcher);
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->updatePosition($event);
$updatedFolder = FolderQuery::create()->findPk($folder->getId());
@@ -239,8 +253,9 @@ class FolderTest extends TestCaseWithURLToolSetup
$newPosition = $folder->getPosition()+1;
$event = new UpdatePositionEvent($folder->getId(), UpdatePositionEvent::POSITION_DOWN);
+ $event->setDispatcher($this->dispatcher);
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->updatePosition($event);
$updatedFolder = FolderQuery::create()->findPk($folder->getId());
@@ -259,8 +274,9 @@ class FolderTest extends TestCaseWithURLToolSetup
}
$event = new UpdatePositionEvent($folder->getId(), UpdatePositionEvent::POSITION_ABSOLUTE, 1);
+ $event->setDispatcher($this->dispatcher);
- $folderAction = new Folder($this->getContainer());
+ $folderAction = new Folder();
$folderAction->updatePosition($event);
$updatedFolder = FolderQuery::create()->findPk($folder->getId());
diff --git a/core/lib/Thelia/Tests/Action/OrderTest.php b/core/lib/Thelia/Tests/Action/OrderTest.php
index f2fd00a32..41cd7cbac 100644
--- a/core/lib/Thelia/Tests/Action/OrderTest.php
+++ b/core/lib/Thelia/Tests/Action/OrderTest.php
@@ -30,11 +30,14 @@ use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Session\Session;
use Thelia\Core\Security\SecurityContext;
+use Thelia\Core\Template\ParserContext;
+use Thelia\Core\Template\Smarty\SmartyParser;
+use Thelia\Mailer\MailerFactory;
use Thelia\Model\AddressQuery;
use Thelia\Model\Base\OrderAddressQuery;
use Thelia\Model\Base\OrderProductQuery;
use Thelia\Model\Base\OrderQuery;
-use Thelia\Model\OrderAddress;
+
use Thelia\Model\OrderStatus;
use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Model\Cart;
@@ -85,25 +88,42 @@ class OrderTest extends \PHPUnit_Framework_TestCase
*/
protected $cartItems;
+ /**
+ * @var SecurityContext
+ */
+ protected $securityContext;
+
+ protected $request;
+
public function setUp()
{
- $container = new ContainerBuilder();
$session = new Session(new MockArraySessionStorage());
- $request = new Request();
+
$dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
- $request->setSession($session);
+ $this->request = new Request();
+ $this->request->setSession($session);
- $container->set("event_dispatcher", $dispatcher);
- $container->set('request', $request);
- $container->set('thelia.securityContext', new SecurityContext($request));
+ $this->securityContext = new SecurityContext($this->request);
- $this->container = $container;
+ $this->container = new ContainerBuilder();
+
+ $this->container->set("event_dispatcher", $dispatcher);
+ $this->container->set('request', $this->request);
$this->orderEvent = new OrderEvent(new OrderModel());
- $this->orderAction = new Order($this->container);
+ $this->orderEvent->setDispatcher($dispatcher);
+
+ // public function __construct(Request $this->request, ParserInterface $parser, MailerFactory $mailer, SecurityContext $securityContext)
+
+ $this->orderAction = new Order(
+ $this->request,
+ new SmartyParser($this->request, $dispatcher, new ParserContext($this->request)),
+ new MailerFactory($dispatcher),
+ $this->securityContext
+ );
/* load customer */
$this->customer = $this->loadCustomer();
@@ -123,7 +143,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
return null;
}
- $this->container->get('thelia.securityContext')->setCustomerUser($customer);
+ $this->securityContext->setCustomerUser($customer);
return $customer;
}
@@ -172,7 +192,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$this->cartItems[] = $cartItem;
}
- $this->container->get('request')->getSession()->setCart($cart->getId());
+ $this->request->getSession()->setCart($cart->getId());
return $cart;
}
@@ -319,7 +339,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(OrderStatus::CODE_NOT_PAID, $placedOrder->getOrderStatus()->getCode(), 'status does not match');
/* check lang */
- $this->assertEquals($this->container->get('request')->getSession()->getLang()->getId(), $placedOrder->getLangId(), 'lang does not match');
+ $this->assertEquals($this->request->getSession()->getLang()->getId(), $placedOrder->getLangId(), 'lang does not match');
/* check ordered product */
foreach ($this->cartItems as $index => $cartItem) {
diff --git a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php
index 3d5e757d1..4891e8b96 100644
--- a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php
+++ b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php
@@ -29,6 +29,7 @@ trait RewrittenUrlTestTrait
{
$object = null;
$event = $this->getUpdateSeoEvent($object);
+ $event->setDispatcher($this->dispatcher);
/* get an existing url */
$existingUrl = RewritingUrlQuery::create()
@@ -50,6 +51,7 @@ trait RewrittenUrlTestTrait
{
$object = null;
$event = $this->getUpdateSeoEvent($object);
+ $event->setDispatcher($this->dispatcher);
$currentUrl = $object->getRewrittenUrl($object->getLocale());
diff --git a/core/lib/Thelia/Tests/Cart/CartTraitTest.php b/core/lib/Thelia/Tests/Cart/CartTraitTest.php
index 039e4448e..a1531e2a1 100755
--- a/core/lib/Thelia/Tests/Cart/CartTraitTest.php
+++ b/core/lib/Thelia/Tests/Cart/CartTraitTest.php
@@ -47,6 +47,8 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
protected $uniqid;
+ protected $dispatcher;
+
public function getContainer()
{
$container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
@@ -67,6 +69,8 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$this->uniqid = uniqid('', true);
+ $this->dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
+
$this->cartTrait = new MockCartTrait($this->uniqid, $this->getContainer());
}
@@ -79,7 +83,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
{
$cartTrait = $this->cartTrait;
- $cart = $cartTrait->getCart($this->request);
+ $cart = $cartTrait->getCart($this->dispatcher, $this->request);
$this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNull($cart->getCustomerId());
@@ -109,7 +113,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$request->getSession()->setCustomerUser($customer);
- $cart = $cartTrait->getCart($request);
+ $cart = $cartTrait->getCart($this->dispatcher, $request);
$this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNotNull($cart->getCustomerId());
$this->assertEquals($customer->getId(), $cart->getCustomerId());
@@ -137,7 +141,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$request->cookies->set("thelia_cart", $uniqid);
- $getCart = $cartTrait->getCart($request);
+ $getCart = $cartTrait->getCart($this->dispatcher, $request);
$this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNull($getCart->getCustomerId());
$this->assertNull($getCart->getAddressDeliveryId());
@@ -159,7 +163,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$token = "WrongToken";
$request->cookies->set("thelia_cart", $token);
- $cart = $cartTrait->getCart($request);
+ $cart = $cartTrait->getCart($this->dispatcher, $request);
$this->assertInstanceOf("Thelia\Model\Cart", $cart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNull($cart->getCustomerId());
$this->assertNull($cart->getAddressDeliveryId());
@@ -196,7 +200,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$request->getSession()->setCustomerUser($customer);
- $getCart = $cartTrait->getCart($request);
+ $getCart = $cartTrait->getCart($this->dispatcher, $request);
$this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNotNull($getCart->getCustomerId());
$this->assertNull($getCart->getAddressDeliveryId());
@@ -234,7 +238,7 @@ class CartTraitTest extends \PHPUnit_Framework_TestCase
$request->getSession()->setCustomerUser($customer);
- $getCart = $cartTrait->getCart($request);
+ $getCart = $cartTrait->getCart($this->dispatcher, $request);
$this->assertInstanceOf("Thelia\Model\Cart", $getCart, '$cart must be an instance of cart model Thelia\Model\Cart');
$this->assertNotNull($getCart->getCustomerId());
$this->assertNull($getCart->getAddressDeliveryId());
diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php
index a370dbd9a..95c49ce58 100644
--- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php
+++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php
@@ -24,7 +24,7 @@
namespace Thelia\Condition\Implementation;
use Thelia\Condition\ConditionEvaluator;
-use Thelia\Condition\Operators;
+
use Thelia\Coupon\FacadeInterface;
use Thelia\Model\Currency;
diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php
index 2d741eb92..cd6d67364 100644
--- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php
+++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php
@@ -28,7 +28,7 @@ use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Operators;
use Thelia\Condition\ConditionCollection;
use Thelia\Coupon\FacadeInterface;
-use Thelia\Exception\InvalidConditionValueException;
+
use Thelia\Model\Currency;
use Thelia\Model\CurrencyQuery;
diff --git a/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php b/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php
index d7437efb9..8de88328b 100755
--- a/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php
+++ b/core/lib/Thelia/Tests/Core/HttpFoundation/RequestTest.php
@@ -2,7 +2,7 @@
namespace Thelia\Tests\Core\HttpFoundation;
-use Thelia\Core\HttpFoundation\Request;
+
/**
* the the helpers addinf in Request class
diff --git a/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php b/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php
index 41a955f87..1320c3020 100644
--- a/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php
+++ b/core/lib/Thelia/Tests/TestCaseWithURLToolSetup.php
@@ -23,6 +23,9 @@
namespace Thelia\Tests;
+use Symfony\Component\Routing\RequestContext;
+use Thelia\Tools\URL;
+
/**
* This class provides URL Tool class initialisation
*
@@ -31,21 +34,22 @@ namespace Thelia\Tests;
class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
{
private $container = null;
+ private $dispatcher = null;
public function __construct()
{
$this->container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
- $dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
+ $this->dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface");
- $this->container->set("event_dispatcher", $dispatcher);
+ $this->container->set("event_dispatcher", $this->dispatcher);
$this->setupURLTool();
}
protected function setupURLTool()
{
- $context = new \Symfony\Component\Routing\RequestContext(
+ $context = new RequestContext(
'/thelia/index.php',
'GET',
'localhost',
@@ -65,11 +69,16 @@ class TestCaseWithURLToolSetup extends \PHPUnit_Framework_TestCase
$this->container->set("router.admin", $router);
- new \Thelia\Tools\URL($this->container);
+ new URL($this->container);
}
public function getContainer()
{
return $this->container;
}
+
+ public function getDispatcher()
+ {
+ return $this->dispatcher;
+ }
}
diff --git a/core/lib/Thelia/Tests/Tools/FileManagerTest.php b/core/lib/Thelia/Tests/Tools/FileManagerTest.php
index ea8588b19..35573a2ac 100644
--- a/core/lib/Thelia/Tests/Tools/FileManagerTest.php
+++ b/core/lib/Thelia/Tests/Tools/FileManagerTest.php
@@ -11,9 +11,8 @@ namespace Thelia\Tests\Tools;
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
-use Thelia\Core\Translation\Translator;
-use Thelia\Exception\ImageException;
-use Thelia\Model\Admin;
+
+
use Thelia\Model\CategoryQuery;
use Thelia\Model\ContentQuery;
use Thelia\Model\FolderQuery;
@@ -202,7 +201,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new ImageCreateOrUpdateEvent(FileManager::TYPE_PRODUCT, 24);
@@ -231,7 +230,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new DocumentCreateOrUpdateEvent(FileManager::TYPE_PRODUCT, 24);
@@ -260,7 +259,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new ImageCreateOrUpdateEvent(FileManager::TYPE_CATEGORY, 24);
@@ -289,7 +288,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new DocumentCreateOrUpdateEvent(FileManager::TYPE_CATEGORY, 24);
@@ -318,7 +317,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new ImageCreateOrUpdateEvent(FileManager::TYPE_FOLDER, 24);
@@ -347,7 +346,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new DocumentCreateOrUpdateEvent(FileManager::TYPE_FOLDER, 24);
@@ -376,7 +375,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new ImageCreateOrUpdateEvent(FileManager::TYPE_CONTENT, 24);
@@ -405,7 +404,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getFile')
->will($this->returnValue('file'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$event = new DocumentCreateOrUpdateEvent(FileManager::TYPE_CONTENT, 24);
@@ -424,7 +423,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\ContainerInterface')
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$stubProductImage = $this->getMockBuilder('\Thelia\Model\ProductImage')
->disableOriginalConstructor()
@@ -450,7 +449,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\ContainerInterface')
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$stubProductDocument = $this->getMockBuilder('\Thelia\Model\ProductDocument')
->disableOriginalConstructor()
@@ -476,7 +475,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\ContainerInterface')
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$stubProductImage = $this->getMockBuilder('\Thelia\Model\ProductImage')
->disableOriginalConstructor()
@@ -502,7 +501,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
$stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\ContainerInterface')
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$stubProductDocument = $this->getMockBuilder('\Thelia\Model\ProductDocument')
->disableOriginalConstructor()
@@ -528,7 +527,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$badFileName = 'a/ze\érà~çè§^"$*+-_°)(&é<>@#ty2/[\/:*?"<>|]/fi?.fUPPERile.exel../e*';
$expected = 'azer-_ty2fi.fupperile.exel..e';
@@ -546,7 +545,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getImageModel(FileManager::TYPE_PRODUCT);
$this->assertInstanceOf('\Thelia\Model\ProductImage', $actual);
$actual = $fileManager->getImageModel(FileManager::TYPE_CATEGORY);
@@ -568,7 +567,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getDocumentModel(FileManager::TYPE_PRODUCT);
$this->assertInstanceOf('\Thelia\Model\ProductDocument', $actual);
$actual = $fileManager->getDocumentModel(FileManager::TYPE_CATEGORY);
@@ -590,7 +589,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getImageModelQuery(FileManager::TYPE_PRODUCT);
$this->assertInstanceOf('\Thelia\Model\ProductImageQuery', $actual);
$actual = $fileManager->getImageModelQuery(FileManager::TYPE_CATEGORY);
@@ -612,7 +611,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getDocumentModelQuery(FileManager::TYPE_PRODUCT);
$this->assertInstanceOf('\Thelia\Model\ProductDocumentQuery', $actual);
$actual = $fileManager->getDocumentModelQuery(FileManager::TYPE_CATEGORY);
@@ -634,7 +633,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getParentFileModel(FileManager::TYPE_PRODUCT, ProductQuery::create()->findOne()->getId());
$this->assertInstanceOf('\Thelia\Model\Product', $actual);
$actual = $fileManager->getParentFileModel(FileManager::TYPE_CATEGORY, CategoryQuery::create()->findOne()->getId());
@@ -677,7 +676,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getUploadDir(FileManager::TYPE_PRODUCT, FileManager::FILE_TYPE_IMAGES);
$this->assertEquals(THELIA_LOCAL_DIR . 'media/images/product', $actual);
@@ -714,7 +713,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getRedirectionUrl(FileManager::TYPE_PRODUCT, 1, FileManager::FILE_TYPE_IMAGES);
$this->assertEquals('/admin/products/update?product_id=1¤t_tab=images', $actual);
@@ -751,7 +750,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->getFormId(FileManager::TYPE_PRODUCT, FileManager::FILE_TYPE_IMAGES);
$this->assertEquals('thelia.admin.product.image.modification', $actual);
@@ -795,7 +794,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getClientOriginalName')
->will($this->returnValue('or1-g_n?al*/&é"filen@me#'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$expected = 'or1-g_nalfilenme-1.yml';
$actual = $fileManager->renameFile(1, $stubUploadedFile);
@@ -822,7 +821,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->method('getClientOriginalName')
->will($this->returnValue('or1-g_n?al*/&é"filen@me#'));
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$expected = 'or1-g_nalfilenme-1';
$actual = $fileManager->renameFile(1, $stubUploadedFile);
@@ -839,7 +838,7 @@ class FileManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
- $fileManager = new FileManager($stubContainer);
+ $fileManager = new FileManager();
$actual = $fileManager->isImage('image/jpeg');
$this->assertTrue($actual);
diff --git a/core/lib/Thelia/Tools/FileManager.php b/core/lib/Thelia/Tools/FileManager.php
index 53d63ce22..330019f99 100644
--- a/core/lib/Thelia/Tools/FileManager.php
+++ b/core/lib/Thelia/Tools/FileManager.php
@@ -22,12 +22,12 @@
/**********************************************************************************/
namespace Thelia\Tools;
-use Symfony\Component\DependencyInjection\ContainerInterface;
+
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
use Thelia\Core\HttpFoundation\Request;
-use Thelia\Core\Translation\Translator;
+
use Thelia\Exception\ImageException;
use Thelia\Form\CategoryDocumentModification;
use Thelia\Form\CategoryImageModification;
@@ -81,23 +81,6 @@ class FileManager
CONST FILE_TYPE_IMAGES = 'images';
CONST FILE_TYPE_DOCUMENTS = 'documents';
- /** @var ContainerInterface Service Container */
- protected $container = null;
-
- /** @var Translator Service Translator */
- protected $translator = null;
-
- /**
- * Constructor
- *
- * @param ContainerInterface $container Service container
- */
- public function __construct(ContainerInterface $container)
- {
- $this->container = $container;
- $this->translator = $this->container->get('thelia.translator');
- }
-
/**
* Copy UploadedFile into the server storage directory
*
diff --git a/core/lib/Thelia/Tools/URL.php b/core/lib/Thelia/Tools/URL.php
index cf593bf06..0334ac72e 100644
--- a/core/lib/Thelia/Tools/URL.php
+++ b/core/lib/Thelia/Tools/URL.php
@@ -29,7 +29,7 @@ use Thelia\Rewriting\RewritingRetriever;
use Thelia\Core\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\Routing\RequestContext;
+
class URL
{
@@ -145,7 +145,7 @@ class URL
foreach ($parameters as $name => $value) {
// Remove this parameter from base URL to prevent duplicate parameters
- $base = preg_replace('/([?&])'.$name.'=([^&])*(&|$)/', '$1', $base);
+ $base = preg_replace('/([?&])'.$name.'=([^&])*(&|$)/', '', $base);
$queryString .= sprintf("%s=%s&", urlencode($name), urlencode($value));
}
diff --git a/core/lib/Thelia/Type/FloatToFloatArrayType.php b/core/lib/Thelia/Type/FloatToFloatArrayType.php
index f55997f55..08a310ef0 100644
--- a/core/lib/Thelia/Type/FloatToFloatArrayType.php
+++ b/core/lib/Thelia/Type/FloatToFloatArrayType.php
@@ -41,8 +41,8 @@ class FloatToFloatArrayType extends BaseType
return false;
- foreach ($value as $key => $value) {
- if ( filter_var($key, FILTER_VALIDATE_FLOAT) === false || filter_var($value, FILTER_VALIDATE_FLOAT) === false ) {
+ foreach ($value as $key => $val) {
+ if ( filter_var($key, FILTER_VALIDATE_FLOAT) === false || filter_var($val, FILTER_VALIDATE_FLOAT) === false ) {
return false;
}
}
diff --git a/install/faker.php b/install/faker.php
index 4d2cc3c85..5df84b32f 100644
--- a/install/faker.php
+++ b/install/faker.php
@@ -101,6 +101,10 @@ try {
->find();
$customer->delete();
+ $admin = Thelia\Model\AdminQuery::create()
+ ->find();
+ $admin->delete();
+
$folder = Thelia\Model\FolderQuery::create()
->find();
$folder->delete();
@@ -183,6 +187,17 @@ try {
;
}
+ for ($i=0; $i<3; $i++) {
+ $admin = new Thelia\Model\Admin();
+ $admin
+ ->setFirstname($faker->firstname)
+ ->setLastname($faker->lastname)
+ ->setLogin($faker->firstname)
+ ->setPassword('azerty')
+ ->setLocale('en_US')
+ ->save();
+ }
+
for ($i = 0; $i < 50; $i++) {
$customer = new Thelia\Model\Customer();
$customer->createOrUpdate(
@@ -509,11 +524,11 @@ function createProduct($faker, Thelia\Model\Category $category, $position, $temp
$image = new \Thelia\Model\ProductImage();
$image->setProductId($productId);
- generate_image($image, 1, 'product', $productId);
+ generate_image($image, 'product', $productId);
$document = new \Thelia\Model\ProductDocument();
$document->setProductId($productId);
- generate_document($document, 1, 'product', $productId);
+ generate_document($document, 'product', $productId);
return $product;
}
diff --git a/local/modules/Front/Controller/CartController.php b/local/modules/Front/Controller/CartController.php
index 5750cb306..5985dedb5 100644
--- a/local/modules/Front/Controller/CartController.php
+++ b/local/modules/Front/Controller/CartController.php
@@ -121,7 +121,7 @@ class CartController extends BaseFrontController
*/
protected function getCartEvent()
{
- $cart = $this->getCart($this->getRequest());
+ $cart = $this->getCart($this->getDispatcher(), $this->getRequest());
return new CartEvent($cart);
}
diff --git a/local/modules/Front/Controller/CustomerController.php b/local/modules/Front/Controller/CustomerController.php
index 2b2d38696..e66a6e2a8 100644
--- a/local/modules/Front/Controller/CustomerController.php
+++ b/local/modules/Front/Controller/CustomerController.php
@@ -125,7 +125,7 @@ class CustomerController extends BaseFrontController
$this->processLogin($customerCreateEvent->getCustomer());
- $cart = $this->getCart($this->getRequest());
+ $cart = $this->getCart($this->getDispatcher(), $this->getRequest());
if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute('cart.view');
} else {
diff --git a/local/modules/TheliaDebugBar/Config/config.xml b/local/modules/TheliaDebugBar/Config/config.xml
index 564c17e66..28a560de9 100644
--- a/local/modules/TheliaDebugBar/Config/config.xml
+++ b/local/modules/TheliaDebugBar/Config/config.xml
@@ -39,7 +39,9 @@
-
+
+ %kernel.debug%
+
diff --git a/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php b/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php
index 5ea75a1df..190844e40 100644
--- a/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php
+++ b/local/modules/TheliaDebugBar/Listeners/DebugBarListeners.php
@@ -24,12 +24,11 @@
namespace TheliaDebugBar\Listeners;
use DebugBar\DataCollector\MemoryCollector;
-use DebugBar\DataCollector\MessagesCollector;
use DebugBar\DataCollector\PhpInfoCollector;
+use DebugBar\DebugBar;
use TheliaDebugBar\DataCollector\PropelCollector;
use DebugBar\DataCollector\TimeDataCollector;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpKernel\KernelEvents;
use Thelia\Action\BaseAction;
use Thelia\Core\Event\TheliaEvents;
@@ -41,21 +40,28 @@ use Thelia\Core\Event\TheliaEvents;
*/
class DebugBarListeners extends BaseAction implements EventSubscriberInterface {
+ protected $debugBar;
+ protected $debugMode;
+
+ public function __construct(DebugBar $debugbar, $debugMode)
+ {
+ $this->debugBar = $debugbar;
+ $this->debugMode = $debugMode;
+ }
+
public function initDebugBar()
{
- $debugBar = $this->container->get("debugBar");
-
$alternativelogger = null;
- if($this->container->getParameter('kernel.debug')) {
+ if($this->debugMode) {
$alternativelogger = \Thelia\Log\Tlog::getInstance();
}
- $debugBar->addCollector(new PhpInfoCollector());
- //$debugBar->addCollector(new MessagesCollector());
- //$debugBar->addCollector(new RequestDataCollector());
- $debugBar->addCollector(new TimeDataCollector());
- $debugBar->addCollector(new MemoryCollector());
- $debugBar->addCollector(new PropelCollector($alternativelogger));
+ $this->debugBar->addCollector(new PhpInfoCollector());
+ //$this->debugBar->addCollector(new MessagesCollector());
+ //$this->debugBar->addCollector(new RequestDataCollector());
+ $this->debugBar->addCollector(new TimeDataCollector());
+ $this->debugBar->addCollector(new MemoryCollector());
+ $this->debugBar->addCollector(new PropelCollector($alternativelogger));
}
/**
diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html
index 1885d8201..8f3fc4e40 100644
--- a/templates/backOffice/default/category-edit.html
+++ b/templates/backOffice/default/category-edit.html
@@ -261,7 +261,23 @@
- {module_include location='category-edit'}
+
+ {include
+ file = "includes/inner-form-toolbar.html"
+ hide_submit_buttons = true
+ page_url = {$pageUrl}
+ close_url = {$closeUrl}
+ current_tab = "modules"
+ }
+
+
+ {module_include location='category-edit' countvar='module_count'}
+
+ {if $countvar == 0}
+
+ {intl l="There is currently no active module here."}
+
+ {/if}
diff --git a/templates/backOffice/default/content-edit.html b/templates/backOffice/default/content-edit.html
index 1014d512c..49c8f6b66 100644
--- a/templates/backOffice/default/content-edit.html
+++ b/templates/backOffice/default/content-edit.html
@@ -97,7 +97,7 @@
{$myparent=$DEFAULT_FOLDER}
{loop name="fold-parent" type="folder-tree" visible="*" folder="0"}
- {/loop }
+ {/loop}
@@ -156,7 +156,23 @@
- {module_include location='content-edit'}
+
+ {include
+ file = "includes/inner-form-toolbar.html"
+ hide_submit_buttons = true
+ page_url = {$pageUrl}
+ close_url = {$closeUrl}
+ current_tab = "modules"
+ }
+
+
+ {module_include location='content-edit' countvar='module_count'}
+
+ {if $countvar == 0}
+
+ {intl l="There is currently no active module here."}
+
+ {/if}
diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html
index e86790634..bff41f094 100644
--- a/templates/backOffice/default/folder-edit.html
+++ b/templates/backOffice/default/folder-edit.html
@@ -142,7 +142,23 @@
- {module_include location='folder-edit'}
+
+ {include
+ file = "includes/inner-form-toolbar.html"
+ hide_submit_buttons = true
+ page_url = {$pageUrl}
+ close_url = {$closeUrl}
+ current_tab = "modules"
+ }
+
+
+ {module_include location='folder-edit' countvar='module_count'}
+
+ {if $countvar == 0}
+
+ {intl l="There is currently no active module here."}
+
+ {/if}
diff --git a/templates/backOffice/default/includes/inner-form-toolbar.html b/templates/backOffice/default/includes/inner-form-toolbar.html
index 6e7835e73..92bee1af8 100644
--- a/templates/backOffice/default/includes/inner-form-toolbar.html
+++ b/templates/backOffice/default/includes/inner-form-toolbar.html
@@ -16,7 +16,12 @@ Parameters:
{loop name="lang_list" type="lang"}
-
-
+ {if $current_tab}
+ {$lang_url = {url path={$page_url|default:$current_url nofilter} edit_language_id=$ID current_tab=$current_tab}}
+ {else}
+ {$lang_url = {url path={$page_url|default:$current_url nofilter} edit_language_id=$ID}}
+ {/if}
+
diff --git a/templates/backOffice/default/includes/seo-tab.html b/templates/backOffice/default/includes/seo-tab.html
index 16b31ecb7..17d64575c 100644
--- a/templates/backOffice/default/includes/seo-tab.html
+++ b/templates/backOffice/default/includes/seo-tab.html
@@ -7,6 +7,7 @@
hide_submit_buttons = false
page_url = {$pageUrl}
close_url = {$closeUrl}
+ current_tab = "seo"
}
{* Hidden field *}
diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html
index 7a91f2647..0eb56fed4 100644
--- a/templates/backOffice/default/product-edit.html
+++ b/templates/backOffice/default/product-edit.html
@@ -109,7 +109,23 @@
- {module_include location='product-edit'}
+
+ {include
+ file = "includes/inner-form-toolbar.html"
+ hide_submit_buttons = true
+ page_url = {$pageUrl}
+ close_url = {$closeUrl}
+ current_tab = "modules"
+ }
+
+
+ {module_include location='product-edit' countvar='module_count'}
+
+ {if $countvar == 0}
+
+ {intl l="There is currently no active module here."}
+
+ {/if}
diff --git a/web/.htaccess b/web/.htaccess
index 58a870286..3840d727a 100755
--- a/web/.htaccess
+++ b/web/.htaccess
@@ -5,8 +5,6 @@ AddDefaultCharset UTF-8
RewriteEngine On
- RewriteBase /thelia2
-
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d