Merge pull request #139 from thelia/frontend

SEO - META TITLE / DESCRIPTION AND KEYWORDS
This commit is contained in:
Manuel Raynaud
2013-12-17 00:36:01 -08:00
72 changed files with 4323 additions and 2198 deletions

View File

@@ -23,9 +23,14 @@
namespace Thelia\Action;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Thelia\Model\AdminLog;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use \Thelia\Model\Tools\UrlRewritingTrait;
class BaseAction
{
@@ -73,4 +78,41 @@ class BaseAction
return $object->movePositionDown();
}
}
/**
* Changes SEO Fields for an object.
*
* @param ModelCriteria $query
* @param UpdateSeoEvent $event
*
* @return mixed
*/
protected function genericUpdateSeo(ModelCriteria $query, UpdateSeoEvent $event)
{
if (null !== $object = $query->findPk($event->getObjectId())) {
$object
->setDispatcher($this->getDispatcher())
->setLocale($event->getLocale())
->setMetaTitle($event->getMetaTitle())
->setMetaDescription($event->getMetaDescription())
->setMetaKeywords($event->getMetaKeywords())
->save()
;
// Update the rewritten URL, if required
try {
$object->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
$event->setObject($object);
return $object;
}
}
}

View File

@@ -25,8 +25,7 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Model\CategoryQuery;
use Thelia\Model\Category as CategoryModel;
@@ -74,8 +73,6 @@ class Category extends BaseAction implements EventSubscriberInterface
*/
public function update(CategoryUpdateEvent $event)
{
$search = CategoryQuery::create();
if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
$category
@@ -92,17 +89,22 @@ class Category extends BaseAction implements EventSubscriberInterface
->save();
// Update the rewritten URL, if required
try {
$category->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
$event->setCategory($category);
}
}
/**
* Change a Category SEO
*
* @param \Thelia\Core\Event\UpdateSeoEvent $event
*
* @return mixed
*/
public function updateSeo(UpdateSeoEvent $event)
{
return $this->genericUpdateSeo(CategoryQuery::create(), $event);
}
/**
* Delete a category entry
*
@@ -190,6 +192,7 @@ class Category extends BaseAction implements EventSubscriberInterface
TheliaEvents::CATEGORY_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::CATEGORY_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::CATEGORY_UPDATE_SEO => array("updateSeo", 128),
TheliaEvents::CATEGORY_ADD_CONTENT => array("addContent", 128),
TheliaEvents::CATEGORY_REMOVE_CONTENT => array("removeContent", 128),

View File

@@ -32,8 +32,7 @@ use Thelia\Core\Event\Content\ContentToggleVisibilityEvent;
use Thelia\Core\Event\Content\ContentUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Model\ContentFolder;
use Thelia\Model\ContentFolderQuery;
use Thelia\Model\ContentQuery;
@@ -81,19 +80,24 @@ class Content extends BaseAction implements EventSubscriberInterface
->save()
;
// Update the rewritten URL, if required
try {
$content->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
$content->updateDefaultFolder($event->getDefaultFolder());
$event->setContent($content);
}
}
/**
* Change Content SEO
*
* @param \Thelia\Core\Event\UpdateSeoEvent $event
*
* @return mixed
*/
public function updateSeo(UpdateSeoEvent $event)
{
return $this->genericUpdateSeo(ContentQuery::create(), $event);
}
public function updatePosition(UpdatePositionEvent $event)
{
if (null !== $content = ContentQuery::create()->findPk($event->getObjectId())) {
@@ -203,6 +207,7 @@ class Content extends BaseAction implements EventSubscriberInterface
TheliaEvents::CONTENT_TOGGLE_VISIBILITY => array('toggleVisibility', 128),
TheliaEvents::CONTENT_UPDATE_POSITION => array('updatePosition', 128),
TheliaEvents::CONTENT_UPDATE_SEO => array('updateSeo', 128),
TheliaEvents::CONTENT_ADD_FOLDER => array('addFolder', 128),
TheliaEvents::CONTENT_REMOVE_FOLDER => array('removeFolder', 128),

View File

@@ -29,8 +29,7 @@ use Thelia\Core\Event\Folder\FolderToggleVisibilityEvent;
use Thelia\Core\Event\Folder\FolderUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Model\FolderQuery;
use Thelia\Model\Folder as FolderModel;
@@ -58,17 +57,22 @@ class Folder extends BaseAction implements EventSubscriberInterface
->save();
;
// Update the rewritten URL, if required
try {
$folder->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
$event->setFolder($folder);
}
}
/**
* Change Folder SEO
*
* @param \Thelia\Core\Event\UpdateSeoEvent $event
*
* @return mixed
*/
public function updateSeo(UpdateSeoEvent $event)
{
return $this->genericUpdateSeo(FolderQuery::create(), $event);
}
public function delete(FolderDeleteEvent $event)
{
if (null !== $folder = FolderQuery::create()->findPk($event->getFolderId())) {
@@ -158,6 +162,7 @@ class Folder extends BaseAction implements EventSubscriberInterface
TheliaEvents::FOLDER_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::FOLDER_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::FOLDER_UPDATE_SEO => array('updateSeo', 128)
);
}
}

View File

@@ -25,38 +25,37 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\Map\ProductTableMap;
use Thelia\Model\ProductQuery;
use Thelia\Model\Product as ProductModel;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Product\ProductUpdateEvent;
use Thelia\Core\Event\Product\ProductCreateEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Product\ProductToggleVisibilityEvent;
use Thelia\Core\Event\Product\ProductAddContentEvent;
use Thelia\Core\Event\Product\ProductDeleteContentEvent;
use Thelia\Model\ProductAssociatedContent;
use Thelia\Model\ProductAssociatedContentQuery;
use Thelia\Model\ProductCategory;
use Thelia\Model\TaxRuleQuery;
use Thelia\Model\AccessoryQuery;
use Thelia\Model\Accessory;
use Thelia\Core\Event\FeatureProduct\FeatureProductUpdateEvent;
use Thelia\Model\FeatureProduct;
use Thelia\Core\Event\FeatureProduct\FeatureProductDeleteEvent;
use Thelia\Model\FeatureProductQuery;
use Thelia\Model\ProductCategoryQuery;
use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Product\ProductUpdateEvent;
use Thelia\Core\Event\Product\ProductCreateEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Thelia\Core\Event\Product\ProductToggleVisibilityEvent;
use Thelia\Core\Event\Product\ProductAddContentEvent;
use Thelia\Core\Event\Product\ProductDeleteContentEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Core\Event\FeatureProduct\FeatureProductUpdateEvent;
use Thelia\Core\Event\FeatureProduct\FeatureProductDeleteEvent;
use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Core\Event\Product\ProductAddAccessoryEvent;
use Thelia\Core\Event\Product\ProductDeleteAccessoryEvent;
use Thelia\Model\Map\ProductTableMap;
use Propel\Runtime\Propel;
class Product extends BaseAction implements EventSubscriberInterface
@@ -115,13 +114,6 @@ class Product extends BaseAction implements EventSubscriberInterface
->save()
;
// Update the rewritten URL, if required
try {
$product->setRewrittenUrl($event->getLocale(), $event->getUrl());
} catch(UrlRewritingException $e) {
throw new FormValidationException($e->getMessage(), $e->getCode());
}
// Update default category (ifd required)
$product->updateDefaultCategory($event->getDefaultCategory());
@@ -129,6 +121,17 @@ class Product extends BaseAction implements EventSubscriberInterface
}
}
/**
* Change a product SEO
*
* @param \Thelia\Core\Event\UpdateSeoEvent $event
*/
public function updateSeo(UpdateSeoEvent $event)
{
return $this->genericUpdateSeo(ProductQuery::create(), $event);
}
/**
* Delete a product entry
*
@@ -389,12 +392,13 @@ class Product extends BaseAction implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
TheliaEvents::PRODUCT_CREATE => array("create", 128),
TheliaEvents::PRODUCT_UPDATE => array("update", 128),
TheliaEvents::PRODUCT_DELETE => array("delete", 128),
TheliaEvents::PRODUCT_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::PRODUCT_CREATE => array("create", 128),
TheliaEvents::PRODUCT_UPDATE => array("update", 128),
TheliaEvents::PRODUCT_DELETE => array("delete", 128),
TheliaEvents::PRODUCT_TOGGLE_VISIBILITY => array("toggleVisibility", 128),
TheliaEvents::PRODUCT_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::PRODUCT_UPDATE_POSITION => array("updatePosition", 128),
TheliaEvents::PRODUCT_UPDATE_SEO => array("updateSeo", 128),
TheliaEvents::PRODUCT_ADD_CONTENT => array("addContent", 128),
TheliaEvents::PRODUCT_REMOVE_CONTENT => array("removeContent", 128),
@@ -404,13 +408,13 @@ class Product extends BaseAction implements EventSubscriberInterface
TheliaEvents::PRODUCT_REMOVE_ACCESSORY => array("removeAccessory", 128),
TheliaEvents::PRODUCT_UPDATE_ACCESSORY_POSITION => array("updateAccessoryPosition", 128),
TheliaEvents::PRODUCT_ADD_CATEGORY => array("addCategory", 128),
TheliaEvents::PRODUCT_REMOVE_CATEGORY => array("removeCategory", 128),
TheliaEvents::PRODUCT_ADD_CATEGORY => array("addCategory", 128),
TheliaEvents::PRODUCT_REMOVE_CATEGORY => array("removeCategory", 128),
TheliaEvents::PRODUCT_SET_TEMPLATE => array("setProductTemplate", 128),
TheliaEvents::PRODUCT_SET_TEMPLATE => array("setProductTemplate", 128),
TheliaEvents::PRODUCT_FEATURE_UPDATE_VALUE => array("updateFeatureProductValue", 128),
TheliaEvents::PRODUCT_FEATURE_DELETE_VALUE => array("deleteFeatureProductValue", 128),
TheliaEvents::PRODUCT_FEATURE_UPDATE_VALUE => array("updateFeatureProductValue", 128),
TheliaEvents::PRODUCT_FEATURE_DELETE_VALUE => array("deleteFeatureProductValue", 128),
);
}
}

View File

@@ -17,6 +17,7 @@
<form name="thelia.front.newsletter" class="Thelia\Form\NewsletterForm"/>
<form name="thelia.admin.login" class="Thelia\Form\AdminLogin"/>
<form name="thelia.admin.seo" class="Thelia\Form\SeoForm"/>
<form name="thelia.admin.customer.create" class="Thelia\Form\CustomerCreateForm"/>
<form name="thelia.admin.customer.update" class="Thelia\Form\CustomerUpdateForm"/>
@@ -39,7 +40,6 @@
<form name="thelia.admin.product_default_sale_element.update" class="Thelia\Form\ProductDefaultSaleElementUpdateForm"/>
<form name="thelia.admin.product_combination.build" class="Thelia\Form\ProductCombinationGenerationForm"/>
<form name="thelia.admin.product.deletion" class="Thelia\Form\ProductModificationForm"/>
<form name="thelia.admin.folder.creation" class="Thelia\Form\FolderCreationForm"/>

View File

@@ -221,6 +221,10 @@
<default key="_controller">Thelia\Controller\Admin\CategoryController::processUpdateAction</default>
</route>
<route id="admin.categories.seo.save" path="/admin/categories/seo/save">
<default key="_controller">Thelia\Controller\Admin\CategoryController::processUpdateSeoAction</default>
</route>
<route id="admin.categories.set-default" path="/admin/categories/toggle-online">
<default key="_controller">Thelia\Controller\Admin\CategoryController::setToggleVisibilityAction</default>
</route>
@@ -237,7 +241,7 @@
<default key="_controller">Thelia\Controller\Admin\CategoryController::addRelatedContentAction</default>
</route>
<route id="admin.categories.related-content.add" path="/admin/categories/related-picture/add">
<route id="admin.categories.related-picture.add" path="/admin/categories/related-picture/add">
<default key="_controller">Thelia\Controller\Admin\CategoryController::addRelatedPictureAction</default>
</route>
@@ -273,6 +277,10 @@
<default key="_controller">Thelia\Controller\Admin\ProductController::processUpdateAction</default>
</route>
<route id="admin.products.seo.save" path="/admin/products/seo/save">
<default key="_controller">Thelia\Controller\Admin\ProductController::processUpdateSeoAction</default>
</route>
<route id="admin.products.set-default" path="/admin/products/toggle-online">
<default key="_controller">Thelia\Controller\Admin\ProductController::setToggleVisibilityAction</default>
</route>
@@ -424,6 +432,10 @@
<default key="_controller">Thelia\Controller\Admin\FolderController::processUpdateAction</default>
</route>
<route id="admin.folders.seo.save" path="/admin/folders/seo/save">
<default key="_controller">Thelia\Controller\Admin\FolderController::processUpdateSeoAction</default>
</route>
<route id="admin.folders.delete" path="/admin/folders/delete">
<default key="_controller">Thelia\Controller\Admin\FolderController::deleteAction</default>
</route>
@@ -446,6 +458,10 @@
<default key="_controller">Thelia\Controller\Admin\ContentController::processUpdateAction</default>
</route>
<route id="admin.content.seo.save" path="/admin/content/seo/save">
<default key="_controller">Thelia\Controller\Admin\ContentController::processUpdateSeoAction</default>
</route>
<route id="admin.content.update-position" path="/admin/content/update-position">
<default key="_controller">Thelia\Controller\Admin\ContentController::updatePositionAction</default>
</route>

View File

@@ -34,7 +34,7 @@ use Thelia\Core\Event\UpdatePositionEvent;
*/
abstract class AbstractCrudController extends BaseAdminController
{
protected $objectName;
protected $objectName;
// List ordering
protected $defaultListOrder;
@@ -139,7 +139,7 @@ abstract class AbstractCrudController extends BaseAdminController
/**
* Get the created object from an event.
*
* @param unknown $createEvent
* @param unknown $event
*/
abstract protected function getObjectFromEvent($event);
@@ -230,7 +230,7 @@ abstract class AbstractCrudController extends BaseAdminController
/**
* Put in this method post object position change processing if required.
*
* @param unknown $deleteEvent the delete event
* @param unknown $positionChangeEvent the delete event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalUpdatePositionAction($positionChangeEvent)
@@ -267,7 +267,10 @@ abstract class AbstractCrudController extends BaseAdminController
*/
public function defaultAction()
{
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::VIEW)) return $response;
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::VIEW))
return $response;
return $this->renderList();
}
@@ -279,8 +282,10 @@ abstract class AbstractCrudController extends BaseAdminController
public function createAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::CREATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::CREATE))
return $response;
// Error (Default: false)
$error_msg = false;
// Create the Creation Form
@@ -288,24 +293,29 @@ abstract class AbstractCrudController extends BaseAdminController
try {
// Validate the form, create the event and dispatch it.
// Check the form against constraints violations
$form = $this->validateForm($creationForm, "POST");
// Get the form field values
$data = $form->getData();
// Create a new event object with the modified fields
$createEvent = $this->getCreationEvent($data);
// Dispatch Create Event
$this->dispatch($this->createEventIdentifier, $createEvent);
// Check if object exist
if (! $this->eventContainsObject($createEvent))
throw new \LogicException(
$this->getTranslator()->trans("No %obj was created.", array('%obj', $this->objectName)));
$this->getTranslator()->trans("No %obj was created.", array('%obj', $this->objectName)));
// Log object creation
if (null !== $createdObject = $this->getObjectFromEvent($createEvent)) {
// Log object creation
$this->adminLogAppend($this->resourceCode, AccessManager::CREATE, sprintf("%s %s (ID %s) created", ucfirst($this->objectName), $this->getObjectLabel($createdObject), $this->getObjectId($createdObject)));
}
// Execute additional Action
$response = $this->performAdditionalCreateAction($createEvent);
if ($response == null) {
@@ -326,7 +336,11 @@ abstract class AbstractCrudController extends BaseAdminController
}
$this->setupFormErrorContext(
$this->getTranslator()->trans("%obj creation", array('%obj' => $this->objectName)), $error_msg, $creationForm, $ex);
$this->getTranslator()->trans("%obj creation", array('%obj' => $this->objectName)),
$error_msg,
$creationForm,
$ex
);
// At this point, the form has error, and should be redisplayed.
return $this->renderList();
@@ -340,12 +354,11 @@ abstract class AbstractCrudController extends BaseAdminController
public function updateAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
// Load the object
$object = $this->getExistingObject();
if ($object != null) {
// Load object if exist
if (null !== $object = $this->getExistingObject()) {
// Hydrate the form abd pass it to the parser
$changeForm = $this->hydrateObjectForm($object);
@@ -366,11 +379,13 @@ abstract class AbstractCrudController extends BaseAdminController
public function processUpdateAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
// Error (Default: false)
$error_msg = false;
// Create the form from the request
// Create the Form from the request
$changeForm = $this->getUpdateForm($this->getRequest());
try {
@@ -381,23 +396,27 @@ abstract class AbstractCrudController extends BaseAdminController
// Get the form field values
$data = $form->getData();
// Create a new event object with the modified fields
$changeEvent = $this->getUpdateEvent($data);
// Dispatch Update Event
$this->dispatch($this->updateEventIdentifier, $changeEvent);
// Check if object exist
if (! $this->eventContainsObject($changeEvent))
throw new \LogicException(
$this->getTranslator()->trans("No %obj was updated.", array('%obj', $this->objectName)));
$this->getTranslator()->trans("No %obj was updated.", array('%obj', $this->objectName)));
// Log object modification
if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
}
// Execute additional Action
$response = $this->performAdditionalUpdateAction($changeEvent);
if ($response == null) {
// If we have to stay on the same page, do not redirect to the succesUrl,
// If we have to stay on the same page, do not redirect to the successUrl,
// just redirect to the edit page again.
if ($this->getRequest()->get('save_mode') == 'stay') {
$this->redirectToEditionTemplate($this->getRequest());
@@ -416,11 +435,16 @@ abstract class AbstractCrudController extends BaseAdminController
$error_msg = $ex->getMessage();*/
}
$this->setupFormErrorContext(
$this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)), $error_msg, $changeForm, $ex);
// At this point, the form has errors, and should be redisplayed.
return $this->renderEditionTemplate();
$this->setupFormErrorContext(
$this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)),
$error_msg,
$changeForm,
$ex
);
//return $this->renderEditionTemplate();
}
/**
@@ -431,7 +455,8 @@ abstract class AbstractCrudController extends BaseAdminController
public function updatePositionAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
try {
$mode = $this->getRequest()->get('mode', null);
@@ -448,6 +473,7 @@ abstract class AbstractCrudController extends BaseAdminController
$event = $this->createUpdatePositionEvent($mode, $position);
$this->dispatch($this->changePositionEventIdentifier, $event);
} catch (\Exception $ex) {
// Any error
return $this->errorPage($ex);
@@ -465,7 +491,8 @@ abstract class AbstractCrudController extends BaseAdminController
protected function genericUpdatePositionAction($object, $eventName, $doFinalRedirect = true)
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
if ($object != null) {
@@ -499,7 +526,8 @@ abstract class AbstractCrudController extends BaseAdminController
public function setToggleVisibilityAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
$changeEvent = $this->createToggleVisibilityEvent($this->getRequest());
@@ -521,7 +549,8 @@ abstract class AbstractCrudController extends BaseAdminController
public function deleteAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::DELETE)) return $response;
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::DELETE))
return $response;
// Get the currency id, and dispatch the delet request
$deleteEvent = $this->getDeleteEvent();

View File

@@ -0,0 +1,235 @@
<?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\Controller\Admin;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Core\Security\AccessManager;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Form\SeoForm;
/**
* Extend abstract CRUD controller to manage basic CRUD + SEO operations on a given object.
*
* @author Christophe Laffont <claffont@openstudio.fr>
*/
abstract class AbstractSeoCrudController extends AbstractCrudController
{
// Events
protected $updateSeoEventIdentifier;
/**
* @param string $objectName the lower case object name. Example. "message"
*
* @param string $defaultListOrder the default object list order, or null if list is not sortable. Example: manual
* @param string $orderRequestParameterName Name of the request parameter that set the list order (null if list is not sortable)
*
* @param string $resourceCode the 'resource' code. Example: "admin.configuration.message"
*
* @param string $createEventIdentifier the dispatched create TheliaEvent identifier. Example: TheliaEvents::MESSAGE_CREATE
* @param string $updateEventIdentifier the dispatched update TheliaEvent identifier. Example: TheliaEvents::MESSAGE_UPDATE
* @param string $deleteEventIdentifier the dispatched delete TheliaEvent identifier. Example: TheliaEvents::MESSAGE_DELETE
*
* @param string $visibilityToggleEventIdentifier the dispatched visibility toggle TheliaEvent identifier, or null if the object has no visible options. Example: TheliaEvents::MESSAGE_TOGGLE_VISIBILITY
* @param string $changePositionEventIdentifier the dispatched position change TheliaEvent identifier, or null if the object has no position. Example: TheliaEvents::MESSAGE_UPDATE_POSITION
* @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO
*/
public function __construct(
$objectName,
$defaultListOrder = null,
$orderRequestParameterName = null,
$resourceCode,
$createEventIdentifier,
$updateEventIdentifier,
$deleteEventIdentifier,
$visibilityToggleEventIdentifier = null,
$changePositionEventIdentifier = null,
$updateSeoEventIdentifier = null
)
{
parent::__construct(
$objectName,
$defaultListOrder,
$orderRequestParameterName,
$resourceCode,
$createEventIdentifier,
$updateEventIdentifier,
$deleteEventIdentifier,
$visibilityToggleEventIdentifier,
$changePositionEventIdentifier
);
$this->updateSeoEventIdentifier = $updateSeoEventIdentifier;
}
/**
* Put in this method post object update SEO processing if required.
*
* @param unknown $updateSeoEvent the update event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalUpdateSeoAction($updateSeoEvent)
{
return null;
}
/**
* Return the update SEO form for this object
*/
protected function getUpdateSeoForm()
{
return new SeoForm($this->getRequest());
}
/**
* Creates the update SEO event with the provided form data
*
* @param $formData
* @return UpdateSeoEvent
*/
protected function getUpdateSeoEvent($formData)
{
$updateSeoEvent = new UpdateSeoEvent($formData['id']);
$updateSeoEvent
->setLocale($formData['locale'])
->setMetaTitle($formData['meta_title'])
->setMetaDescription($formData['meta_description'])
->setMetaKeywords($formData['meta_keywords'])
->setUrl($formData['url'])
;
// Create and dispatch the change event
return $updateSeoEvent;
}
/**
* Hydrate the SEO form for this object, before passing it to the update template
*
* @param unknown $object
*/
protected function hydrateSeoForm($object){
// The "SEO" tab form
$locale = $object->getLocale();
$data = array(
'id' => $object->getId(),
'locale' => $locale,
'url' => $object->getRewrittenUrl($locale),
'meta_title' => $object->getMetaTitle(),
'meta_description' => $object->getMetaDescription(),
'meta_keywords' => $object->getMetaKeywords()
);
$seoForm = new SeoForm($this->getRequest(), "form", $data);
$this->getParserContext()->addForm($seoForm);
// URL based on the language
$this->getParserContext()->set('url_language', $this->getUrlLanguage($locale));
}
/**
* Update SEO modification, and either go back to the object list, or stay on the edition page.
*
* @return Thelia\Core\HttpFoundation\Response the response
*/
public function processUpdateSeoAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE))
return $response;
// Error (Default: false)
$error_msg = false;
// Create the Form from the request
$updateSeoForm = $this->getUpdateSeoForm($this->getRequest());
// Pass the object id to the request
$this->getRequest()->attributes->set($this->objectName . '_id', $this->getRequest()->get('current_id'));
try {
// Check the form against constraints violations
$form = $this->validateForm($updateSeoForm, "POST");
// Get the form field values
$data = $form->getData();
// Create a new event object with the modified fields
$updateSeoEvent = $this->getUpdateSeoEvent($data);
// Dispatch Update SEO Event
$this->dispatch($this->updateSeoEventIdentifier, $updateSeoEvent);
// Execute additional Action
$response = $this->performAdditionalUpdateSeoAction($updateSeoEvent);
if ($response == null) {
// If we have to stay on the same page, do not redirect to the successUrl,
// just redirect to the edit page again.
if ($this->getRequest()->get('save_mode') == 'stay') {
$this->redirectToEditionTemplate($this->getRequest());
}
// Redirect to the success URL
$this->redirect($updateSeoForm->getSuccessUrl());
} else {
return $response;
}
} catch (FormValidationException $ex) {
// Form cannot be validated
$error_msg = $this->createStandardFormValidationErrorMessage($ex);
/*} catch (\Exception $ex) {
// Any other error
$error_msg = $ex->getMessage();*/
}
// Load object if exist
if (null !== $object = $this->getExistingObject()) {
// Hydrate the form abd pass it to the parser
$changeForm = $this->hydrateObjectForm($object);
// Pass it to the parser
$this->getParserContext()->addForm($changeForm);
}
$this->setupFormErrorContext(
$this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)),
$error_msg,
$updateSeoForm,
$ex
);
// At this point, the form has errors, and should be redisplayed.
return $this->renderEditionTemplate();
}
}

View File

@@ -302,6 +302,23 @@ class BaseAdminController extends BaseController
return $this->getCurrentEditionLang()->getLocale();
}
/**
* A simple helper to get the URL based on the language.
*/
protected function getUrlLanguage($locale = null)
{
// Check if the functionality is activated
if(!ConfigQuery::read("one_domain_foreach_lang", false))
return;
// If we don't have a locale value, use the locale value in the session
if(!$locale)
$locale = $this->getCurrentEditionLocale();
return LangQuery::create()->findOneByLocale($locale)->getUrl();
}
/**
* Return the current list order identifier for a given object name,
* updating in using the current request.

View File

@@ -47,7 +47,7 @@ use Thelia\Model\CategoryAssociatedContentQuery;
*
* @author Franck Allimant <franck@cqfdev.fr>
*/
class CategoryController extends AbstractCrudController
class CategoryController extends AbstractSeoCrudController
{
public function __construct()
{
@@ -62,7 +62,8 @@ class CategoryController extends AbstractCrudController
TheliaEvents::CATEGORY_UPDATE,
TheliaEvents::CATEGORY_DELETE,
TheliaEvents::CATEGORY_TOGGLE_VISIBILITY,
TheliaEvents::CATEGORY_UPDATE_POSITION
TheliaEvents::CATEGORY_UPDATE_POSITION,
TheliaEvents::CATEGORY_UPDATE_SEO
);
}
@@ -102,7 +103,6 @@ class CategoryController extends AbstractCrudController
->setDescription($formData['description'])
->setPostscriptum($formData['postscriptum'])
->setVisible($formData['visible'])
->setUrl($formData['url'])
->setParent($formData['parent'])
;
@@ -130,7 +130,10 @@ class CategoryController extends AbstractCrudController
protected function hydrateObjectForm($object)
{
// Prepare the data that will hydrate the form
// Hydrate the "SEO" tab form
$this->hydrateSeoForm($object);
// The "General" tab form
$data = array(
'id' => $object->getId(),
'locale' => $object->getLocale(),
@@ -139,7 +142,6 @@ class CategoryController extends AbstractCrudController
'description' => $object->getDescription(),
'postscriptum' => $object->getPostscriptum(),
'visible' => $object->getVisible(),
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
'parent' => $object->getParent()
);
@@ -193,10 +195,25 @@ class CategoryController extends AbstractCrudController
protected function redirectToListTemplate()
{
$this->redirectToRoute(
$category_id = $this->getRequest()->get('category_id', 0);
$this->redirectToListTemplateWithId($category_id);
}
protected function redirectToListTemplateWithId($category_id)
{
if($category_id > 0)
{
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $this->getRequest()->get('category_id', 0))
);
array('category_id' => $category_id)
);
}
else
{
$this->redirectToRoute(
'admin.catalog'
);
}
}
protected function renderEditionTemplate()
@@ -233,21 +250,16 @@ class CategoryController extends AbstractCrudController
protected function performAdditionalDeleteAction($deleteEvent)
{
// Redirect to parent category list
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $deleteEvent->getCategory()->getParent())
);
$category_id = $deleteEvent->getCategory()->getParent();
$this->redirectToListTemplateWithId($category_id);
}
protected function performAdditionalUpdateAction($updateEvent)
{
if ($this->getRequest()->get('save_mode') != 'stay') {
// Redirect to parent category list
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $updateEvent->getCategory()->getParent())
);
$category_id = $updateEvent->getCategory()->getParent();
$this->redirectToListTemplateWithId($category_id);
}
}
@@ -258,10 +270,8 @@ class CategoryController extends AbstractCrudController
if ($category != null) {
// Redirect to parent category list
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $category->getParent())
);
$category_id = $category->getParent();
$this->redirectToListTemplateWithId($category_id);
}
return null;

View File

@@ -41,7 +41,7 @@ use Thelia\Model\ContentQuery;
* @package Thelia\Controller\Admin
* @author manuel raynaud <mraynaud@openstudio.fr>
*/
class ContentController extends AbstractCrudController
class ContentController extends AbstractSeoCrudController
{
public function __construct()
@@ -57,7 +57,8 @@ class ContentController extends AbstractCrudController
TheliaEvents::CONTENT_UPDATE,
TheliaEvents::CONTENT_DELETE,
TheliaEvents::CONTENT_TOGGLE_VISIBILITY,
TheliaEvents::CONTENT_UPDATE_POSITION
TheliaEvents::CONTENT_UPDATE_POSITION,
TheliaEvents::CONTENT_UPDATE_SEO
);
}
@@ -140,6 +141,9 @@ class ContentController extends AbstractCrudController
*/
protected function hydrateObjectForm($object)
{
// Hydrate the "SEO" tab form
$this->hydrateSeoForm($object);
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -148,8 +152,7 @@ class ContentController extends AbstractCrudController
'chapo' => $object->getChapo(),
'description' => $object->getDescription(),
'postscriptum' => $object->getPostscriptum(),
'visible' => $object->getVisible(),
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
'visible' => $object->getVisible()
);
// Setup the object form
@@ -191,7 +194,6 @@ class ContentController extends AbstractCrudController
->setDescription($formData['description'])
->setPostscriptum($formData['postscriptum'])
->setVisible($formData['visible'])
->setUrl($formData['url'])
->setDefaultFolder($formData['default_folder']);
return $contentUpdateEvent;

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Folder\FolderCreateEvent;
use Thelia\Core\Event\Folder\FolderDeleteEvent;
@@ -38,7 +39,7 @@ use Thelia\Model\FolderQuery;
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class FolderController extends AbstractCrudController
class FolderController extends AbstractSeoCrudController
{
public function __construct()
@@ -54,7 +55,8 @@ class FolderController extends AbstractCrudController
TheliaEvents::FOLDER_UPDATE,
TheliaEvents::FOLDER_DELETE,
TheliaEvents::FOLDER_TOGGLE_VISIBILITY,
TheliaEvents::FOLDER_UPDATE_POSITION
TheliaEvents::FOLDER_UPDATE_POSITION,
TheliaEvents::FOLDER_UPDATE_SEO
);
}
@@ -81,6 +83,9 @@ class FolderController extends AbstractCrudController
*/
protected function hydrateObjectForm($object)
{
// Hydrate the "SEO" tab form
$this->hydrateSeoForm($object);
// Prepare the data that will hydrate the form
$data = array(
'id' => $object->getId(),
@@ -90,7 +95,6 @@ class FolderController extends AbstractCrudController
'description' => $object->getDescription(),
'postscriptum' => $object->getPostscriptum(),
'visible' => $object->getVisible(),
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
'parent' => $object->getParent()
);
@@ -132,7 +136,6 @@ class FolderController extends AbstractCrudController
->setDescription($formData['description'])
->setPostscriptum($formData['postscriptum'])
->setVisible($formData['visible'])
->setUrl($formData['url'])
->setParent($formData['parent'])
;
@@ -247,11 +250,15 @@ class FolderController extends AbstractCrudController
return $this->render('folder-edit', $this->getEditionArguments());
}
protected function getEditionArguments()
protected function getEditionArguments(Request $request = null)
{
if (null === $request) {
$request = $this->getRequest();
}
return array(
'folder_id' => $this->getRequest()->get('folder_id', 0),
'current_tab' => $this->getRequest()->get('current_tab', 'general')
'folder_id' => $request->get('folder_id', 0),
'current_tab' => $request->get('current_tab', 'general')
);
}
@@ -309,9 +316,9 @@ class FolderController extends AbstractCrudController
/**
* Redirect to the edition template
*/
protected function redirectToEditionTemplate()
protected function redirectToEditionTemplate(Request $request = null)
{
$this->redirect($this->getRoute('admin.folders.update', $this->getEditionArguments()));
$this->redirect($this->getRoute('admin.folders.update', $this->getEditionArguments($request)));
}
/**

View File

@@ -23,57 +23,62 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Symfony\Component\HttpFoundation\JsonResponse;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Product\ProductUpdateEvent;
use Thelia\Core\Event\Product\ProductCreateEvent;
use Thelia\Core\Security\AccessManager;
use Thelia\Model\ProductQuery;
use Thelia\Form\ProductModificationForm;
use Thelia\Form\ProductCreationForm;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Thelia\Core\Event\Product\ProductToggleVisibilityEvent;
use Thelia\Core\Event\Product\ProductDeleteContentEvent;
use Thelia\Core\Event\Product\ProductAddContentEvent;
use Thelia\Model\FolderQuery;
use Thelia\Model\ContentQuery;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Model\ProductAssociatedContentQuery;
use Thelia\Model\AccessoryQuery;
use Thelia\Model\CategoryQuery;
use Thelia\Core\Event\Product\ProductAddAccessoryEvent;
use Thelia\Core\Event\Product\ProductDeleteAccessoryEvent;
use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Core\Event\Product\ProductCombinationGenerationEvent;
use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\ProductSaleElement\ProductSaleElementDeleteEvent;
use Thelia\Core\Event\ProductSaleElement\ProductSaleElementUpdateEvent;
use Thelia\Core\Event\ProductSaleElement\ProductSaleElementCreateEvent;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager;
use Thelia\Model\AccessoryQuery;
use Thelia\Model\CategoryQuery;
use Thelia\Model\FolderQuery;
use Thelia\Model\ContentQuery;
use Thelia\Model\AttributeQuery;
use Thelia\Model\AttributeAvQuery;
use Thelia\Form\ProductSaleElementUpdateForm;
use Thelia\Model\ProductQuery;
use Thelia\Model\ProductAssociatedContentQuery;
use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Model\ProductPriceQuery;
use Thelia\Form\ProductDefaultSaleElementUpdateForm;
use Thelia\Model\ProductPrice;
use Thelia\Model\Currency;
use Symfony\Component\HttpFoundation\JsonResponse;
use Thelia\TaxEngine\Calculator;
use Thelia\Model\Country;
use Thelia\Tools\NumberFormat;
use Thelia\Model\Product;
use Thelia\Model\CurrencyQuery;
use Thelia\Model\Country;
use Thelia\Model\Product;
use Thelia\Form\ProductCreationForm;
use Thelia\Form\ProductModificationForm;
use Thelia\Form\ProductSaleElementUpdateForm;
use Thelia\Form\ProductDefaultSaleElementUpdateForm;
use Thelia\Form\ProductCombinationGenerationForm;
use Thelia\Core\Event\Product\ProductCombinationGenerationEvent;
use Thelia\Core\Event\Product\ProductSetTemplateEvent;
use Thelia\TaxEngine\Calculator;
use Thelia\Tools\NumberFormat;
/**
* Manages products
*
* @author Franck Allimant <franck@cqfdev.fr>
*/
class ProductController extends AbstractCrudController
class ProductController extends AbstractSeoCrudController
{
public function __construct()
{
@@ -89,7 +94,8 @@ class ProductController extends AbstractCrudController
TheliaEvents::PRODUCT_DELETE,
TheliaEvents::PRODUCT_TOGGLE_VISIBILITY,
TheliaEvents::PRODUCT_UPDATE_POSITION
TheliaEvents::PRODUCT_UPDATE_POSITION,
TheliaEvents::PRODUCT_UPDATE_SEO
);
}
@@ -153,9 +159,9 @@ class ProductController extends AbstractCrudController
protected function getUpdateEvent($formData)
{
$changeEvent = new ProductUpdateEvent($formData['id']);
// Create and dispatch the change event
$changeEvent
->setLocale($formData['locale'])
->setTitle($formData['title'])
@@ -163,10 +169,10 @@ class ProductController extends AbstractCrudController
->setDescription($formData['description'])
->setPostscriptum($formData['postscriptum'])
->setVisible($formData['visible'])
->setUrl($formData['url'])
->setDefaultCategory($formData['default_category'])
;
;
// Create and dispatch the change event
return $changeEvent;
}
@@ -307,6 +313,9 @@ class ProductController extends AbstractCrudController
$this->getParserContext()->addForm($combinationPseForm);
}
// Hydrate the "SEO" tab form
$this->hydrateSeoForm($object);
// The "General" tab form
$data = array(
'id' => $object->getId(),
@@ -317,7 +326,6 @@ class ProductController extends AbstractCrudController
'description' => $object->getDescription(),
'postscriptum' => $object->getPostscriptum(),
'visible' => $object->getVisible(),
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
'default_category' => $object->getDefaultCategoryId()
);

View File

@@ -33,7 +33,6 @@ class CategoryUpdateEvent extends CategoryCreateEvent
protected $description;
protected $postscriptum;
protected $url;
protected $parent;
public function __construct($category_id)
@@ -89,18 +88,6 @@ class CategoryUpdateEvent extends CategoryCreateEvent
return $this;
}
public function getUrl()
{
return $this->url;
}
public function setUrl($url)
{
$this->url = $url;
return $this;
}
public function getParent()
{
return $this->parent;

View File

@@ -36,8 +36,6 @@ class ContentUpdateEvent extends ContentCreateEvent
protected $description;
protected $postscriptum;
protected $url;
public function __construct($content_id)
{
$this->content_id = $content_id;
@@ -123,24 +121,4 @@ class ContentUpdateEvent extends ContentCreateEvent
return $this->postscriptum;
}
/**
* @param mixed $url
*
* @return $this
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* @return mixed
*/
public function getUrl()
{
return $this->url;
}
}

View File

@@ -37,8 +37,6 @@ class FolderUpdateEvent extends FolderCreateEvent
protected $description;
protected $postscriptum;
protected $url;
public function __construct($folder_id)
{
$this->folder_id = $folder_id;
@@ -116,22 +114,4 @@ class FolderUpdateEvent extends FolderCreateEvent
return $this->postscriptum;
}
/**
* @param mixed $url
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* @return mixed
*/
public function getUrl()
{
return $this->url;
}
}

View File

@@ -33,7 +33,6 @@ class ProductUpdateEvent extends ProductCreateEvent
protected $description;
protected $postscriptum;
protected $url;
protected $parent;
public function __construct($product_id)
@@ -89,18 +88,6 @@ class ProductUpdateEvent extends ProductCreateEvent
return $this;
}
public function getUrl()
{
return $this->url;
}
public function setUrl($url)
{
$this->url = $url;
return $this;
}
public function getParent()
{
return $this->parent;

View File

@@ -160,6 +160,7 @@ final class TheliaEvents
const CATEGORY_DELETE = "action.deleteCategory";
const CATEGORY_TOGGLE_VISIBILITY = "action.toggleCategoryVisibility";
const CATEGORY_UPDATE_POSITION = "action.updateCategoryPosition";
const CATEGORY_UPDATE_SEO = "action.updateCategorySeo";
const CATEGORY_ADD_CONTENT = "action.categoryAddContent";
const CATEGORY_REMOVE_CONTENT = "action.categoryRemoveContent";
@@ -180,6 +181,7 @@ final class TheliaEvents
const FOLDER_DELETE = "action.deleteFolder";
const FOLDER_TOGGLE_VISIBILITY = "action.toggleFolderVisibility";
const FOLDER_UPDATE_POSITION = "action.updateFolderPosition";
const FOLDER_UPDATE_SEO = "action.updateFolderSeo";
const BEFORE_CREATEFOLDER = "action.before_createFolder";
const AFTER_CREATEFOLDER = "action.after_createFolder";
@@ -197,6 +199,7 @@ final class TheliaEvents
const CONTENT_DELETE = "action.deleteContent";
const CONTENT_TOGGLE_VISIBILITY = "action.toggleContentVisibility";
const CONTENT_UPDATE_POSITION = "action.updateContentPosition";
const CONTENT_UPDATE_SEO = "action.updateContentSeo";
const CONTENT_ADD_FOLDER = "action.contentAddFolder";
const CONTENT_REMOVE_FOLDER = "action.contentRemoveFolder";
@@ -269,6 +272,7 @@ final class TheliaEvents
const PRODUCT_DELETE = "action.deleteProduct";
const PRODUCT_TOGGLE_VISIBILITY = "action.toggleProductVisibility";
const PRODUCT_UPDATE_POSITION = "action.updateProductPosition";
const PRODUCT_UPDATE_SEO = "action.updateProductSeo";
const PRODUCT_ADD_CONTENT = "action.productAddContent";
const PRODUCT_REMOVE_CONTENT = "action.productRemoveContent";

View File

@@ -0,0 +1,188 @@
<?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;
class UpdateSeoEvent extends ActionEvent
{
protected $object_id;
protected $locale;
protected $url;
protected $meta_title;
protected $meta_description;
protected $meta_keywords;
protected $object;
/**
* @param $object_id
* @param null $locale
* @param null $url
* @param null $meta_title
* @param null $meta_description
* @param null $meta_keywords
*/
public function __construct($object_id, $locale = null, $url = null, $meta_title = null, $meta_description = null, $meta_keywords = null)
{
$this->object_id = $object_id;
$this->locale = $locale;
$this->url = $url;
$this->meta_title = $meta_title;
$this->meta_description = $meta_description;
$this->meta_keywords = $meta_keywords;
}
/**
* @return mixed
*/
public function getObjectId()
{
return $this->object_id;
}
/**
* @param $object_id
* @return $this
*/
public function setObjectId($object_id)
{
$this->object_id = $object_id;
return $this;
}
/**
* @return null
*/
public function getLocale()
{
return $this->locale;
}
/**
* @param $locale
* @return $this
*/
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
/**
* @return null
*/
public function getUrl()
{
return $this->url;
}
/**
* @param $url
* @return $this
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* @return null
*/
public function getMetaTitle()
{
return $this->meta_title;
}
/**
* @param $meta_title
* @return $this
*/
public function setMetaTitle($meta_title)
{
$this->meta_title = $meta_title;
return $this;
}
/**
* @return null
*/
public function getMetaDescription()
{
return $this->meta_description;
}
/**
* @param $meta_description
* @return $this
*/
public function setMetaDescription($meta_description)
{
$this->meta_description = $meta_description;
return $this;
}
/**
* @return null
*/
public function getMetaKeywords()
{
return $this->meta_keywords;
}
/**
* @param $meta_keywords
* @return $this
*/
public function setMetaKeywords($meta_keywords)
{
$this->meta_keywords = $meta_keywords;
return $this;
}
/**
* @param mixed $object
*/
public function setObject($object)
{
$this->object = $object;
return $this;
}
/**
* @return mixed
*/
public function getObject()
{
return $this->object;
}
}

View File

@@ -96,7 +96,7 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface
$search = CategoryQuery::create();
/* manage translations */
$this->configureI18nProcessing($search);
$this->configureI18nProcessing($search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'));
$id = $this->getId();
@@ -213,25 +213,28 @@ class Category extends BaseI18nLoop implements PropelSearchLoopInterface
$loopResultRow = new LoopResultRow($category);
$loopResultRow
->set("ID", $category->getId())
->set("IS_TRANSLATED",$category->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE",$this->locale)
->set("TITLE", $category->getVirtualColumn('i18n_TITLE'))
->set("CHAPO", $category->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION", $category->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM", $category->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT", $category->getParent())
->set("URL", $category->getUrl($this->locale))
->set("PRODUCT_COUNT", $category->countAllProducts())
->set("CHILD_COUNT", $category->countChild())
->set("VISIBLE", $category->getVisible() ? "1" : "0")
->set("POSITION", $category->getPosition())
->set("ID" , $category->getId())
->set("IS_TRANSLATED" ,$category->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE" ,$this->locale)
->set("TITLE" , $category->getVirtualColumn('i18n_TITLE'))
->set("CHAPO" , $category->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION" , $category->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM" , $category->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT" , $category->getParent())
->set("URL" , $category->getUrl($this->locale))
->set("META_TITLE" , $category->getVirtualColumn('i18n_META_TITLE'))
->set("META_DESCRIPTION" , $category->getVirtualColumn('i18n_META_DESCRIPTION'))
->set("META_KEYWORDS" , $category->getVirtualColumn('i18n_META_KEYWORDS'))
->set("PRODUCT_COUNT" , $category->countAllProducts())
->set("CHILD_COUNT" , $category->countChild())
->set("VISIBLE" , $category->getVisible() ? "1" : "0")
->set("POSITION" , $category->getPosition())
->set("HAS_PREVIOUS", $previous != null ? 1 : 0)
->set("HAS_NEXT" , $next != null ? 1 : 0)
->set("HAS_PREVIOUS" , $previous != null ? 1 : 0)
->set("HAS_NEXT" , $next != null ? 1 : 0)
->set("PREVIOUS", $previous != null ? $previous->getId() : -1)
->set("NEXT" , $next != null ? $next->getId() : -1)
->set("PREVIOUS" , $previous != null ? $previous->getId() : -1)
->set("NEXT" , $next != null ? $next->getId() : -1)
;
$loopResult->addRow($loopResultRow);

View File

@@ -85,7 +85,7 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface
$search = ContentQuery::create();
/* manage translations */
$this->configureI18nProcessing($search);
$this->configureI18nProcessing($search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'));
$id = $this->getId();
@@ -215,17 +215,21 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface
foreach ($loopResult->getResultDataCollection() as $content) {
$loopResultRow = new LoopResultRow($content);
$loopResultRow->set("ID", $content->getId())
->set("IS_TRANSLATED",$content->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE",$this->locale)
->set("TITLE",$content->getVirtualColumn('i18n_TITLE'))
->set("CHAPO", $content->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION", $content->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM", $content->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("POSITION", $content->getPosition())
->set("DEFAULT_FOLDER", $content->getDefaultFolderId())
->set("URL", $content->getUrl($this->locale))
->set("VISIBLE", $content->getVisible())
$loopResultRow->set("ID" , $content->getId())
->set("IS_TRANSLATED" , $content->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE" , $this->locale)
->set("TITLE" , $content->getVirtualColumn('i18n_TITLE'))
->set("CHAPO" , $content->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION" , $content->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM" , $content->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("URL" , $content->getUrl($this->locale))
->set("META_TITLE" , $content->getVirtualColumn('i18n_META_TITLE'))
->set("META_DESCRIPTION" , $content->getVirtualColumn('i18n_META_DESCRIPTION'))
->set("META_KEYWORDS" , $content->getVirtualColumn('i18n_META_KEYWORDS'))
->set("POSITION" , $content->getPosition())
->set("DEFAULT_FOLDER" , $content->getDefaultFolderId())
->set("VISIBLE" , $content->getVisible())
;
$loopResult->addRow($loopResultRow);

View File

@@ -78,7 +78,7 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface
$search = FolderQuery::create();
/* manage translations */
$this->configureI18nProcessing($search);
$this->configureI18nProcessing($search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'));
$id = $this->getId();
@@ -164,19 +164,22 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface
$loopResultRow = new LoopResultRow($folder);
$loopResultRow
->set("ID", $folder->getId())
->set("IS_TRANSLATED",$folder->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE",$this->locale)
->set("TITLE",$folder->getVirtualColumn('i18n_TITLE'))
->set("CHAPO", $folder->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION", $folder->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT", $folder->getParent())
->set("URL", $folder->getUrl($this->locale))
->set("CHILD_COUNT", $folder->countChild())
->set("CONTENT_COUNT", $folder->countAllContents())
->set("VISIBLE", $folder->getVisible() ? "1" : "0")
->set("POSITION", $folder->getPosition())
->set("ID" , $folder->getId())
->set("IS_TRANSLATED" , $folder->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE" , $this->locale)
->set("TITLE" , $folder->getVirtualColumn('i18n_TITLE'))
->set("CHAPO" , $folder->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION" , $folder->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM" , $folder->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT" , $folder->getParent())
->set("URL" , $folder->getUrl($this->locale))
->set("META_TITLE" , $folder->getVirtualColumn('i18n_META_TITLE'))
->set("META_DESCRIPTION" , $folder->getVirtualColumn('i18n_META_DESCRIPTION'))
->set("META_KEYWORDS" , $folder->getVirtualColumn('i18n_META_KEYWORDS'))
->set("CHILD_COUNT" , $folder->countChild())
->set("CONTENT_COUNT" , $folder->countAllContents())
->set("VISIBLE" , $folder->getVisible() ? "1" : "0")
->set("POSITION" , $folder->getPosition())
;
$loopResult->addRow($loopResultRow);

View File

@@ -222,7 +222,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
}
/* manage translations */
$this->configureI18nProcessing($search);
$this->configureI18nProcessing($search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'));
$id = $this->getId();
@@ -518,6 +518,9 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("URL" , $product->getUrl($this->locale))
->set("META_TITLE" , $product->getVirtualColumn('i18n_META_TITLE'))
->set("META_DESCRIPTION" , $product->getVirtualColumn('i18n_META_DESCRIPTION'))
->set("META_KEYWORDS" , $product->getVirtualColumn('i18n_META_KEYWORDS'))
->set("BEST_PRICE" , $product->getVirtualColumn('is_promo') ? $promoPrice : $price)
->set("BEST_PRICE_TAX" , $taxedPrice - $product->getVirtualColumn('is_promo') ? $taxedPromoPrice - $promoPrice : $taxedPrice - $price)
->set("BEST_TAXED_PRICE" , $product->getVirtualColumn('is_promo') ? $taxedPromoPrice : $taxedPrice)
@@ -569,7 +572,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
$search = ProductQuery::create();
/* manage translations */
$this->configureI18nProcessing($search);
$this->configureI18nProcessing($search, array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'));
$attributeNonStrictMatch = $this->getAttribute_non_strict_match();
$isPSELeftJoinList = array();
@@ -1025,6 +1028,9 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
->set("DESCRIPTION" , $product->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM" , $product->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("URL" , $product->getUrl($this->locale))
->set("META_TITLE" , $product->getVirtualColumn('i18n_META_TITLE'))
->set("META_DESCRIPTION" , $product->getVirtualColumn('i18n_META_DESCRIPTION'))
->set("META_KEYWORDS" , $product->getVirtualColumn('i18n_META_KEYWORDS'))
->set("BEST_PRICE" , $price)
->set("BEST_PRICE_TAX" , $taxedPrice - $price)
->set("BEST_TAXED_PRICE" , $taxedPrice)

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Thelia\Core\Translation\Translator;
use Symfony\Component\Validator\Constraints\NotBlank;
class CategoryModificationForm extends CategoryCreationForm
{
@@ -35,17 +33,15 @@ class CategoryModificationForm extends CategoryCreationForm
parent::buildForm(true);
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
->add("url", "text", array(
"label" => Translator::getInstance()->trans("Rewritten URL *"),
"constraints" => array(new NotBlank()),
"label_attr" => array("for" => "rewriten_url")
))
->add("id", "hidden", array(
"constraints" => array(
new GreaterThan(array('value' => 0))
)
))
;
// Add standard description fields, excluding title and locale, which a re defined in parent class
$this->addStandardDescFields(array('title', 'locale'));
// Add standard description fields, excluding title which is defined in parent class
$this->addStandardDescFields(array('title'));
}
public function getName()

View File

@@ -24,8 +24,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;
use Thelia\Form\StandardDescriptionFieldsTrait;
/**
@@ -43,12 +41,6 @@ class ContentModificationForm extends ContentCreationForm
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
->add("url", "text", array(
"label" => Translator::getInstance()->trans("Rewritten URL *"),
"constraints" => array(new NotBlank()),
"label_attr" => array("for" => "rewritten_url")
))
;
// Add standard description fields, excluding title and locale, which a re defined in parent class

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Thelia\Core\Translation\Translator;
use Symfony\Component\Validator\Constraints\NotBlank;
class FolderModificationForm extends FolderCreationForm
{
@@ -36,12 +34,6 @@ class FolderModificationForm extends FolderCreationForm
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
->add("url", "text", array(
"label" => Translator::getInstance()->trans("Rewritten URL *"),
"constraints" => array(new NotBlank()),
"label_attr" => array("for" => "rewriten_url")
))
;
// Add standard description fields, excluding title and locale, which a re defined in parent class

View File

@@ -24,7 +24,7 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Thelia\Core\Translation\Translator;
use Symfony\Component\Validator\Constraints\NotBlank;
class ProductModificationForm extends ProductCreationForm
{
@@ -39,17 +39,10 @@ class ProductModificationForm extends ProductCreationForm
"label" => Translator::getInstance()->trans("Prodcut ID *"),
"label_attr" => array("for" => "product_id_field"),
"constraints" => array(new GreaterThan(array('value' => 0)))
))
->add("template_id", "integer", array(
"label" => Translator::getInstance()->trans("Product template"),
"label_attr" => array("for" => "product_template_field")
))
->add("url", "text", array(
"label" => Translator::getInstance()->trans("Rewritten URL *"),
"constraints" => array(new NotBlank()),
"label_attr" => array("for" => "rewriten_url_field")
))
;

View File

@@ -0,0 +1,89 @@
<?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\Form;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;
/**
* A trait to add standard localized description fields to a form.
*
* @author Christophe Laffont <claffont@openstudio.fr>
*/
trait SeoFieldsTrait
{
/**
* Add seo meta title, meta description and meta keywords fields
*
* @param array $exclude name of the fields that should not be added to the form
*/
protected function addSeoFields($exclude = array())
{
if (! in_array('url', $exclude))
$this->formBuilder
->add('url', 'text', array(
'label' => Translator::getInstance()->trans('Rewriten URL'),
'label_attr' => array(
'for' => 'rewriten_url_field'
),
'required' => false
)
);
if (! in_array('meta_title', $exclude))
$this->formBuilder
->add('meta_title', 'text', array(
'constraints' => array(
new NotBlank()
),
'label' => Translator::getInstance()->trans('Page Title'),
'label_attr' => array(
'for' => 'meta_title'
)
)
);
if (! in_array('meta_description', $exclude))
$this->formBuilder
->add('meta_description', 'text', array(
'label' => Translator::getInstance()->trans('Meta Description'),
'label_attr' => array(
'for' => 'meta_description'
),
'required' => false
)
);
if (! in_array('meta_keywords', $exclude))
$this->formBuilder
->add('meta_keywords', 'text', array(
'label' => Translator::getInstance()->trans('Meta Keywords'),
'label_attr' => array(
'for' => 'meta_keywords'
),
'required' => false
)
);
}
}

View File

@@ -0,0 +1,81 @@
<?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\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Class SeoForm
* @package Thelia\Form
* @author Christophe Laffont <claffont@openstudio.fr>
*/
class SeoForm extends BaseForm
{
use SeoFieldsTrait;
/**
*
* in this function you add all the fields you need for your Form.
* Form this you have to call add method on $this->formBuilder attribute :
*
* $this->formBuilder->add("name", "text")
* ->add("email", "email", array(
* "attr" => array(
* "class" => "field"
* ),
* "label" => "email",
* "constraints" => array(
* new \Symfony\Component\Validator\Constraints\NotBlank()
* )
* )
* )
* ->add('age', 'integer');
*
* @return null
*/
protected function buildForm()
{
$this->formBuilder
->add("id", "hidden", array(
"constraints" => array(
new GreaterThan(array('value' => 0))
)
))
->add("locale", "hidden", array(
"constraints" => array(
new NotBlank()
)
))
;
// Add SEO Fields
$this->addSeoFields();
}
public function getName()
{
return "thelia_seo";
}
}

View File

@@ -3651,6 +3651,78 @@ abstract class Category implements ActiveRecordInterface
return $this;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->getCurrentTranslation()->getMetaTitle();
}
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{ $this->getCurrentTranslation()->setMetaTitle($v);
return $this;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->getCurrentTranslation()->getMetaDescription();
}
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{ $this->getCurrentTranslation()->setMetaDescription($v);
return $this;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->getCurrentTranslation()->getMetaKeywords();
}
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{ $this->getCurrentTranslation()->setMetaKeywords($v);
return $this;
}
// versionable behavior
/**

View File

@@ -90,6 +90,24 @@ abstract class CategoryI18n implements ActiveRecordInterface
*/
protected $postscriptum;
/**
* The value for the meta_title field.
* @var string
*/
protected $meta_title;
/**
* The value for the meta_description field.
* @var string
*/
protected $meta_description;
/**
* The value for the meta_keywords field.
* @var string
*/
protected $meta_keywords;
/**
* @var Category
*/
@@ -440,6 +458,39 @@ abstract class CategoryI18n implements ActiveRecordInterface
return $this->postscriptum;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->meta_title;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->meta_description;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->meta_keywords;
}
/**
* Set the value of [id] column.
*
@@ -570,6 +621,69 @@ abstract class CategoryI18n implements ActiveRecordInterface
return $this;
} // setPostscriptum()
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_title !== $v) {
$this->meta_title = $v;
$this->modifiedColumns[] = CategoryI18nTableMap::META_TITLE;
}
return $this;
} // setMetaTitle()
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_description !== $v) {
$this->meta_description = $v;
$this->modifiedColumns[] = CategoryI18nTableMap::META_DESCRIPTION;
}
return $this;
} // setMetaDescription()
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\CategoryI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_keywords !== $v) {
$this->meta_keywords = $v;
$this->modifiedColumns[] = CategoryI18nTableMap::META_KEYWORDS;
}
return $this;
} // setMetaKeywords()
/**
* Indicates whether the columns in this object are only set to default values.
*
@@ -628,6 +742,15 @@ abstract class CategoryI18n implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : CategoryI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$this->postscriptum = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : CategoryI18nTableMap::translateFieldName('MetaTitle', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : CategoryI18nTableMap::translateFieldName('MetaDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CategoryI18nTableMap::translateFieldName('MetaKeywords', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_keywords = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -636,7 +759,7 @@ abstract class CategoryI18n implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = CategoryI18nTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 9; // 9 = CategoryI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\CategoryI18n object", 0, $e);
@@ -875,6 +998,15 @@ abstract class CategoryI18n implements ActiveRecordInterface
if ($this->isColumnModified(CategoryI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
if ($this->isColumnModified(CategoryI18nTableMap::META_TITLE)) {
$modifiedColumns[':p' . $index++] = 'META_TITLE';
}
if ($this->isColumnModified(CategoryI18nTableMap::META_DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'META_DESCRIPTION';
}
if ($this->isColumnModified(CategoryI18nTableMap::META_KEYWORDS)) {
$modifiedColumns[':p' . $index++] = 'META_KEYWORDS';
}
$sql = sprintf(
'INSERT INTO category_i18n (%s) VALUES (%s)',
@@ -904,6 +1036,15 @@ abstract class CategoryI18n implements ActiveRecordInterface
case 'POSTSCRIPTUM':
$stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break;
case 'META_TITLE':
$stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR);
break;
case 'META_DESCRIPTION':
$stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR);
break;
case 'META_KEYWORDS':
$stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR);
break;
}
}
$stmt->execute();
@@ -977,6 +1118,15 @@ abstract class CategoryI18n implements ActiveRecordInterface
case 5:
return $this->getPostscriptum();
break;
case 6:
return $this->getMetaTitle();
break;
case 7:
return $this->getMetaDescription();
break;
case 8:
return $this->getMetaKeywords();
break;
default:
return null;
break;
@@ -1012,6 +1162,9 @@ abstract class CategoryI18n implements ActiveRecordInterface
$keys[3] => $this->getDescription(),
$keys[4] => $this->getChapo(),
$keys[5] => $this->getPostscriptum(),
$keys[6] => $this->getMetaTitle(),
$keys[7] => $this->getMetaDescription(),
$keys[8] => $this->getMetaKeywords(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1074,6 +1227,15 @@ abstract class CategoryI18n implements ActiveRecordInterface
case 5:
$this->setPostscriptum($value);
break;
case 6:
$this->setMetaTitle($value);
break;
case 7:
$this->setMetaDescription($value);
break;
case 8:
$this->setMetaKeywords($value);
break;
} // switch()
}
@@ -1104,6 +1266,9 @@ abstract class CategoryI18n implements ActiveRecordInterface
if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setChapo($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setMetaTitle($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setMetaDescription($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setMetaKeywords($arr[$keys[8]]);
}
/**
@@ -1121,6 +1286,9 @@ abstract class CategoryI18n implements ActiveRecordInterface
if ($this->isColumnModified(CategoryI18nTableMap::DESCRIPTION)) $criteria->add(CategoryI18nTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(CategoryI18nTableMap::CHAPO)) $criteria->add(CategoryI18nTableMap::CHAPO, $this->chapo);
if ($this->isColumnModified(CategoryI18nTableMap::POSTSCRIPTUM)) $criteria->add(CategoryI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(CategoryI18nTableMap::META_TITLE)) $criteria->add(CategoryI18nTableMap::META_TITLE, $this->meta_title);
if ($this->isColumnModified(CategoryI18nTableMap::META_DESCRIPTION)) $criteria->add(CategoryI18nTableMap::META_DESCRIPTION, $this->meta_description);
if ($this->isColumnModified(CategoryI18nTableMap::META_KEYWORDS)) $criteria->add(CategoryI18nTableMap::META_KEYWORDS, $this->meta_keywords);
return $criteria;
}
@@ -1197,6 +1365,9 @@ abstract class CategoryI18n implements ActiveRecordInterface
$copyObj->setDescription($this->getDescription());
$copyObj->setChapo($this->getChapo());
$copyObj->setPostscriptum($this->getPostscriptum());
$copyObj->setMetaTitle($this->getMetaTitle());
$copyObj->setMetaDescription($this->getMetaDescription());
$copyObj->setMetaKeywords($this->getMetaKeywords());
if ($makeNew) {
$copyObj->setNew(true);
}
@@ -1286,6 +1457,9 @@ abstract class CategoryI18n implements ActiveRecordInterface
$this->description = null;
$this->chapo = null;
$this->postscriptum = null;
$this->meta_title = null;
$this->meta_description = null;
$this->meta_keywords = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();

View File

@@ -27,6 +27,9 @@ use Thelia\Model\Map\CategoryI18nTableMap;
* @method ChildCategoryI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildCategoryI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildCategoryI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildCategoryI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildCategoryI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildCategoryI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildCategoryI18nQuery groupById() Group by the id column
* @method ChildCategoryI18nQuery groupByLocale() Group by the locale column
@@ -34,6 +37,9 @@ use Thelia\Model\Map\CategoryI18nTableMap;
* @method ChildCategoryI18nQuery groupByDescription() Group by the description column
* @method ChildCategoryI18nQuery groupByChapo() Group by the chapo column
* @method ChildCategoryI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildCategoryI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildCategoryI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildCategoryI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildCategoryI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildCategoryI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -52,6 +58,9 @@ use Thelia\Model\Map\CategoryI18nTableMap;
* @method ChildCategoryI18n findOneByDescription(string $description) Return the first ChildCategoryI18n filtered by the description column
* @method ChildCategoryI18n findOneByChapo(string $chapo) Return the first ChildCategoryI18n filtered by the chapo column
* @method ChildCategoryI18n findOneByPostscriptum(string $postscriptum) Return the first ChildCategoryI18n filtered by the postscriptum column
* @method ChildCategoryI18n findOneByMetaTitle(string $meta_title) Return the first ChildCategoryI18n filtered by the meta_title column
* @method ChildCategoryI18n findOneByMetaDescription(string $meta_description) Return the first ChildCategoryI18n filtered by the meta_description column
* @method ChildCategoryI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildCategoryI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildCategoryI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildCategoryI18n objects filtered by the locale column
@@ -59,6 +68,9 @@ use Thelia\Model\Map\CategoryI18nTableMap;
* @method array findByDescription(string $description) Return ChildCategoryI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildCategoryI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildCategoryI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildCategoryI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildCategoryI18n objects filtered by the meta_description column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildCategoryI18n objects filtered by the meta_keywords column
*
*/
abstract class CategoryI18nQuery extends ModelCriteria
@@ -147,7 +159,7 @@ abstract class CategoryI18nQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM category_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -436,6 +448,93 @@ abstract class CategoryI18nQuery extends ModelCriteria
return $this->addUsingAlias(CategoryI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query on the meta_title column
*
* Example usage:
* <code>
* $query->filterByMetaTitle('fooValue'); // WHERE meta_title = 'fooValue'
* $query->filterByMetaTitle('%fooValue%'); // WHERE meta_title LIKE '%fooValue%'
* </code>
*
* @param string $metaTitle The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryI18nQuery The current query, for fluid interface
*/
public function filterByMetaTitle($metaTitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaTitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaTitle)) {
$metaTitle = str_replace('*', '%', $metaTitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CategoryI18nTableMap::META_TITLE, $metaTitle, $comparison);
}
/**
* Filter the query on the meta_description column
*
* Example usage:
* <code>
* $query->filterByMetaDescription('fooValue'); // WHERE meta_description = 'fooValue'
* $query->filterByMetaDescription('%fooValue%'); // WHERE meta_description LIKE '%fooValue%'
* </code>
*
* @param string $metaDescription The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryI18nQuery The current query, for fluid interface
*/
public function filterByMetaDescription($metaDescription = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaDescription)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaDescription)) {
$metaDescription = str_replace('*', '%', $metaDescription);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CategoryI18nTableMap::META_DESCRIPTION, $metaDescription, $comparison);
}
/**
* Filter the query on the meta_keywords column
*
* Example usage:
* <code>
* $query->filterByMetaKeywords('fooValue'); // WHERE meta_keywords = 'fooValue'
* $query->filterByMetaKeywords('%fooValue%'); // WHERE meta_keywords LIKE '%fooValue%'
* </code>
*
* @param string $metaKeywords The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildCategoryI18nQuery The current query, for fluid interface
*/
public function filterByMetaKeywords($metaKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaKeywords)) {
$metaKeywords = str_replace('*', '%', $metaKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CategoryI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Category object
*

View File

@@ -3904,6 +3904,78 @@ abstract class Content implements ActiveRecordInterface
return $this;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->getCurrentTranslation()->getMetaTitle();
}
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{ $this->getCurrentTranslation()->setMetaTitle($v);
return $this;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->getCurrentTranslation()->getMetaDescription();
}
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{ $this->getCurrentTranslation()->setMetaDescription($v);
return $this;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->getCurrentTranslation()->getMetaKeywords();
}
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{ $this->getCurrentTranslation()->setMetaKeywords($v);
return $this;
}
// versionable behavior
/**

View File

@@ -90,6 +90,24 @@ abstract class ContentI18n implements ActiveRecordInterface
*/
protected $postscriptum;
/**
* The value for the meta_title field.
* @var string
*/
protected $meta_title;
/**
* The value for the meta_description field.
* @var string
*/
protected $meta_description;
/**
* The value for the meta_keywords field.
* @var string
*/
protected $meta_keywords;
/**
* @var Content
*/
@@ -440,6 +458,39 @@ abstract class ContentI18n implements ActiveRecordInterface
return $this->postscriptum;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->meta_title;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->meta_description;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->meta_keywords;
}
/**
* Set the value of [id] column.
*
@@ -570,6 +621,69 @@ abstract class ContentI18n implements ActiveRecordInterface
return $this;
} // setPostscriptum()
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_title !== $v) {
$this->meta_title = $v;
$this->modifiedColumns[] = ContentI18nTableMap::META_TITLE;
}
return $this;
} // setMetaTitle()
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_description !== $v) {
$this->meta_description = $v;
$this->modifiedColumns[] = ContentI18nTableMap::META_DESCRIPTION;
}
return $this;
} // setMetaDescription()
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\ContentI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_keywords !== $v) {
$this->meta_keywords = $v;
$this->modifiedColumns[] = ContentI18nTableMap::META_KEYWORDS;
}
return $this;
} // setMetaKeywords()
/**
* Indicates whether the columns in this object are only set to default values.
*
@@ -628,6 +742,15 @@ abstract class ContentI18n implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ContentI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$this->postscriptum = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ContentI18nTableMap::translateFieldName('MetaTitle', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ContentI18nTableMap::translateFieldName('MetaDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ContentI18nTableMap::translateFieldName('MetaKeywords', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_keywords = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -636,7 +759,7 @@ abstract class ContentI18n implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = ContentI18nTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 9; // 9 = ContentI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ContentI18n object", 0, $e);
@@ -875,6 +998,15 @@ abstract class ContentI18n implements ActiveRecordInterface
if ($this->isColumnModified(ContentI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
if ($this->isColumnModified(ContentI18nTableMap::META_TITLE)) {
$modifiedColumns[':p' . $index++] = 'META_TITLE';
}
if ($this->isColumnModified(ContentI18nTableMap::META_DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'META_DESCRIPTION';
}
if ($this->isColumnModified(ContentI18nTableMap::META_KEYWORDS)) {
$modifiedColumns[':p' . $index++] = 'META_KEYWORDS';
}
$sql = sprintf(
'INSERT INTO content_i18n (%s) VALUES (%s)',
@@ -904,6 +1036,15 @@ abstract class ContentI18n implements ActiveRecordInterface
case 'POSTSCRIPTUM':
$stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break;
case 'META_TITLE':
$stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR);
break;
case 'META_DESCRIPTION':
$stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR);
break;
case 'META_KEYWORDS':
$stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR);
break;
}
}
$stmt->execute();
@@ -977,6 +1118,15 @@ abstract class ContentI18n implements ActiveRecordInterface
case 5:
return $this->getPostscriptum();
break;
case 6:
return $this->getMetaTitle();
break;
case 7:
return $this->getMetaDescription();
break;
case 8:
return $this->getMetaKeywords();
break;
default:
return null;
break;
@@ -1012,6 +1162,9 @@ abstract class ContentI18n implements ActiveRecordInterface
$keys[3] => $this->getDescription(),
$keys[4] => $this->getChapo(),
$keys[5] => $this->getPostscriptum(),
$keys[6] => $this->getMetaTitle(),
$keys[7] => $this->getMetaDescription(),
$keys[8] => $this->getMetaKeywords(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1074,6 +1227,15 @@ abstract class ContentI18n implements ActiveRecordInterface
case 5:
$this->setPostscriptum($value);
break;
case 6:
$this->setMetaTitle($value);
break;
case 7:
$this->setMetaDescription($value);
break;
case 8:
$this->setMetaKeywords($value);
break;
} // switch()
}
@@ -1104,6 +1266,9 @@ abstract class ContentI18n implements ActiveRecordInterface
if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setChapo($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setMetaTitle($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setMetaDescription($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setMetaKeywords($arr[$keys[8]]);
}
/**
@@ -1121,6 +1286,9 @@ abstract class ContentI18n implements ActiveRecordInterface
if ($this->isColumnModified(ContentI18nTableMap::DESCRIPTION)) $criteria->add(ContentI18nTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(ContentI18nTableMap::CHAPO)) $criteria->add(ContentI18nTableMap::CHAPO, $this->chapo);
if ($this->isColumnModified(ContentI18nTableMap::POSTSCRIPTUM)) $criteria->add(ContentI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(ContentI18nTableMap::META_TITLE)) $criteria->add(ContentI18nTableMap::META_TITLE, $this->meta_title);
if ($this->isColumnModified(ContentI18nTableMap::META_DESCRIPTION)) $criteria->add(ContentI18nTableMap::META_DESCRIPTION, $this->meta_description);
if ($this->isColumnModified(ContentI18nTableMap::META_KEYWORDS)) $criteria->add(ContentI18nTableMap::META_KEYWORDS, $this->meta_keywords);
return $criteria;
}
@@ -1197,6 +1365,9 @@ abstract class ContentI18n implements ActiveRecordInterface
$copyObj->setDescription($this->getDescription());
$copyObj->setChapo($this->getChapo());
$copyObj->setPostscriptum($this->getPostscriptum());
$copyObj->setMetaTitle($this->getMetaTitle());
$copyObj->setMetaDescription($this->getMetaDescription());
$copyObj->setMetaKeywords($this->getMetaKeywords());
if ($makeNew) {
$copyObj->setNew(true);
}
@@ -1286,6 +1457,9 @@ abstract class ContentI18n implements ActiveRecordInterface
$this->description = null;
$this->chapo = null;
$this->postscriptum = null;
$this->meta_title = null;
$this->meta_description = null;
$this->meta_keywords = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();

View File

@@ -27,6 +27,9 @@ use Thelia\Model\Map\ContentI18nTableMap;
* @method ChildContentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildContentI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildContentI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildContentI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildContentI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildContentI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildContentI18nQuery groupById() Group by the id column
* @method ChildContentI18nQuery groupByLocale() Group by the locale column
@@ -34,6 +37,9 @@ use Thelia\Model\Map\ContentI18nTableMap;
* @method ChildContentI18nQuery groupByDescription() Group by the description column
* @method ChildContentI18nQuery groupByChapo() Group by the chapo column
* @method ChildContentI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildContentI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildContentI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildContentI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildContentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildContentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -52,6 +58,9 @@ use Thelia\Model\Map\ContentI18nTableMap;
* @method ChildContentI18n findOneByDescription(string $description) Return the first ChildContentI18n filtered by the description column
* @method ChildContentI18n findOneByChapo(string $chapo) Return the first ChildContentI18n filtered by the chapo column
* @method ChildContentI18n findOneByPostscriptum(string $postscriptum) Return the first ChildContentI18n filtered by the postscriptum column
* @method ChildContentI18n findOneByMetaTitle(string $meta_title) Return the first ChildContentI18n filtered by the meta_title column
* @method ChildContentI18n findOneByMetaDescription(string $meta_description) Return the first ChildContentI18n filtered by the meta_description column
* @method ChildContentI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildContentI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildContentI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildContentI18n objects filtered by the locale column
@@ -59,6 +68,9 @@ use Thelia\Model\Map\ContentI18nTableMap;
* @method array findByDescription(string $description) Return ChildContentI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildContentI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildContentI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildContentI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildContentI18n objects filtered by the meta_description column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildContentI18n objects filtered by the meta_keywords column
*
*/
abstract class ContentI18nQuery extends ModelCriteria
@@ -147,7 +159,7 @@ abstract class ContentI18nQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM content_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -436,6 +448,93 @@ abstract class ContentI18nQuery extends ModelCriteria
return $this->addUsingAlias(ContentI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query on the meta_title column
*
* Example usage:
* <code>
* $query->filterByMetaTitle('fooValue'); // WHERE meta_title = 'fooValue'
* $query->filterByMetaTitle('%fooValue%'); // WHERE meta_title LIKE '%fooValue%'
* </code>
*
* @param string $metaTitle The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentI18nQuery The current query, for fluid interface
*/
public function filterByMetaTitle($metaTitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaTitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaTitle)) {
$metaTitle = str_replace('*', '%', $metaTitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ContentI18nTableMap::META_TITLE, $metaTitle, $comparison);
}
/**
* Filter the query on the meta_description column
*
* Example usage:
* <code>
* $query->filterByMetaDescription('fooValue'); // WHERE meta_description = 'fooValue'
* $query->filterByMetaDescription('%fooValue%'); // WHERE meta_description LIKE '%fooValue%'
* </code>
*
* @param string $metaDescription The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentI18nQuery The current query, for fluid interface
*/
public function filterByMetaDescription($metaDescription = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaDescription)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaDescription)) {
$metaDescription = str_replace('*', '%', $metaDescription);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ContentI18nTableMap::META_DESCRIPTION, $metaDescription, $comparison);
}
/**
* Filter the query on the meta_keywords column
*
* Example usage:
* <code>
* $query->filterByMetaKeywords('fooValue'); // WHERE meta_keywords = 'fooValue'
* $query->filterByMetaKeywords('%fooValue%'); // WHERE meta_keywords LIKE '%fooValue%'
* </code>
*
* @param string $metaKeywords The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentI18nQuery The current query, for fluid interface
*/
public function filterByMetaKeywords($metaKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaKeywords)) {
$metaKeywords = str_replace('*', '%', $metaKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ContentI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Content object
*

View File

@@ -3368,6 +3368,78 @@ abstract class Folder implements ActiveRecordInterface
return $this;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->getCurrentTranslation()->getMetaTitle();
}
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{ $this->getCurrentTranslation()->setMetaTitle($v);
return $this;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->getCurrentTranslation()->getMetaDescription();
}
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{ $this->getCurrentTranslation()->setMetaDescription($v);
return $this;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->getCurrentTranslation()->getMetaKeywords();
}
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{ $this->getCurrentTranslation()->setMetaKeywords($v);
return $this;
}
// versionable behavior
/**

View File

@@ -90,6 +90,24 @@ abstract class FolderI18n implements ActiveRecordInterface
*/
protected $postscriptum;
/**
* The value for the meta_title field.
* @var string
*/
protected $meta_title;
/**
* The value for the meta_description field.
* @var string
*/
protected $meta_description;
/**
* The value for the meta_keywords field.
* @var string
*/
protected $meta_keywords;
/**
* @var Folder
*/
@@ -440,6 +458,39 @@ abstract class FolderI18n implements ActiveRecordInterface
return $this->postscriptum;
}
/**
* Get the [meta_title] column value.
*
* @return string
*/
public function getMetaTitle()
{
return $this->meta_title;
}
/**
* Get the [meta_description] column value.
*
* @return string
*/
public function getMetaDescription()
{
return $this->meta_description;
}
/**
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeywords()
{
return $this->meta_keywords;
}
/**
* Set the value of [id] column.
*
@@ -570,6 +621,69 @@ abstract class FolderI18n implements ActiveRecordInterface
return $this;
} // setPostscriptum()
/**
* Set the value of [meta_title] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaTitle($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_title !== $v) {
$this->meta_title = $v;
$this->modifiedColumns[] = FolderI18nTableMap::META_TITLE;
}
return $this;
} // setMetaTitle()
/**
* Set the value of [meta_description] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaDescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_description !== $v) {
$this->meta_description = $v;
$this->modifiedColumns[] = FolderI18nTableMap::META_DESCRIPTION;
}
return $this;
} // setMetaDescription()
/**
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\FolderI18n The current object (for fluent API support)
*/
public function setMetaKeywords($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_keywords !== $v) {
$this->meta_keywords = $v;
$this->modifiedColumns[] = FolderI18nTableMap::META_KEYWORDS;
}
return $this;
} // setMetaKeywords()
/**
* Indicates whether the columns in this object are only set to default values.
*
@@ -628,6 +742,15 @@ abstract class FolderI18n implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : FolderI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$this->postscriptum = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : FolderI18nTableMap::translateFieldName('MetaTitle', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : FolderI18nTableMap::translateFieldName('MetaDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : FolderI18nTableMap::translateFieldName('MetaKeywords', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_keywords = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -636,7 +759,7 @@ abstract class FolderI18n implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = FolderI18nTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 9; // 9 = FolderI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\FolderI18n object", 0, $e);
@@ -875,6 +998,15 @@ abstract class FolderI18n implements ActiveRecordInterface
if ($this->isColumnModified(FolderI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
if ($this->isColumnModified(FolderI18nTableMap::META_TITLE)) {
$modifiedColumns[':p' . $index++] = 'META_TITLE';
}
if ($this->isColumnModified(FolderI18nTableMap::META_DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'META_DESCRIPTION';
}
if ($this->isColumnModified(FolderI18nTableMap::META_KEYWORDS)) {
$modifiedColumns[':p' . $index++] = 'META_KEYWORDS';
}
$sql = sprintf(
'INSERT INTO folder_i18n (%s) VALUES (%s)',
@@ -904,6 +1036,15 @@ abstract class FolderI18n implements ActiveRecordInterface
case 'POSTSCRIPTUM':
$stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break;
case 'META_TITLE':
$stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR);
break;
case 'META_DESCRIPTION':
$stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR);
break;
case 'META_KEYWORDS':
$stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR);
break;
}
}
$stmt->execute();
@@ -977,6 +1118,15 @@ abstract class FolderI18n implements ActiveRecordInterface
case 5:
return $this->getPostscriptum();
break;
case 6:
return $this->getMetaTitle();
break;
case 7:
return $this->getMetaDescription();
break;
case 8:
return $this->getMetaKeywords();
break;
default:
return null;
break;
@@ -1012,6 +1162,9 @@ abstract class FolderI18n implements ActiveRecordInterface
$keys[3] => $this->getDescription(),
$keys[4] => $this->getChapo(),
$keys[5] => $this->getPostscriptum(),
$keys[6] => $this->getMetaTitle(),
$keys[7] => $this->getMetaDescription(),
$keys[8] => $this->getMetaKeywords(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1074,6 +1227,15 @@ abstract class FolderI18n implements ActiveRecordInterface
case 5:
$this->setPostscriptum($value);
break;
case 6:
$this->setMetaTitle($value);
break;
case 7:
$this->setMetaDescription($value);
break;
case 8:
$this->setMetaKeywords($value);
break;
} // switch()
}
@@ -1104,6 +1266,9 @@ abstract class FolderI18n implements ActiveRecordInterface
if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setChapo($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setMetaTitle($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setMetaDescription($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setMetaKeywords($arr[$keys[8]]);
}
/**
@@ -1121,6 +1286,9 @@ abstract class FolderI18n implements ActiveRecordInterface
if ($this->isColumnModified(FolderI18nTableMap::DESCRIPTION)) $criteria->add(FolderI18nTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(FolderI18nTableMap::CHAPO)) $criteria->add(FolderI18nTableMap::CHAPO, $this->chapo);
if ($this->isColumnModified(FolderI18nTableMap::POSTSCRIPTUM)) $criteria->add(FolderI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(FolderI18nTableMap::META_TITLE)) $criteria->add(FolderI18nTableMap::META_TITLE, $this->meta_title);
if ($this->isColumnModified(FolderI18nTableMap::META_DESCRIPTION)) $criteria->add(FolderI18nTableMap::META_DESCRIPTION, $this->meta_description);
if ($this->isColumnModified(FolderI18nTableMap::META_KEYWORDS)) $criteria->add(FolderI18nTableMap::META_KEYWORDS, $this->meta_keywords);
return $criteria;
}
@@ -1197,6 +1365,9 @@ abstract class FolderI18n implements ActiveRecordInterface
$copyObj->setDescription($this->getDescription());
$copyObj->setChapo($this->getChapo());
$copyObj->setPostscriptum($this->getPostscriptum());
$copyObj->setMetaTitle($this->getMetaTitle());
$copyObj->setMetaDescription($this->getMetaDescription());
$copyObj->setMetaKeywords($this->getMetaKeywords());
if ($makeNew) {
$copyObj->setNew(true);
}
@@ -1286,6 +1457,9 @@ abstract class FolderI18n implements ActiveRecordInterface
$this->description = null;
$this->chapo = null;
$this->postscriptum = null;
$this->meta_title = null;
$this->meta_description = null;
$this->meta_keywords = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();

View File

@@ -27,6 +27,9 @@ use Thelia\Model\Map\FolderI18nTableMap;
* @method ChildFolderI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildFolderI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildFolderI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildFolderI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildFolderI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildFolderI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildFolderI18nQuery groupById() Group by the id column
* @method ChildFolderI18nQuery groupByLocale() Group by the locale column
@@ -34,6 +37,9 @@ use Thelia\Model\Map\FolderI18nTableMap;
* @method ChildFolderI18nQuery groupByDescription() Group by the description column
* @method ChildFolderI18nQuery groupByChapo() Group by the chapo column
* @method ChildFolderI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildFolderI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildFolderI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildFolderI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildFolderI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildFolderI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -52,6 +58,9 @@ use Thelia\Model\Map\FolderI18nTableMap;
* @method ChildFolderI18n findOneByDescription(string $description) Return the first ChildFolderI18n filtered by the description column
* @method ChildFolderI18n findOneByChapo(string $chapo) Return the first ChildFolderI18n filtered by the chapo column
* @method ChildFolderI18n findOneByPostscriptum(string $postscriptum) Return the first ChildFolderI18n filtered by the postscriptum column
* @method ChildFolderI18n findOneByMetaTitle(string $meta_title) Return the first ChildFolderI18n filtered by the meta_title column
* @method ChildFolderI18n findOneByMetaDescription(string $meta_description) Return the first ChildFolderI18n filtered by the meta_description column
* @method ChildFolderI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildFolderI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildFolderI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildFolderI18n objects filtered by the locale column
@@ -59,6 +68,9 @@ use Thelia\Model\Map\FolderI18nTableMap;
* @method array findByDescription(string $description) Return ChildFolderI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildFolderI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildFolderI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildFolderI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildFolderI18n objects filtered by the meta_description column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildFolderI18n objects filtered by the meta_keywords column
*
*/
abstract class FolderI18nQuery extends ModelCriteria
@@ -147,7 +159,7 @@ abstract class FolderI18nQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM folder_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -436,6 +448,93 @@ abstract class FolderI18nQuery extends ModelCriteria
return $this->addUsingAlias(FolderI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query on the meta_title column
*
* Example usage:
* <code>
* $query->filterByMetaTitle('fooValue'); // WHERE meta_title = 'fooValue'
* $query->filterByMetaTitle('%fooValue%'); // WHERE meta_title LIKE '%fooValue%'
* </code>
*
* @param string $metaTitle The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderI18nQuery The current query, for fluid interface
*/
public function filterByMetaTitle($metaTitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaTitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaTitle)) {
$metaTitle = str_replace('*', '%', $metaTitle);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FolderI18nTableMap::META_TITLE, $metaTitle, $comparison);
}
/**
* Filter the query on the meta_description column
*
* Example usage:
* <code>
* $query->filterByMetaDescription('fooValue'); // WHERE meta_description = 'fooValue'
* $query->filterByMetaDescription('%fooValue%'); // WHERE meta_description LIKE '%fooValue%'
* </code>
*
* @param string $metaDescription The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderI18nQuery The current query, for fluid interface
*/
public function filterByMetaDescription($metaDescription = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaDescription)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaDescription)) {
$metaDescription = str_replace('*', '%', $metaDescription);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FolderI18nTableMap::META_DESCRIPTION, $metaDescription, $comparison);
}
/**
* Filter the query on the meta_keywords column
*
* Example usage:
* <code>
* $query->filterByMetaKeywords('fooValue'); // WHERE meta_keywords = 'fooValue'
* $query->filterByMetaKeywords('%fooValue%'); // WHERE meta_keywords LIKE '%fooValue%'
* </code>
*
* @param string $metaKeywords The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildFolderI18nQuery The current query, for fluid interface
*/
public function filterByMetaKeywords($metaKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaKeywords)) {
$metaKeywords = str_replace('*', '%', $metaKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(FolderI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Folder object
*

View File

@@ -5916,24 +5916,24 @@ abstract class Product implements ActiveRecordInterface
/**
* Get the [meta_keyword] column value.
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeyword()
public function getMetaKeywords()
{
return $this->getCurrentTranslation()->getMetaKeyword();
return $this->getCurrentTranslation()->getMetaKeywords();
}
/**
* Set the value of [meta_keyword] column.
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\ProductI18n The current object (for fluent API support)
*/
public function setMetaKeyword($v)
{ $this->getCurrentTranslation()->setMetaKeyword($v);
public function setMetaKeywords($v)
{ $this->getCurrentTranslation()->setMetaKeywords($v);
return $this;
}

View File

@@ -103,10 +103,10 @@ abstract class ProductI18n implements ActiveRecordInterface
protected $meta_description;
/**
* The value for the meta_keyword field.
* The value for the meta_keywords field.
* @var string
*/
protected $meta_keyword;
protected $meta_keywords;
/**
* @var Product
@@ -481,14 +481,14 @@ abstract class ProductI18n implements ActiveRecordInterface
}
/**
* Get the [meta_keyword] column value.
* Get the [meta_keywords] column value.
*
* @return string
*/
public function getMetaKeyword()
public function getMetaKeywords()
{
return $this->meta_keyword;
return $this->meta_keywords;
}
/**
@@ -664,25 +664,25 @@ abstract class ProductI18n implements ActiveRecordInterface
} // setMetaDescription()
/**
* Set the value of [meta_keyword] column.
* Set the value of [meta_keywords] column.
*
* @param string $v new value
* @return \Thelia\Model\ProductI18n The current object (for fluent API support)
*/
public function setMetaKeyword($v)
public function setMetaKeywords($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->meta_keyword !== $v) {
$this->meta_keyword = $v;
$this->modifiedColumns[] = ProductI18nTableMap::META_KEYWORD;
if ($this->meta_keywords !== $v) {
$this->meta_keywords = $v;
$this->modifiedColumns[] = ProductI18nTableMap::META_KEYWORDS;
}
return $this;
} // setMetaKeyword()
} // setMetaKeywords()
/**
* Indicates whether the columns in this object are only set to default values.
@@ -749,8 +749,8 @@ abstract class ProductI18n implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductI18nTableMap::translateFieldName('MetaDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductI18nTableMap::translateFieldName('MetaKeyword', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_keyword = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductI18nTableMap::translateFieldName('MetaKeywords', TableMap::TYPE_PHPNAME, $indexType)];
$this->meta_keywords = (null !== $col) ? (string) $col : null;
$this->resetModified();
$this->setNew(false);
@@ -1004,8 +1004,8 @@ abstract class ProductI18n implements ActiveRecordInterface
if ($this->isColumnModified(ProductI18nTableMap::META_DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'META_DESCRIPTION';
}
if ($this->isColumnModified(ProductI18nTableMap::META_KEYWORD)) {
$modifiedColumns[':p' . $index++] = 'META_KEYWORD';
if ($this->isColumnModified(ProductI18nTableMap::META_KEYWORDS)) {
$modifiedColumns[':p' . $index++] = 'META_KEYWORDS';
}
$sql = sprintf(
@@ -1042,8 +1042,8 @@ abstract class ProductI18n implements ActiveRecordInterface
case 'META_DESCRIPTION':
$stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR);
break;
case 'META_KEYWORD':
$stmt->bindValue($identifier, $this->meta_keyword, PDO::PARAM_STR);
case 'META_KEYWORDS':
$stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR);
break;
}
}
@@ -1125,7 +1125,7 @@ abstract class ProductI18n implements ActiveRecordInterface
return $this->getMetaDescription();
break;
case 8:
return $this->getMetaKeyword();
return $this->getMetaKeywords();
break;
default:
return null;
@@ -1164,7 +1164,7 @@ abstract class ProductI18n implements ActiveRecordInterface
$keys[5] => $this->getPostscriptum(),
$keys[6] => $this->getMetaTitle(),
$keys[7] => $this->getMetaDescription(),
$keys[8] => $this->getMetaKeyword(),
$keys[8] => $this->getMetaKeywords(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1234,7 +1234,7 @@ abstract class ProductI18n implements ActiveRecordInterface
$this->setMetaDescription($value);
break;
case 8:
$this->setMetaKeyword($value);
$this->setMetaKeywords($value);
break;
} // switch()
}
@@ -1268,7 +1268,7 @@ abstract class ProductI18n implements ActiveRecordInterface
if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setMetaTitle($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setMetaDescription($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setMetaKeyword($arr[$keys[8]]);
if (array_key_exists($keys[8], $arr)) $this->setMetaKeywords($arr[$keys[8]]);
}
/**
@@ -1288,7 +1288,7 @@ abstract class ProductI18n implements ActiveRecordInterface
if ($this->isColumnModified(ProductI18nTableMap::POSTSCRIPTUM)) $criteria->add(ProductI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(ProductI18nTableMap::META_TITLE)) $criteria->add(ProductI18nTableMap::META_TITLE, $this->meta_title);
if ($this->isColumnModified(ProductI18nTableMap::META_DESCRIPTION)) $criteria->add(ProductI18nTableMap::META_DESCRIPTION, $this->meta_description);
if ($this->isColumnModified(ProductI18nTableMap::META_KEYWORD)) $criteria->add(ProductI18nTableMap::META_KEYWORD, $this->meta_keyword);
if ($this->isColumnModified(ProductI18nTableMap::META_KEYWORDS)) $criteria->add(ProductI18nTableMap::META_KEYWORDS, $this->meta_keywords);
return $criteria;
}
@@ -1367,7 +1367,7 @@ abstract class ProductI18n implements ActiveRecordInterface
$copyObj->setPostscriptum($this->getPostscriptum());
$copyObj->setMetaTitle($this->getMetaTitle());
$copyObj->setMetaDescription($this->getMetaDescription());
$copyObj->setMetaKeyword($this->getMetaKeyword());
$copyObj->setMetaKeywords($this->getMetaKeywords());
if ($makeNew) {
$copyObj->setNew(true);
}
@@ -1459,7 +1459,7 @@ abstract class ProductI18n implements ActiveRecordInterface
$this->postscriptum = null;
$this->meta_title = null;
$this->meta_description = null;
$this->meta_keyword = null;
$this->meta_keywords = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->applyDefaultValues();

View File

@@ -29,7 +29,7 @@ use Thelia\Model\Map\ProductI18nTableMap;
* @method ChildProductI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildProductI18nQuery orderByMetaTitle($order = Criteria::ASC) Order by the meta_title column
* @method ChildProductI18nQuery orderByMetaDescription($order = Criteria::ASC) Order by the meta_description column
* @method ChildProductI18nQuery orderByMetaKeyword($order = Criteria::ASC) Order by the meta_keyword column
* @method ChildProductI18nQuery orderByMetaKeywords($order = Criteria::ASC) Order by the meta_keywords column
*
* @method ChildProductI18nQuery groupById() Group by the id column
* @method ChildProductI18nQuery groupByLocale() Group by the locale column
@@ -39,7 +39,7 @@ use Thelia\Model\Map\ProductI18nTableMap;
* @method ChildProductI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildProductI18nQuery groupByMetaTitle() Group by the meta_title column
* @method ChildProductI18nQuery groupByMetaDescription() Group by the meta_description column
* @method ChildProductI18nQuery groupByMetaKeyword() Group by the meta_keyword column
* @method ChildProductI18nQuery groupByMetaKeywords() Group by the meta_keywords column
*
* @method ChildProductI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProductI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -60,7 +60,7 @@ use Thelia\Model\Map\ProductI18nTableMap;
* @method ChildProductI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProductI18n filtered by the postscriptum column
* @method ChildProductI18n findOneByMetaTitle(string $meta_title) Return the first ChildProductI18n filtered by the meta_title column
* @method ChildProductI18n findOneByMetaDescription(string $meta_description) Return the first ChildProductI18n filtered by the meta_description column
* @method ChildProductI18n findOneByMetaKeyword(string $meta_keyword) Return the first ChildProductI18n filtered by the meta_keyword column
* @method ChildProductI18n findOneByMetaKeywords(string $meta_keywords) Return the first ChildProductI18n filtered by the meta_keywords column
*
* @method array findById(int $id) Return ChildProductI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildProductI18n objects filtered by the locale column
@@ -70,7 +70,7 @@ use Thelia\Model\Map\ProductI18nTableMap;
* @method array findByPostscriptum(string $postscriptum) Return ChildProductI18n objects filtered by the postscriptum column
* @method array findByMetaTitle(string $meta_title) Return ChildProductI18n objects filtered by the meta_title column
* @method array findByMetaDescription(string $meta_description) Return ChildProductI18n objects filtered by the meta_description column
* @method array findByMetaKeyword(string $meta_keyword) Return ChildProductI18n objects filtered by the meta_keyword column
* @method array findByMetaKeywords(string $meta_keywords) Return ChildProductI18n objects filtered by the meta_keywords column
*
*/
abstract class ProductI18nQuery extends ModelCriteria
@@ -159,7 +159,7 @@ abstract class ProductI18nQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORD FROM product_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM product_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -507,32 +507,32 @@ abstract class ProductI18nQuery extends ModelCriteria
}
/**
* Filter the query on the meta_keyword column
* Filter the query on the meta_keywords column
*
* Example usage:
* <code>
* $query->filterByMetaKeyword('fooValue'); // WHERE meta_keyword = 'fooValue'
* $query->filterByMetaKeyword('%fooValue%'); // WHERE meta_keyword LIKE '%fooValue%'
* $query->filterByMetaKeywords('fooValue'); // WHERE meta_keywords = 'fooValue'
* $query->filterByMetaKeywords('%fooValue%'); // WHERE meta_keywords LIKE '%fooValue%'
* </code>
*
* @param string $metaKeyword The value to use as filter.
* @param string $metaKeywords The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductI18nQuery The current query, for fluid interface
*/
public function filterByMetaKeyword($metaKeyword = null, $comparison = null)
public function filterByMetaKeywords($metaKeywords = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($metaKeyword)) {
if (is_array($metaKeywords)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $metaKeyword)) {
$metaKeyword = str_replace('*', '%', $metaKeyword);
} elseif (preg_match('/[\%\*]/', $metaKeywords)) {
$metaKeywords = str_replace('*', '%', $metaKeywords);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ProductI18nTableMap::META_KEYWORD, $metaKeyword, $comparison);
return $this->addUsingAlias(ProductI18nTableMap::META_KEYWORDS, $metaKeywords, $comparison);
}
/**

View File

@@ -57,7 +57,7 @@ class CategoryI18nTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 9;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class CategoryI18nTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 6;
const NUM_HYDRATE_COLUMNS = 9;
/**
* the column name for the ID field
@@ -99,6 +99,21 @@ class CategoryI18nTableMap extends TableMap
*/
const POSTSCRIPTUM = 'category_i18n.POSTSCRIPTUM';
/**
* the column name for the META_TITLE field
*/
const META_TITLE = 'category_i18n.META_TITLE';
/**
* the column name for the META_DESCRIPTION field
*/
const META_DESCRIPTION = 'category_i18n.META_DESCRIPTION';
/**
* the column name for the META_KEYWORDS field
*/
const META_KEYWORDS = 'category_i18n.META_KEYWORDS';
/**
* The default string format for model objects of the related table
*/
@@ -111,12 +126,12 @@ class CategoryI18nTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_COLNAME => array(CategoryI18nTableMap::ID, CategoryI18nTableMap::LOCALE, CategoryI18nTableMap::TITLE, CategoryI18nTableMap::DESCRIPTION, CategoryI18nTableMap::CHAPO, CategoryI18nTableMap::POSTSCRIPTUM, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', 'MetaTitle', 'MetaDescription', 'MetaKeywords', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'metaTitle', 'metaDescription', 'metaKeywords', ),
self::TYPE_COLNAME => array(CategoryI18nTableMap::ID, CategoryI18nTableMap::LOCALE, CategoryI18nTableMap::TITLE, CategoryI18nTableMap::DESCRIPTION, CategoryI18nTableMap::CHAPO, CategoryI18nTableMap::POSTSCRIPTUM, CategoryI18nTableMap::META_TITLE, CategoryI18nTableMap::META_DESCRIPTION, CategoryI18nTableMap::META_KEYWORDS, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'meta_title', 'meta_description', 'meta_keywords', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -126,12 +141,12 @@ class CategoryI18nTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_COLNAME => array(CategoryI18nTableMap::ID => 0, CategoryI18nTableMap::LOCALE => 1, CategoryI18nTableMap::TITLE => 2, CategoryI18nTableMap::DESCRIPTION => 3, CategoryI18nTableMap::CHAPO => 4, CategoryI18nTableMap::POSTSCRIPTUM => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, 'MetaTitle' => 6, 'MetaDescription' => 7, 'MetaKeywords' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'metaTitle' => 6, 'metaDescription' => 7, 'metaKeywords' => 8, ),
self::TYPE_COLNAME => array(CategoryI18nTableMap::ID => 0, CategoryI18nTableMap::LOCALE => 1, CategoryI18nTableMap::TITLE => 2, CategoryI18nTableMap::DESCRIPTION => 3, CategoryI18nTableMap::CHAPO => 4, CategoryI18nTableMap::POSTSCRIPTUM => 5, CategoryI18nTableMap::META_TITLE => 6, CategoryI18nTableMap::META_DESCRIPTION => 7, CategoryI18nTableMap::META_KEYWORDS => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, 'META_TITLE' => 6, 'META_DESCRIPTION' => 7, 'META_KEYWORDS' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'meta_title' => 6, 'meta_description' => 7, 'meta_keywords' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -156,6 +171,9 @@ class CategoryI18nTableMap extends TableMap
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_TITLE', 'MetaTitle', 'VARCHAR', false, 255, null);
$this->addColumn('META_DESCRIPTION', 'MetaDescription', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_KEYWORDS', 'MetaKeywords', 'LONGVARCHAR', false, null, null);
} // initialize()
/**
@@ -359,6 +377,9 @@ class CategoryI18nTableMap extends TableMap
$criteria->addSelectColumn(CategoryI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(CategoryI18nTableMap::CHAPO);
$criteria->addSelectColumn(CategoryI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(CategoryI18nTableMap::META_TITLE);
$criteria->addSelectColumn(CategoryI18nTableMap::META_DESCRIPTION);
$criteria->addSelectColumn(CategoryI18nTableMap::META_KEYWORDS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
@@ -366,6 +387,9 @@ class CategoryI18nTableMap extends TableMap
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.CHAPO');
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.META_TITLE');
$criteria->addSelectColumn($alias . '.META_DESCRIPTION');
$criteria->addSelectColumn($alias . '.META_KEYWORDS');
}
}

View File

@@ -208,7 +208,7 @@ class CategoryTableMap extends TableMap
public function getBehaviors()
{
return array(
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum, meta_title, meta_description, meta_keywords', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);

View File

@@ -57,7 +57,7 @@ class ContentI18nTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 9;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ContentI18nTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 6;
const NUM_HYDRATE_COLUMNS = 9;
/**
* the column name for the ID field
@@ -99,6 +99,21 @@ class ContentI18nTableMap extends TableMap
*/
const POSTSCRIPTUM = 'content_i18n.POSTSCRIPTUM';
/**
* the column name for the META_TITLE field
*/
const META_TITLE = 'content_i18n.META_TITLE';
/**
* the column name for the META_DESCRIPTION field
*/
const META_DESCRIPTION = 'content_i18n.META_DESCRIPTION';
/**
* the column name for the META_KEYWORDS field
*/
const META_KEYWORDS = 'content_i18n.META_KEYWORDS';
/**
* The default string format for model objects of the related table
*/
@@ -111,12 +126,12 @@ class ContentI18nTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_COLNAME => array(ContentI18nTableMap::ID, ContentI18nTableMap::LOCALE, ContentI18nTableMap::TITLE, ContentI18nTableMap::DESCRIPTION, ContentI18nTableMap::CHAPO, ContentI18nTableMap::POSTSCRIPTUM, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', 'MetaTitle', 'MetaDescription', 'MetaKeywords', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'metaTitle', 'metaDescription', 'metaKeywords', ),
self::TYPE_COLNAME => array(ContentI18nTableMap::ID, ContentI18nTableMap::LOCALE, ContentI18nTableMap::TITLE, ContentI18nTableMap::DESCRIPTION, ContentI18nTableMap::CHAPO, ContentI18nTableMap::POSTSCRIPTUM, ContentI18nTableMap::META_TITLE, ContentI18nTableMap::META_DESCRIPTION, ContentI18nTableMap::META_KEYWORDS, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'meta_title', 'meta_description', 'meta_keywords', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -126,12 +141,12 @@ class ContentI18nTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_COLNAME => array(ContentI18nTableMap::ID => 0, ContentI18nTableMap::LOCALE => 1, ContentI18nTableMap::TITLE => 2, ContentI18nTableMap::DESCRIPTION => 3, ContentI18nTableMap::CHAPO => 4, ContentI18nTableMap::POSTSCRIPTUM => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, 'MetaTitle' => 6, 'MetaDescription' => 7, 'MetaKeywords' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'metaTitle' => 6, 'metaDescription' => 7, 'metaKeywords' => 8, ),
self::TYPE_COLNAME => array(ContentI18nTableMap::ID => 0, ContentI18nTableMap::LOCALE => 1, ContentI18nTableMap::TITLE => 2, ContentI18nTableMap::DESCRIPTION => 3, ContentI18nTableMap::CHAPO => 4, ContentI18nTableMap::POSTSCRIPTUM => 5, ContentI18nTableMap::META_TITLE => 6, ContentI18nTableMap::META_DESCRIPTION => 7, ContentI18nTableMap::META_KEYWORDS => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, 'META_TITLE' => 6, 'META_DESCRIPTION' => 7, 'META_KEYWORDS' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'meta_title' => 6, 'meta_description' => 7, 'meta_keywords' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -156,6 +171,9 @@ class ContentI18nTableMap extends TableMap
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_TITLE', 'MetaTitle', 'VARCHAR', false, 255, null);
$this->addColumn('META_DESCRIPTION', 'MetaDescription', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_KEYWORDS', 'MetaKeywords', 'LONGVARCHAR', false, null, null);
} // initialize()
/**
@@ -359,6 +377,9 @@ class ContentI18nTableMap extends TableMap
$criteria->addSelectColumn(ContentI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(ContentI18nTableMap::CHAPO);
$criteria->addSelectColumn(ContentI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(ContentI18nTableMap::META_TITLE);
$criteria->addSelectColumn(ContentI18nTableMap::META_DESCRIPTION);
$criteria->addSelectColumn(ContentI18nTableMap::META_KEYWORDS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
@@ -366,6 +387,9 @@ class ContentI18nTableMap extends TableMap
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.CHAPO');
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.META_TITLE');
$criteria->addSelectColumn($alias . '.META_DESCRIPTION');
$criteria->addSelectColumn($alias . '.META_KEYWORDS');
}
}

View File

@@ -204,7 +204,7 @@ class ContentTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum, meta_title, meta_description, meta_keywords', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
);
} // getBehaviors()

View File

@@ -57,7 +57,7 @@ class FolderI18nTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 9;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class FolderI18nTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 6;
const NUM_HYDRATE_COLUMNS = 9;
/**
* the column name for the ID field
@@ -99,6 +99,21 @@ class FolderI18nTableMap extends TableMap
*/
const POSTSCRIPTUM = 'folder_i18n.POSTSCRIPTUM';
/**
* the column name for the META_TITLE field
*/
const META_TITLE = 'folder_i18n.META_TITLE';
/**
* the column name for the META_DESCRIPTION field
*/
const META_DESCRIPTION = 'folder_i18n.META_DESCRIPTION';
/**
* the column name for the META_KEYWORDS field
*/
const META_KEYWORDS = 'folder_i18n.META_KEYWORDS';
/**
* The default string format for model objects of the related table
*/
@@ -111,12 +126,12 @@ class FolderI18nTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_COLNAME => array(FolderI18nTableMap::ID, FolderI18nTableMap::LOCALE, FolderI18nTableMap::TITLE, FolderI18nTableMap::DESCRIPTION, FolderI18nTableMap::CHAPO, FolderI18nTableMap::POSTSCRIPTUM, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', 'MetaTitle', 'MetaDescription', 'MetaKeywords', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'metaTitle', 'metaDescription', 'metaKeywords', ),
self::TYPE_COLNAME => array(FolderI18nTableMap::ID, FolderI18nTableMap::LOCALE, FolderI18nTableMap::TITLE, FolderI18nTableMap::DESCRIPTION, FolderI18nTableMap::CHAPO, FolderI18nTableMap::POSTSCRIPTUM, FolderI18nTableMap::META_TITLE, FolderI18nTableMap::META_DESCRIPTION, FolderI18nTableMap::META_KEYWORDS, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'meta_title', 'meta_description', 'meta_keywords', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -126,12 +141,12 @@ class FolderI18nTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_COLNAME => array(FolderI18nTableMap::ID => 0, FolderI18nTableMap::LOCALE => 1, FolderI18nTableMap::TITLE => 2, FolderI18nTableMap::DESCRIPTION => 3, FolderI18nTableMap::CHAPO => 4, FolderI18nTableMap::POSTSCRIPTUM => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, 'MetaTitle' => 6, 'MetaDescription' => 7, 'MetaKeywords' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'metaTitle' => 6, 'metaDescription' => 7, 'metaKeywords' => 8, ),
self::TYPE_COLNAME => array(FolderI18nTableMap::ID => 0, FolderI18nTableMap::LOCALE => 1, FolderI18nTableMap::TITLE => 2, FolderI18nTableMap::DESCRIPTION => 3, FolderI18nTableMap::CHAPO => 4, FolderI18nTableMap::POSTSCRIPTUM => 5, FolderI18nTableMap::META_TITLE => 6, FolderI18nTableMap::META_DESCRIPTION => 7, FolderI18nTableMap::META_KEYWORDS => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, 'META_TITLE' => 6, 'META_DESCRIPTION' => 7, 'META_KEYWORDS' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'meta_title' => 6, 'meta_description' => 7, 'meta_keywords' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
@@ -156,6 +171,9 @@ class FolderI18nTableMap extends TableMap
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_TITLE', 'MetaTitle', 'VARCHAR', false, 255, null);
$this->addColumn('META_DESCRIPTION', 'MetaDescription', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_KEYWORDS', 'MetaKeywords', 'LONGVARCHAR', false, null, null);
} // initialize()
/**
@@ -359,6 +377,9 @@ class FolderI18nTableMap extends TableMap
$criteria->addSelectColumn(FolderI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(FolderI18nTableMap::CHAPO);
$criteria->addSelectColumn(FolderI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(FolderI18nTableMap::META_TITLE);
$criteria->addSelectColumn(FolderI18nTableMap::META_DESCRIPTION);
$criteria->addSelectColumn(FolderI18nTableMap::META_KEYWORDS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
@@ -366,6 +387,9 @@ class FolderI18nTableMap extends TableMap
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.CHAPO');
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.META_TITLE');
$criteria->addSelectColumn($alias . '.META_DESCRIPTION');
$criteria->addSelectColumn($alias . '.META_KEYWORDS');
}
}

View File

@@ -208,7 +208,7 @@ class FolderTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum, meta_title, meta_description, meta_keywords', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
);
} // getBehaviors()

View File

@@ -110,9 +110,9 @@ class ProductI18nTableMap extends TableMap
const META_DESCRIPTION = 'product_i18n.META_DESCRIPTION';
/**
* the column name for the META_KEYWORD field
* the column name for the META_KEYWORDS field
*/
const META_KEYWORD = 'product_i18n.META_KEYWORD';
const META_KEYWORDS = 'product_i18n.META_KEYWORDS';
/**
* The default string format for model objects of the related table
@@ -126,11 +126,11 @@ class ProductI18nTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', 'MetaTitle', 'MetaDescription', 'MetaKeyword', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'metaTitle', 'metaDescription', 'metaKeyword', ),
self::TYPE_COLNAME => array(ProductI18nTableMap::ID, ProductI18nTableMap::LOCALE, ProductI18nTableMap::TITLE, ProductI18nTableMap::DESCRIPTION, ProductI18nTableMap::CHAPO, ProductI18nTableMap::POSTSCRIPTUM, ProductI18nTableMap::META_TITLE, ProductI18nTableMap::META_DESCRIPTION, ProductI18nTableMap::META_KEYWORD, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORD', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'meta_title', 'meta_description', 'meta_keyword', ),
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', 'MetaTitle', 'MetaDescription', 'MetaKeywords', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'metaTitle', 'metaDescription', 'metaKeywords', ),
self::TYPE_COLNAME => array(ProductI18nTableMap::ID, ProductI18nTableMap::LOCALE, ProductI18nTableMap::TITLE, ProductI18nTableMap::DESCRIPTION, ProductI18nTableMap::CHAPO, ProductI18nTableMap::POSTSCRIPTUM, ProductI18nTableMap::META_TITLE, ProductI18nTableMap::META_DESCRIPTION, ProductI18nTableMap::META_KEYWORDS, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', 'meta_title', 'meta_description', 'meta_keywords', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
@@ -141,11 +141,11 @@ class ProductI18nTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, 'MetaTitle' => 6, 'MetaDescription' => 7, 'MetaKeyword' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'metaTitle' => 6, 'metaDescription' => 7, 'metaKeyword' => 8, ),
self::TYPE_COLNAME => array(ProductI18nTableMap::ID => 0, ProductI18nTableMap::LOCALE => 1, ProductI18nTableMap::TITLE => 2, ProductI18nTableMap::DESCRIPTION => 3, ProductI18nTableMap::CHAPO => 4, ProductI18nTableMap::POSTSCRIPTUM => 5, ProductI18nTableMap::META_TITLE => 6, ProductI18nTableMap::META_DESCRIPTION => 7, ProductI18nTableMap::META_KEYWORD => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, 'META_TITLE' => 6, 'META_DESCRIPTION' => 7, 'META_KEYWORD' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'meta_title' => 6, 'meta_description' => 7, 'meta_keyword' => 8, ),
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, 'MetaTitle' => 6, 'MetaDescription' => 7, 'MetaKeywords' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'metaTitle' => 6, 'metaDescription' => 7, 'metaKeywords' => 8, ),
self::TYPE_COLNAME => array(ProductI18nTableMap::ID => 0, ProductI18nTableMap::LOCALE => 1, ProductI18nTableMap::TITLE => 2, ProductI18nTableMap::DESCRIPTION => 3, ProductI18nTableMap::CHAPO => 4, ProductI18nTableMap::POSTSCRIPTUM => 5, ProductI18nTableMap::META_TITLE => 6, ProductI18nTableMap::META_DESCRIPTION => 7, ProductI18nTableMap::META_KEYWORDS => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, 'META_TITLE' => 6, 'META_DESCRIPTION' => 7, 'META_KEYWORDS' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, 'meta_title' => 6, 'meta_description' => 7, 'meta_keywords' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
@@ -173,7 +173,7 @@ class ProductI18nTableMap extends TableMap
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_TITLE', 'MetaTitle', 'VARCHAR', false, 255, null);
$this->addColumn('META_DESCRIPTION', 'MetaDescription', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_KEYWORD', 'MetaKeyword', 'LONGVARCHAR', false, null, null);
$this->addColumn('META_KEYWORDS', 'MetaKeywords', 'LONGVARCHAR', false, null, null);
} // initialize()
/**
@@ -379,7 +379,7 @@ class ProductI18nTableMap extends TableMap
$criteria->addSelectColumn(ProductI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(ProductI18nTableMap::META_TITLE);
$criteria->addSelectColumn(ProductI18nTableMap::META_DESCRIPTION);
$criteria->addSelectColumn(ProductI18nTableMap::META_KEYWORD);
$criteria->addSelectColumn(ProductI18nTableMap::META_KEYWORDS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
@@ -389,7 +389,7 @@ class ProductI18nTableMap extends TableMap
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
$criteria->addSelectColumn($alias . '.META_TITLE');
$criteria->addSelectColumn($alias . '.META_DESCRIPTION');
$criteria->addSelectColumn($alias . '.META_KEYWORD');
$criteria->addSelectColumn($alias . '.META_KEYWORDS');
}
}

View File

@@ -230,7 +230,7 @@ class ProductTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum, meta_title, meta_description, meta_keyword', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum, meta_title, meta_description, meta_keywords', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
);
} // getBehaviors()

View File

@@ -163,7 +163,7 @@ trait UrlRewritingTrait {
public function setRewrittenUrl($locale, $url)
{
$currentUrl = $this->getRewrittenUrl($locale);
if($currentUrl == $url) {
if($currentUrl == $url || null === $url) {
/* no url update */
return $this;
}

View File

@@ -44,7 +44,6 @@ use Thelia\Tests\TestCaseWithURLToolSetup;
*/
class ContentTest extends TestCaseWithURLToolSetup
{
use RewrittenUrlTestTrait;
public function getUpdateEvent(&$content)
{
@@ -111,7 +110,6 @@ class ContentTest extends TestCaseWithURLToolSetup
->setChapo('test update content short description')
->setDescription('test update content description')
->setPostscriptum('test update content postscriptum')
->setUrl($content->getRewrittenUrl('en_US'))
->setDefaultFolder($folder->getId())
;

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Tests\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Action\Folder;
use Thelia\Core\Event\Folder\FolderCreateEvent;
@@ -29,6 +30,7 @@ use Thelia\Core\Event\Folder\FolderDeleteEvent;
use Thelia\Core\Event\Folder\FolderToggleVisibilityEvent;
use Thelia\Core\Event\Folder\FolderUpdateEvent;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Model\FolderQuery;
use Thelia\Tests\TestCaseWithURLToolSetup;
@@ -61,6 +63,29 @@ class FolderTest extends TestCaseWithURLToolSetup
return $event;
}
public function getUpdateSeoEvent(&$folder)
{
if(!$folder instanceof \Thelia\Model\Folder) {
$folder = $this->getRandomFolder();
}
$event = new UpdateSeoEvent($folder->getId());
$event
->setLocale($folder->getLocale())
->setMetaTitle($folder->getMetaTitle())
->setMetaDescription($folder->getMetaDescription())
->setMetaKeywords($folder->getMetaKeywords());
return $event;
}
public function processUpdateSeoAction($event)
{
$contentAction = new Folder($this->getContainer());
return $contentAction->updateSeo($event);
}
public function processUpdateAction($event)
{
$contentAction = new Folder($this->getContainer());
@@ -113,7 +138,6 @@ class FolderTest extends TestCaseWithURLToolSetup
->setChapo('test folder update chapo')
->setDescription('update folder description')
->setPostscriptum('update folder postscriptum')
->setUrl($folder->getRewrittenUrl('en_US'))
->setParent(0)
;

View File

@@ -18,7 +18,9 @@ use Thelia\Tools\URL;
trait RewrittenUrlTestTrait
{
abstract public function getUpdateEvent(&$object);
abstract public function getUpdateSeoEvent(&$object);
abstract public function processUpdateAction($event);
abstract public function processUpdateSeoAction($event);
/**
* @expectedException \Thelia\Form\Exception\FormValidationException
@@ -27,7 +29,7 @@ trait RewrittenUrlTestTrait
public function testUpdateExistingUrl()
{
$object = null;
$event = $this->getUpdateEvent($object);
$event = $this->getUpdateSeoEvent($object);
/* get an existing url */
$existingUrl = RewritingUrlQuery::create()
@@ -42,13 +44,13 @@ trait RewrittenUrlTestTrait
$event->setUrl($existingUrl->getUrl());
$this->processUpdateAction($event);
$this->processUpdateSeoAction($event);
}
public function testUpdateUrl()
{
$object = null;
$event = $this->getUpdateEvent($object);
$event = $this->getUpdateSeoEvent($object);
$currentUrl = $object->getRewrittenUrl($object->getLocale());
@@ -70,7 +72,7 @@ trait RewrittenUrlTestTrait
$event->setUrl($newUrl);
$updatedObject = $this->processUpdateAction($event);
$updatedObject = $this->processUpdateSeoAction($event);
/* new URL is updated */
$this->assertEquals($newUrl, $updatedObject->getRewrittenUrl($object->getLocale()));

View File

@@ -1635,6 +1635,9 @@ CREATE TABLE `category_i18n`
`description` LONGTEXT,
`chapo` TEXT,
`postscriptum` TEXT,
`meta_title` VARCHAR(255),
`meta_description` TEXT,
`meta_keywords` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `category_i18n_FK_1`
FOREIGN KEY (`id`)
@@ -1658,7 +1661,7 @@ CREATE TABLE `product_i18n`
`postscriptum` TEXT,
`meta_title` VARCHAR(255),
`meta_description` TEXT,
`meta_keyword` TEXT,
`meta_keywords` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `product_i18n_FK_1`
FOREIGN KEY (`id`)
@@ -1863,6 +1866,9 @@ CREATE TABLE `folder_i18n`
`description` LONGTEXT,
`chapo` TEXT,
`postscriptum` TEXT,
`meta_title` VARCHAR(255),
`meta_description` TEXT,
`meta_keywords` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `folder_i18n_FK_1`
FOREIGN KEY (`id`)
@@ -1884,6 +1890,9 @@ CREATE TABLE `content_i18n`
`description` LONGTEXT,
`chapo` TEXT,
`postscriptum` TEXT,
`meta_title` VARCHAR(255),
`meta_description` TEXT,
`meta_keywords` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `content_i18n_FK_1`
FOREIGN KEY (`id`)

File diff suppressed because it is too large Load Diff

View File

@@ -6,296 +6,293 @@
{block name="page-title"}{intl l='Edit category'}{/block}
{block name="main-content"}
<div class="catalog edit-category">
<div id="wrapper" class="container">
{include file="includes/catalog-breadcrumb.html" editing_category="true"}
<div class="catalog edit-category">
<div id="wrapper" class="container">
<div class="row">
{loop name="category_edit" type="category" visible="*" id="{$category_id}" backend_context="1" lang="$edit_language_id"}
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-7 title">
{intl l='Edit category %title' title=$TITLE}
</div>
{include file="includes/catalog-breadcrumb.html" editing_category="true"}
<div class="col-md-5 actions">
<div class="row">
{loop name="category_edit" type="category" visible="*" id="{$category_id}" backend_context="1" lang="$edit_language_id"}
{if $HAS_PREVIOUS != 0}
<a href="{url path='/admin/categories/update' category_id=$PREVIOUS}" class="btn btn-default" title="{intl l='Edit previous category'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span></a>
{/if}
{* Define close url *}
{if $PARENT gt 0}
{assign var='close_url' value="{url path='/admin/categories' category_id=$PARENT}"}
{else}
{assign var='close_url' value="{url path='/admin/catalog'}"}
{/if}
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview category page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
{if $HAS_NEXT != 0}
<a href="{url path='/admin/categories/update' category_id=$NEXT}" class="btn btn-default" title="{intl l='Edit next category'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-right"></span></a>
{/if}
</div>
</div>
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-7 title">
{intl l='Edit category %title</small>' title=$TITLE}
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-5 actions">
<a {if $HAS_PREVIOUS != 0}href="{url path='/admin/categories/update' category_id=$PREVIOUS}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit previous category'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview category page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
<a {if $HAS_NEXT != 0}href="{url path='/admin/categories/update' category_id=$NEXT}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit next category'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
</div>
</div>
<ul class="nav nav-tabs" id="tabbed-menu">
<li {if $current_tab == 'general'}class="active"{/if}><a href="#general" data-toggle="tab">{intl l="General description"}</a></li>
<li {if $current_tab == 'associations'}class="active"{/if}><a href="#associations" data-toggle="tab">{intl l="Associations"}</a></li>
<li {if $current_tab == 'images'}class="active"{/if}><a href="#images" data-toggle="tab">{intl l="Images"}</a></li>
<li {if $current_tab == 'documents'}class="active"{/if}><a href="#documents" data-toggle="tab">{intl l="Documents"}</a></li>
<li {if $current_tab == 'modules'}class="active"{/if}><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
</ul>
<div class="row">
<div class="col-md-12">
<div class="tab-content">
<ul class="nav nav-tabs" id="tabbed-menu">
<li><a href="#general" data-toggle="tab">{intl l="General description"}</a></li>
<li><a href="#seo" data-toggle="tab">{intl l="SEO"}</a></li>
<li><a href="#associations" data-toggle="tab">{intl l="Associations"}</a></li>
<li><a href="#images" data-toggle="tab">{intl l="Images"}</a></li>
<li><a href="#documents" data-toggle="tab">{intl l="Documents"}</a></li>
<li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
</ul>
<div class="tab-pane fade {if $current_tab == 'general'}active in{/if}" id="general">
<div class="tab-content">
<div class="form-container">
<div class="tab-pane fade" id="general">
{form name="thelia.admin.category.modification"}
<form method="POST" action="{url path='/admin/categories/save'}" {form_enctype form=$form} class="clearfix">
<div class="form-container">
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/categories' category_id=$PARENT}"}
{form name="thelia.admin.category.modification"}
<form method="POST" action="{url path='/admin/categories/save'}" {form_enctype form=$form} class="clearfix">
{* Be sure to get the category ID, even if the form could not be validated *}
<input type="hidden" name="category_id" value="{$category_id}" />
{include
file="includes/inner-form-toolbar.html"
close_url=$close_url
}
<input type="hidden" name="current_tab" value="general" />
{* Be sure to get the category ID, even if the form could not be validated *}
<input type="hidden" name="category_id" value="{$ID}" />
<input type="hidden" name="current_tab" value="general" />
{form_hidden_fields form=$form}
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/category' category_id={$category_id}}" />
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{$close_url}">
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{* Display error message if exist *}
{include file='includes/notifications.html' message=$form_error_message}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="row">
<div class="col-md-8">
{include file="includes/standard-description-form-fields.html"}
</div>
{include file="includes/standard-description-form-fields.html"}
<div class="col-md-4">
{form_field form=$form field='parent'}
<div class="form-group {if $error}has-error{/if}">
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewritten URL'}" class="form-control">
</div>
{/form_field}
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
<option value="0">{intl l="Top level"}</option>
<div class="row">
<div class="col-md-6">
{form_field form=$form field='parent'}
<div class="form-group {if $error}has-error{/if}">
{$myparent=$PARENT}
{loop name="cat-parent" type="category-tree" visible="*" category="0"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $myparent == $ID}selected="selected"{/if} {if $category_id == $ID}disabled="disabled"{/if}>{$TITLE}</option>
{/loop}
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
</select>
</div>
{/form_field}
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
<option value="0">{intl l="Top level"}</option>
{$myparent=$PARENT}
{loop name="cat-parent" type="category-tree" visible="*" category="0"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $myparent == $ID}selected="selected"{/if} {if $category_id == $ID}disabled="disabled"{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-group">
<lablel>&nbsp;</lablel>
<div class="controls">
<p>{intl l='Category created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
{include
file="includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
close_url=$close_url
}
<small>{intl l='Category created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</small>
</form>
{/form}
</div>
</div>
<div class="tab-pane fade" id="seo">
{form name="thelia.admin.seo"}
{include file="includes/seo-tab.html"
form = $form
formAction = "{url path='/admin/categories/seo/save'}"
current_id=$ID
closeUrl = $close_url
}
{/form}
</div>
<div class="tab-pane fade" id="associations">
<div class="form-container">
<div class="form-group">
<form action="{url path='/admin/categories/related-content/add'}" id="related_content_form">
{include
file="includes/inner-form-toolbar.html"
hide_submit_buttons=true
close_url=$close_url
}
<p class="title title-without-tabs">{intl l='Related content'}</p>
<p>{intl l='You can attach here some content to this category'}</p>
<input type="hidden" name="category_id" value="{$ID}" />
<input type="hidden" name="current_tab" value="associations" />
{ifloop rel="folders"}
<div class="row">
<div class="col-md-6">
<div class="form-group">
<select name="folder_id" id="folder_id" class="form-control">
<option value="">{intl l='Select a folder...'}</option>
{loop name="folders" type="folder-tree" folder="0" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
{/loop}
</select>
</div>
<span class="help-block">{intl l='Select a folder to get its content'}</span>
</div>
</div>
</div>
<div class="col-md-6">
<div id="content_selector" class="hide">
<div class="input-group">
<select required="required" name="content_id" id="content_id" class="form-control">
<option value="">{intl l='Select a folder content...'}</option>
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select a content and click (+) to add it to this category'}</span>
</div>
<div id="content_selector_empty" class="hide">
<div class="alert alert-info">
{intl l="No available content in this folder"}
</div>
</div>
</div>
</div>
{/ifloop}
{elseloop rel="folders"}
<div class="alert alert-info">{intl l="No folders found"}</div>
{/elseloop}
</form>
</div>
</form>
{/form}
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<div class="tab-pane fade {if $current_tab == 'associations'}active in{/if}" id="associations">
<div class="form-container">
<div class="form-group">
<form action="{url path='/admin/categories/related-content/add'}" id="related_content_form">
<th>{intl l='Content title'}</th>
{include
file="includes/inner-form-toolbar.html"
hide_submit_buttons=true
close_url="{url path='/admin/categories' category_id=$PARENT}"
}
{module_include location='category_contents_table_header'}
<p class="title title-without-tabs">{intl l='Related content'}</p>
<p>{intl l='You can attach here some content to this category'}</p>
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<input type="hidden" name="category_id" value="{$category_id}" />
<input type="hidden" name="current_tab" value="associations" />
<tbody>
{loop name="assigned_contents" type="associated_content" category="$ID" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
{ifloop rel="folders"}
<div class="row">
<td>{$TITLE}</td>
<div class="col-md-6">
<div class="form-group">
<select name="folder_id" id="folder_id" class="form-control">
<option value="">{intl l='Select a folder...'}</option>
{loop name="folders" type="folder-tree" folder="0" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
{/loop}
</select>
</div>
<span class="help-block">{intl l='Select a folder to get its content'}</span>
</div>
{module_include location='category_contents_table_row'}
<div class="col-md-6">
<div id="content_selector" class="hide">
<div class="input-group">
<select required="required" name="content_id" id="content_id" class="form-control">
<option value="">{intl l='Select a folder content...'}</option>
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.category" access="UPDATE"}
<a class="btn btn-default btn-xs delete-content" title="{intl l='Delete this content'}" href="#delete_content_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
<span class="help-block">{intl l='Select a content and click (+) to add it to this category'}</span>
</div>
{elseloop rel="assigned_contents"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This category contains no contents"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
<div id="content_selector_empty" class="hide">
<div class="alert alert-info">
{intl l="No available content in this folder"}
</div>
</div>
</div>
<div class="tab-pane fade" id="images">
{include file='includes/image-upload-form.html' imageType='category' parentId=$ID}
</div>
</div>
{/ifloop}
<div class="tab-pane fade" id="documents">
{include file='includes/document-upload-form.html' documentType='category' parentId=$ID}
</div>
{elseloop rel="folders"}
<div class="alert alert-info">{intl l="No folders found"}</div>
{/elseloop}
</form>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Content title'}</th>
{module_include location='category_contents_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_contents" type="associated_content" category="$category_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
{module_include location='category_contents_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.category" access="UPDATE"}
<a class="btn btn-default btn-xs delete-content" title="{intl l='Delete this content'}" href="#delete_content_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="assigned_contents"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This category contains no contents"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade {if $current_tab == 'images'}active in{/if}" id="images">
{include file='includes/image-upload-form.html' imageType='category' parentId=$category_id}
</div>
<div class="tab-pane fade {if $current_tab == 'documents'}active in{/if}" id="documents">
{include file='includes/document-upload-form.html' documentType='category' parentId=$category_id}
</div>
<div class="tab-pane fade {if $current_tab == 'modules'}active in{/if}" id="modules">
</div>
</div>
<div class="tab-pane fade" id="modules">
{module_include location='category-edit'}
</div>
</div>
</div>
</div>
</div>
</div>
{/loop}
</div>
</div>
</div>
{/loop}
</div>
</div>
</div>
{* Delete related content confirmation dialog *}
{* Delete related content confirmation dialog *}
{capture "delete_content_dialog"}
<input type="hidden" name="category_id" value="{$category_id}" />
<input type="hidden" name="content_id" id="content_delete_id" value="" />
<input type="hidden" name="folder_id" id="folder_delete_id" value="" />
{capture "delete_content_dialog"}
<input type="hidden" name="category_id" value="{$category_id}" />
<input type="hidden" name="content_id" id="content_delete_id" value="" />
<input type="hidden" name="folder_id" id="folder_delete_id" value="" />
<input type="hidden" name="current_tab" value="associations" />
{/capture}
<input type="hidden" name="current_tab" value="associations" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_content_dialog"
dialog_title = {intl l="Remove related content"}
dialog_message = {intl l="Do you really want to remove this related content ?"}
dialog_id = "delete_content_dialog"
dialog_title = {intl l="Remove related content"}
dialog_message = {intl l="Do you really want to remove this related content ?"}
form_action = {url path='/admin/categories/related-content/delete'}
form_content = {$smarty.capture.delete_content_dialog nofilter}
}
form_action = {url path='/admin/categories/related-content/delete'}
form_content = {$smarty.capture.delete_content_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
@@ -347,6 +344,9 @@ $(function() {
$('#folder_delete_id').val($('#folder_id').val());
});
// Load active tab
$('.nav-tabs a[href="#{$current_tab}"]').trigger("click");
// Load content on folder selection
$('#folder_id').change(function(event) {

View File

@@ -42,7 +42,7 @@
<ul class="nav nav-tabs" id="tabbed-menu">
<li class="active"><a href="#general" data-toggle="tab">{intl l="General description"}</a></li>
<li><a href="#seo" data-toggle="tab">{intl l="SEO"}</a></li>
<li><a href="#association" data-toggle="tab">{intl l="Associations"}</a></li>
<li><a href="#images" data-toggle="tab">{intl l="Images"}</a></li>
<li><a href="#documents" data-toggle="tab">{intl l="Documents"}</a></li>
@@ -77,20 +77,13 @@
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{include file="includes/standard-description-form-fields.html"}
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewritten URL'}" class="form-control">
<div class="row">
<div class="col-md-8">
{include file="includes/standard-description-form-fields.html"}
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
<div class="col-md-4">
{form_field form=$form field='default_folder'}
<div class="form-group {if $error}has-error{/if}">
@@ -109,9 +102,7 @@
</select>
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
@@ -126,22 +117,32 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-group">
<lablel>&nbsp;</lablel>
<div class="controls">
<p>{intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>
</div>
</div>
{include
file="includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
close_url="{url path='/admin/folders' parent=$DEFAULT_FOLDER}"
}
<small>{intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</small>
</form>
{/form}
</div>
</div>
<div class="tab-pane fade" id="seo">
{form name="thelia.admin.seo"}
{include file="includes/seo-tab.html"
form = $form
formAction = "{url path='/admin/content/seo/save'}"
closeUrl = "{url path='/admin/folders' parent=$DEFAULT_FOLDER}"
current_id = $content_id
}
{/form}
</div>
<div class="tab-pane fade" id="association">
{include file="includes/content-folder-management.html"}
</div>

View File

@@ -13,28 +13,21 @@
<div class="row">
{loop name="folder_edit" type="folder" visible="*" id="{$folder_id}" backend_context="1" lang="$edit_language_id"}
{* Define close url *}
{assign var='close_url' value="{url path='/admin/folders' folder_id=$ID}"}
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-7 title">
{intl l='Edit folder %title' title=$TITLE}
</div>
<div class="col-md-5 actions">
{if $HAS_PREVIOUS != 0}
<a href="{url path="/admin/folders/update/$PREVIOUS"}" class="btn btn-default" title="{intl l='Edit previous folder'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span></a>
{/if}
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview folder page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
{if $HAS_NEXT != 0}
<a href="{url path="/admin/folders/update/$NEXT"}" class="btn btn-default" title="{intl l='Edit next folder'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-right"></span></a>
{/if}
</div>
<div class="col-md-5 actions">
<a {if $HAS_PREVIOUS != 0}href="{url path="/admin/folders/update/$PREVIOUS"}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit previous folder'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview folder page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
<a {if $HAS_NEXT != 0}href="{url path="/admin/folders/update/$NEXT"}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit next folder'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
</div>
</div>
<div class="row">
@@ -42,7 +35,7 @@
<ul class="nav nav-tabs" id="tabbed-menu">
<li class="active"><a href="#general" data-toggle="tab">{intl l="General description"}</a></li>
<li><a href="#seo" data-toggle="tab">{intl l="SEO"}</a></li>
<li><a href="#details" data-toggle="tab">{intl l="Details"}</a></li>
<li><a href="#images" data-toggle="tab">{intl l="Images"}</a></li>
<li><a href="#documents" data-toggle="tab">{intl l="Documents"}</a></li>
@@ -58,40 +51,29 @@
{form name="thelia.admin.folder.modification"}
<form method="POST" action="{url path='/admin/folders/save'}" {form_enctype form=$form} class="clearfix">
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/folders' folder_id=$folder_id}"}
{include file="includes/inner-form-toolbar.html" close_url=$close_url}
{* Be sure to get the folder ID, even if the form could not be validated *}
<input type="hidden" name="folder_id" value="{$folder_id}" />
<input type="hidden" name="current_tab" value="general" />
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/folders/update{$ID}"}" />
<input type="hidden" name="{$name}" value="{url path="/admin/folders/update/{$ID}"}" />
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{* Display error message if exist *}
{include file='includes/notifications.html' message=$form_error_message}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="row">
<div class="col-md-8">
{include file="includes/standard-description-form-fields.html"}
</div>
{include file="includes/standard-description-form-fields.html"}
<div class="col-md-4">
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewritten URL'}" class="form-control">
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='parent'}
{form_field form=$form field='parent'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
@@ -109,9 +91,7 @@
</select>
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
@@ -126,22 +106,30 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-group">
<lablel>&nbsp;</lablel>
<div class="controls">
<p>{intl l='Folder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>
</div>
</div>
{include
file="includes/inner-form-toolbar.html"
hide_flags = true
close_url=$close_url
}
</form>
<small>{intl l='Colder created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</small>
</form>
{/form}
</div>
</div>
<div class="tab-pane fade" id="seo">
{form name="thelia.admin.seo"}
{include file="includes/seo-tab.html"
form = $form
formAction = "{url path='/admin/folders/seo/save'}"
closeUrl = $close_url
current_id = $folder_id
}
{/form}
</div>
<div class="tab-pane fade" id="details">
<div class="form-container">
<div class="form-group">
@@ -150,7 +138,7 @@
{include
file="includes/inner-form-toolbar.html"
hide_submit_buttons=true
close_url="{url path='/admin/folders' folder_id=$folder_id}"
close_url=$close_url
}
<input type="hidden" name="folder_id" value="{$folder_id}" />
@@ -247,11 +235,11 @@
</div>
<div class="tab-pane fade" id="images">
{include file='includes/image-upload-form.html' imageType='folder' parentId=$folder_id}
{include file='includes/image-upload-form.html' imageType='folder' parentId=$ID}
</div>
<div class="tab-pane fade" id="documents">
{include file='includes/document-upload-form.html' documentType='folder' parentId=$folder_id}
{include file='includes/document-upload-form.html' documentType='folder' parentId=$ID}
</div>
<div class="tab-pane fade" id="modules">

View File

@@ -1,11 +1,13 @@
{*
Params
- type : notification type (default alert)
- type (default: danger) : notification type
- dismissable (default: true) : Add a close button
- message : modal message
*}
{if $message}
<div class="{if $type}$type{else}alert alert-info{/if}">
<span class="icon-question-sign"></span>
<div class="alert alert-{$type|default:danger}{if not $dismissable} alert-dismissable{/if}">
{if not $dismissable}<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>{/if}
{$message}
</div>
{/if}

View File

@@ -11,54 +11,45 @@
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="general" />
{* Be sure to get the product ID, even if the form could not be validated*}
<input type="hidden" name="product_id" value="{$product_id}">
<input type="hidden" name="current_tab" value="general">
{form_hidden_fields form=$form}
{form_field form=$form field='id'}
<input type="hidden" name="{$name}" value="{$value}" />
<input type="hidden" name="{$name}" value="{$value}">
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}">
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
<input type="hidden" name="{$name}" value="{$edit_language_locale}">
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="form-group">
<label class="control-label">
{intl l='Product reference'} :
</label>
<div class="well well-sm">{$REF}</div>
{form_field form=$form field='ref'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
</div>
{include file="includes/standard-description-form-fields.html"}
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewritten URL'}" class="form-control">
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
<div class="col-md-8">
{form_field form=$form field='ref'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<div class="control-input">
{* If ref's 'value is not empty the field is disable and the value is sent with an hidden field *}
<input type="text" id="{$label_attr.for}" {if $value}name="{$name}_disabled" disabled{else}name="{$name}"{/if} class="form-control" value="{$value}"{if $required} aria-required="true" required{/if}>
{if $value}<input type="hidden" name="{$name}" value="{$value}">{/if}
</div>
</div>
{/form_field}
{include file="includes/standard-description-form-fields.html"}
</div>
<div class="col-md-4">
{form_field form=$form field='default_category'}
<div class="form-group {if $error}has-error{/if}">
@@ -79,9 +70,6 @@
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
@@ -96,16 +84,16 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-group">
<label>&nbsp;</label>
<div class="controls">
<p>{intl l='Product created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>
</div>
</div>
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
<small>{intl l='Product created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</small>
</form>
{/form}

View File

@@ -0,0 +1,81 @@
<div class="form-container">
<form method="POST" action="{$formAction}" {form_enctype form=$form} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = {$pageUrl}
close_url = {$closeUrl}
}
{* Hidden field *}
<input type="hidden" name="current_id" value="{$current_id}">
<input type="hidden" name="current_tab" value="seo">
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{$closeUrl}">
{/form_field}
{* Display error message if exist *}
{include file='includes/notifications.html' message=$form_error_message}
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
</label>
<div class="input-group">
<span class="input-group-addon">{$url_language|default:{config key="url_site"}}</span>
<input type="text" id="{$label_attr.for}" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" {if $required} aria-required="true" required{/if} class="form-control" placeholder="{intl l='Use the keyword phrase in your URL.'}">
</div>
</div>
{/form_field}
{form_field form=$form field='meta_title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='The HTML TITLE element is the most important element on your web page.'}</span>
</label>
<div class="control-input">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Make sure that your title is clear, and contains many of the keywords within the page itself.'}">
</div>
</div>
{/form_field}
{form_field form=$form field='meta_description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='Keep the most important part of your description in the first 150-160 characters.'}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="6"{if $required} aria-required="true" required{/if} placeholder="{intl l='Make sure it uses keywords found within the page itself.'}" class="form-control">{$value}</textarea>
</div>
{/form_field}
{form_field form=$form field='meta_keywords'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='You don\'t need to use commas or other punctuations.'}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="3"{if $required} aria-required="true" required{/if} placeholder="{intl l='Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.'}" class="form-control">{$value}</textarea>
</div>
{/form_field}
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
page_url = {$pageUrl}
close_url = {$closeUrl}
}
</form>
</div>

View File

@@ -6,118 +6,120 @@
{block name="page-title"}{intl l='Edit product'}{/block}
{block name="main-content"}
<div class="catalog edit-product">
<div id="wrapper" class="container">
<div class="catalog edit-product">
{include file="includes/catalog-breadcrumb.html" editing_category="false" editing_product="true"}
<div id="wrapper" class="container">
<div class="row">
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-7 title">
{intl l='Edit product %title' title=$TITLE}
</div>
{include file="includes/catalog-breadcrumb.html" editing_category="false" editing_product="true"}
<div class="col-md-5 actions">
<div class="row">
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
{if $HAS_PREVIOUS != 0}
<a href="{url path='/admin/products/update' product_id=$PREVIOUS}" class="btn btn-default" title="{intl l='Edit previous product'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span></a>
{/if}
{* Define close url *}
{assign var='close_url' value="{url path='/admin/catalog' category_id=$DEFAULT_CATEGORY}"}
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview product page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-7 title">
{intl l='Edit product %title' title=$TITLE}
</div>
{if $HAS_NEXT != 0}
<a href="{url path='/admin/products/update' product_id=$NEXT}" class="btn btn-default" title="{intl l='Edit next product'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
{else}
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-right"></span></a>
{/if}
</div>
</div>
<div class="col-md-5 actions">
<a {if $HAS_PREVIOUS != 0}href="{url path='/admin/products/update' product_id=$PREVIOUS}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit previous product'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview product page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
<a {if $HAS_NEXT != 0}href="{url path='/admin/products/update' product_id=$NEXT}"{else}disabled="disabled"{/if} class="btn btn-default" title="{intl l='Edit next product'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<ul class="nav nav-tabs" id="tabbed-menu">
<li>
<a href="#general"
{* data-href="{url path='/admin/products/general/tab' product_id=$product_id}" *}
data-toggle="tab">{intl l="General"}</a>
</li>
<ul class="nav nav-tabs" id="tabbed-menu">
<li><a href="#general" data-toggle="tab">{intl l="General"}</a></li>
<li><a href="#seo" data-toggle="tab">{intl l="SEO"}</a></li>
<li><a href="#details" data-toggle="tab">{intl l="Details"}</a></li>
<li>
<a href="#attributes"
data-href="{url path='/admin/products/attributes/tab' product_id=$ID}"
data-toggle="tab">{intl l="Attributes &amp; Features"}
</a>
</li>
<li>
<a href="#related"
data-href="{url path='/admin/products/related/tab' folder_id=$folder_id accessory_category_id=$accessory_category_id product_id=$ID}"
data-toggle="tab">{intl l="Associations"}
</a>
</li>
<li>
<a href="#images"
data-toggle="tab"
data-href="{url path="/admin/image/type/product/{$ID}/form-ajax"}"
data-callback="$.imageUploadManager.initImageDropZone">
{intl l="Images"}
</a>
</li>
<li>
<a href="#documents"
data-toggle="tab"
data-href="{url path="/admin/document/type/product/{$ID}/form-ajax"}"
data-callback="$.documentUploadManager.initDocumentDropZone">
{intl l="Documents"}
</a>
</li>
<li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
</ul>
<li>
<a href="#details" data-toggle="tab">{intl l="Details"}</a>
</li>
<div class="tab-content">
<li><a href="#attributes"
data-href="{url path='/admin/products/attributes/tab' product_id=$product_id}"
data-toggle="tab">{intl l="Attributes &amp; Features"}</a>
</li>
<div class="tab-pane fade" id="general">
{include file="includes/product-general-tab.html"}
</div>
<li>
<a href="#related"
data-href="{url path='/admin/products/related/tab' folder_id=$folder_id accessory_category_id=$accessory_category_id product_id=$product_id}"
data-toggle="tab">{intl l="Associations"}</a>
</li>
<div class="tab-pane fade" id="seo">
{form name="thelia.admin.seo"}
{include file="includes/seo-tab.html"
form = $form
formAction = "{url path='/admin/products/seo/save'}"
pageUrl = "{url path='/admin/products/update' product_id=$ID}"
closeUrl = $close_url
current_id = $product_id
}
{/form}
</div>
<li>
<a href="#images"
data-toggle="tab"
data-href="{url path="/admin/image/type/product/{$product_id}/form-ajax"}"
data-callback="$.imageUploadManager.initImageDropZone">
{intl l="Images"}
</a>
</li>
<li>
<a href="#documents"
data-toggle="tab"
data-href="{url path="/admin/document/type/product/{$product_id}/form-ajax"}"
data-callback="$.documentUploadManager.initDocumentDropZone">
{intl l="Documents"}
</a>
<li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
</ul>
<div class="tab-pane fade" id="details">
{include file="includes/product-details-tab.html"}
</div>
<div class="tab-content">
<div class="tab-pane fade" id="attributes">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="general">
{include file="includes/product-general-tab.html"}
</div>
<div class="tab-pane fade" id="related">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="details">
{include file="includes/product-details-tab.html"}
</div>
<div class="tab-pane fade" id="images">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="attributes">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="documents">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="related">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="modules">
{module_include location='product-edit'}
</div>
<div class="tab-pane fade" id="images">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="documents">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>
<div class="tab-pane fade" id="modules">
{module_include location='product-edit'}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{/loop}
</div>
</div>
</div>
{/loop}
</div>
</div>
</div>
{/block}

View File

@@ -51,7 +51,8 @@
// Message if no order or no address
.deliveries-warning,
.address-warning,
.orders-warning {
.orders-warning,
.folder-warning {
clear: both;
.alert; .alert-warning;
margin-bottom: 0;

View File

@@ -0,0 +1,98 @@
// Thelia : Folder
// Folder Info
.folder-chapo {}
.folder-description {
margin-bottom: 20px;
}
// Content List
#folder-contents {
.contents > ul { .contents-grid; }
}
.contents-grid,
.contents-list {
// Animation
@media (min-width: @screen-tablet) {
.content-image {
display: block;
overflow: hidden;
position: relative;
> .mask {
background-color: @brand-primary;
background-color: rgba(red(@brand-primary), green(@brand-primary), blue(@brand-primary), .4);
display: block;
.opacity(0);
overflow: visible;
position: absolute;
top: 0; left: 0;
visibility: hidden;
width: 100%; height: 100%;
.transition(opacity 300ms ease-in-out 50ms);
}
&:hover,
&:focus {
.mask {
visibility: visible;
.opacity(1);
}
}
}
}
}
// Contents Grid
.contents-grid {
.make-row();
.list-unstyled();
.item { .make-sm-column(4); .make-md-column(4); .clearfix(); } // default
&.content-col-2 > .item { .make-md-column(6); }
&.content-col-3 > .item { .make-md-column(4); }
&.content-col-4 > .item { .make-md-column(3); }
&.content-col-5 > .item { .make-md-column(2.4); }
&.content-col-6 > .item { .make-md-column(2); }
.item {
margin-bottom: @line-height-computed;
.content-image {
> img { .img-responsive(); width: 100%; }
> .mask {}
}
.content-info {
.name { margin: 4px 0; }
.description { .visible-xs; }
.short-description { display: block; margin-bottom: 5px; }
}
}
}
// Content List
.contents-list {
.list-unstyled();
.item {
+ .item { border-top: 1px solid #ededed; padding-top: 15px; }
> article {
.make-row();
margin-left: 0;
.content-image {
.make-sm-column(3);
margin-bottom: 15px; padding: 0;
> img { .img-responsive(); width: 100%; }
> .mask {}
}
.content-info {
.make-sm-column(6);
.name { margin-top: 0; }
.description {}
.short-description {}
}
}
}
}

View File

@@ -28,6 +28,9 @@
@import "category";
@import "product";
// Thelia : Contents
@import "folder";
// Thelia : Pages
@import "page-home";
@import "page-error";

View File

@@ -3,15 +3,30 @@
{* Body Class *}
{block name="body-class"}page-category{/block}
{* Page Title *}
{block name='no-return-functions' append}
{loop name="category.seo.title" type="category" id="{category attr="id"}"}
{$page_title = {$META_TITLE}}
{/loop}
{/block}
{* Meta *}
{block name="meta"}
{loop name="category.seo.meta" type="category" id="{category attr="id"}"}
{if $META_DESCRIPTION}<meta name="description" content="{$META_DESCRIPTION}">{/if}
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
{/loop}
{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$sBreadcrumb = []}
{$breadcrumbs = []}
{loop name="category_path" type="category-path" category="{category attr="id"}"}
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL nofilter}]}
{/loop}
{/block}
{* Content *}
{block name="main-content"}
<div class="main layout-col-2-left">
{$limit={$smarty.get.limit|default:8}}
@@ -19,7 +34,7 @@
{$product_order={$smarty.get.order|default:'alpha'}}
<article class="col-main {$smarty.get.mode|default:"grid"}" role="main">
{ifloop rel="product_list"}
{assign var="amount" value="{count type="product" category={category attr="id"}}"}
{assign var="amount" value="{count type="product" category="{category attr="id"}"}"}
{include file="includes/toolbar.html" toolbar="top" limit=$limit order=$product_order amount={$amount}}
<div id="category-products">
<div class="products-content">

View File

@@ -1,36 +1,61 @@
{extends file="layout.tpl"}
{block name="no-return-functions"}
{* Body Class *}
{block name="body-class"}page-content{/block}
{* Page Title *}
{block name='no-return-functions' append}
{loop name="content.seo.title" type="content" id="{content attr="id"}"}
{$page_title = {$META_TITLE}}
{/loop}
{/block}
{block name="body-class"}page-content{/block}
{* Meta *}
{block name="meta"}
{loop name="content.seo.meta" type="content" id="{content attr="id"}"}
{if $META_DESCRIPTION}<meta name="description" content="{$META_DESCRIPTION}">{/if}
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
{/loop}
{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$breadcrumbs = []}
{loop type="content" name="content-breadcrumb" id="{content attr="id"}"}
{loop name="folder_path" type="folder-path" folder="{$DEFAULT_FOLDER}"}
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]}
{/loop}
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]}
{/loop}
{/block}
{block name="main-content"}
<div class="main layout-col-2-left" <!-- class="mainlayout-col-2-left -->">
<div class="main layout-col-2-left">
<article class="col-main" role="main" aria-labelledby="main-label">
{loop name="blog.article" type="content" current="yes"}
<h1>{$TITLE}</h1>
<p class="chapo">
{$CHAPO}
</p>
<p>{$DESCRIPTION nofilter}</p>
{loop name="blog.content" type="content" current="yes"}
<h1 id="main-label" class="page-header">{$TITLE}</h1>
{if $CHAPO}
<div class="chapo">
{$CHAPO}
</div>
{/if}
{if $DESCRIPTION}
<div class="description">
{$DESCRIPTION nofilter}
</div>
{/if}
{if $POSTSCRIPTUM}
<small class="postscriptum">
{$POSTSCRIPTUM}
</small>
{/if}
{/loop}
</article>
<aside class="col-left" role="complementary" itemscope itemtype="http://schema.org/WPSideBar">
{include file="includes/asides/articles.html"}
{include file="includes/asides/articles.html"}
</aside>
</div><!-- /.layout -->
{/block}
{block name="after-javascript-include"}{/block}

View File

@@ -0,0 +1,99 @@
{extends file="layout.tpl"}
{* Body Class *}
{block name="body-class"}page-folder{/block}
{* Page Title *}
{block name='no-return-functions' append}
{loop name="folder.seo.title" type="folder" id="{folder attr="id"}"}
{$page_title = {$META_TITLE}}
{/loop}
{/block}
{* Meta *}
{block name="meta"}
{loop name="folder.seo.meta" type="folder" id="{folder attr="id"}"}
{if $META_DESCRIPTION}<meta name="description" content="{$META_DESCRIPTION}">{/if}
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
{/loop}
{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$breadcrumbs = []}
{loop name="folder_path" type="folder-path" folder="{folder attr="id"}"}
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]}
{/loop}
{/block}
{* Content *}
{block name="main-content"}
<div class="main">
<div class="col-main" role="main" aria-labelledby="main-label">
{loop name="folder" type="folder" id="{folder attr="id"}"}
<h1 id="main-label" class="page-header">{$TITLE}</h1>
{if $CHAPO}
<div class="folder-chapo">
{$CHAPO}
</div>
{/if}
{if $DESCRIPTION}
<div class="folder-description">
{$DESCRIPTION nofilter}
</div>
{/if}
<div id="folder-contents">
<div class="contents">
{ifloop rel="folder_content"}
<ul>
{loop name="folder_content" type="content" folder="$ID"}
<li class="item">
<article>
<a href="{$URL}" tabindex="-1" class="content-image">
{loop name="content_thumbnail" type="image" width="369" height="247" content=$ID limit="1"}
<img src="{$IMAGE_URL}" alt="{$TITLE}">
{/loop}
{elseloop rel="content_thumbnail"}
{images file='assets/img/280x196.png'}<img src="{$asset_url}" alt="{$TITLE}">{/images}
{/elseloop}
<span class="mask"></span>
</a>
<div class="content-info">
<h3 class="name"><a href="{$URL}">{$TITLE}</a></h3>
{if $CHAPO}
<div class="short-description">
{$CHAPO}
</div>
{/if}
</div>
</article><!-- /content -->
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="folder_content"}
<div class="folder-warning">
{intl l="No Content in this folder."}
</div>
{/elseloop}
</div>
</div><!-- /#category-products -->
{if $POSTSCRIPTUM}
<small class="folder-postscriptum">
{$POSTSCRIPTUM}
</small>
{/if}
{/loop}
</div>
</div>
{/block}

View File

@@ -3,13 +3,9 @@
<div class="block-content">
<nav class="nav-categories">
<ul id="category" class="accordion">
{loop name="current_article" type="content" current="yes"}
{assign var="current_id" value={$ID}}
{/loop}
{loop name="blog.article" type="content" current_folder="yes" exclude="$current_id"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
{loop name="blog.article" type="content" current_folder="yes" exclude="{content attr="id"}"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
</ul>
</nav>
</div>

View File

@@ -1,10 +1,3 @@
{* Declare assets directory, relative to template base directory *}
{declare_assets directory='assets'}
{block name="no-return-functions"}{/block}
{assign var="store_name" value="{config key="store_name"}"}
{if not $store_name}
{assign var="store_name" value="{intl l='Thelia V2'}"}
{/if}
<!doctype html>
<!--
______ __ __ ______ __ __ ______
@@ -24,6 +17,12 @@ the Free Software Foundation; either version 3 of the
GNU General Public License : http://www.gnu.org/licenses/
-->
{* Declare assets directory, relative to template base directory *}
{declare_assets directory='assets'}
{block name="no-return-functions"}{/block}
{assign var="store_name" value="{config key="store_name"}"}
{if not $store_name}{assign var="store_name" value="{intl l='Thelia V2'}"}{/if}
{* paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither *}
<!--[if lt IE 7 ]><html class="no-js oldie ie6" lang="{lang attr="code"}"> <![endif]-->
<!--[if IE 7 ]><html class="no-js oldie ie7" lang="{lang attr="code"}"> <![endif]-->
@@ -37,14 +36,14 @@ GNU General Public License : http://www.gnu.org/licenses/
<meta charset="utf-8">
{* Page Title *}
<title>{block name="page-title"}{strip}{if $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title} - {/foreach}{/if}{$store_name}{/strip}{/block}</title>
<title>{block name="page-title"}{strip}{if $page_title}{$page_title}{elseif $breadcrumbs}{foreach from=$breadcrumbs|array_reverse item=breadcrumb}{$breadcrumb.title} - {/foreach}{$store_name}{/if}{/strip}{/block}</title>
{* Meta Tags *}
<meta name="generator" content="{intl l='Thelia V2'}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
{block name="meta"}
<meta name="description" content="{$store_name}">
<meta name="description" content="{if $page_description}{$page_description}{else}{$store_name}{/if}">
<meta name="robots" content="noindex,nofollow">
{/block}

View File

@@ -3,6 +3,21 @@
{* Body Class *}
{block name="body-class"}page-product{/block}
{* Page Title *}
{block name='no-return-functions' append}
{loop name="product.seo.title" type="product" id="{product attr="id"}"}
{$page_title = {$META_TITLE}}
{/loop}
{/block}
{* Meta *}
{block name="meta"}
{loop name="product.seo.meta" type="product" id="{product attr="id"}"}
{if $META_DESCRIPTION}<meta name="description" content="{$META_DESCRIPTION}">{/if}
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
{/loop}
{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$breadcrumbs = []}
@@ -14,7 +29,7 @@
{/loop}
{/block}
{* Content *}
{block name="main-content"}
<div class="main">
{loop name="product.details" type="product" id="{product attr="id"}"}
@@ -232,7 +247,7 @@
{/if}
</div>
</section>
</article><!-- /product -->
</article><!-- /#product -->
<ul class="pager">
{if $HAS_PREVIOUS == 1}
@@ -247,9 +262,6 @@
{/if}
</ul>
{/loop}
</div>
</div><!-- /.container -->
</div><!-- /.main -->
{/block}