Merge branch 'master' of github.com:thelia/thelia
@@ -62,26 +62,34 @@ class CacheClear extends ContainerAwareCommand
|
||||
|
||||
$this->clearCache($cacheDir, $output);
|
||||
if (!$input->getOption("without-assets")) {
|
||||
$this->clearCache(THELIA_WEB_DIR . "/assets", $output);
|
||||
$this->clearCache(THELIA_WEB_DIR . "assets", $output);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function clearCache($dir, OutputInterface $output)
|
||||
{
|
||||
if (!is_writable($dir)) {
|
||||
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $dir));
|
||||
}
|
||||
|
||||
$output->writeln(sprintf("Clearing cache in <info>%s</info> directory", $dir));
|
||||
|
||||
try {
|
||||
$directoryBrowser = new \DirectoryIterator($dir);
|
||||
} catch(\UnexpectedValueException $e) {
|
||||
// throws same exception code for does not exist and permission denied ...
|
||||
if(!file_exists($dir)) {
|
||||
$output->writeln(sprintf("<info>%s cache dir already clear</info>", $dir));
|
||||
return;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$fs = new Filesystem();
|
||||
try {
|
||||
$fs->remove($dir);
|
||||
|
||||
$output->writeln(sprintf("<info>%s cache dir cleared successfully</info>", $dir));
|
||||
} catch (IOException $e) {
|
||||
$output->writeln(sprintf("error during clearing cache : %s", $e->getMessage()));
|
||||
$output->writeln(sprintf("Error during clearing cache : %s", $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
90
core/lib/Thelia/Command/ModuleActivateCommand.php
Executable file
@@ -0,0 +1,90 @@
|
||||
<?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\Command;
|
||||
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
|
||||
use Thelia\Command\ContainerAwareCommand;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
|
||||
/**
|
||||
* activates a module
|
||||
*
|
||||
* Class ModuleActivateCommand
|
||||
* @package Thelia\Command
|
||||
* @author Etienne Roudeix <eroudeix@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class ModuleActivateCommand extends BaseModuleGenerate
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName("module:activate")
|
||||
->setDescription("Activates a module")
|
||||
->addArgument(
|
||||
"module" ,
|
||||
InputArgument::REQUIRED,
|
||||
"module to activate"
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$moduleCode = $this->formatModuleName($input->getArgument("module"));
|
||||
|
||||
$module = ModuleQuery::create()->findOneByCode($moduleCode);
|
||||
|
||||
if(null === $module) {
|
||||
throw new \RuntimeException(sprintf("module %s not found", $moduleCode));
|
||||
}
|
||||
|
||||
try {
|
||||
new \TheliaDebugBar\TheliaDebugBar();
|
||||
|
||||
$moduleReflection = new \ReflectionClass($module->getFullNamespace());
|
||||
|
||||
$moduleInstance = $moduleReflection->newInstance();
|
||||
|
||||
$moduleInstance->activate();
|
||||
} catch(\Exception $e) {
|
||||
throw new \RuntimeException(sprintf("Activation fail with Exception : [%d] %s", $e->getCode(), $e->getMessage()));
|
||||
}
|
||||
|
||||
//impossible to change output class in CommandTester...
|
||||
if (method_exists($output, "renderBlock")) {
|
||||
$output->renderBlock(array(
|
||||
'',
|
||||
sprintf("Activation succeed for module %s", $moduleCode),
|
||||
''
|
||||
), "bg=green;fg=black");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,12 @@
|
||||
<form name="thelia.admin.product.creation" class="Thelia\Form\ProductCreationForm"/>
|
||||
<form name="thelia.admin.product.deletion" class="Thelia\Form\ProductModificationForm"/>
|
||||
|
||||
<form name="thelia.admin.folder.creation" class="Thelia\Form\FolderCreationForm"/>
|
||||
<form name="thelia.admin.folder.modification" class="Thelia\Form\FolderModificationForm"/>
|
||||
|
||||
<form name="thelia.admin.content.creation" class="Thelia\Form\ContentCreationForm"/>
|
||||
<form name="thelia.admin.content.modification" class="Thelia\Form\ContentModificationForm"/>
|
||||
|
||||
<form name="thelia.cart.add" class="Thelia\Form\CartAdd"/>
|
||||
|
||||
<form name="thelia.order.delivery" class="Thelia\Form\OrderDelivery"/>
|
||||
@@ -105,6 +111,7 @@
|
||||
<command class="Thelia\Command\ModuleGenerateCommand"/>
|
||||
<command class="Thelia\Command\ModuleGenerateModelCommand"/>
|
||||
<command class="Thelia\Command\ModuleGenerateSqlCommand"/>
|
||||
<command class="Thelia\Command\ModuleActivateCommand"/>
|
||||
<command class="Thelia\Command\CreateAdminUser"/>
|
||||
<command class="Thelia\Command\ReloadDatabaseCommand"/>
|
||||
</commands>
|
||||
|
||||
@@ -156,7 +156,20 @@
|
||||
<default key="_controller">Thelia\Controller\Admin\ProductController::getAvailableRelatedContentAction</default>
|
||||
<requirement key="_format">xml|json</requirement>
|
||||
</route>
|
||||
|
||||
<!-- Folder routes management -->
|
||||
<route id="admin.folders.default" path="/admin/folders">
|
||||
<default key="_controller">Thelia\Controller\Admin\FolderController::indexAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.folders.create" path="/admin/folders/create">
|
||||
<default key="_controller">Thelia\Controller\Admin\FolderController::createAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.folders.update" path="/admin/folders/update/{folder_id}" methods="get">
|
||||
<default key="_controller">Thelia\Controller\Admin\FolderController::updateAction</default>
|
||||
<requirement key="folder_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
||||
|
||||
@@ -388,7 +401,25 @@
|
||||
<requirement key="country_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<!-- end countries routes management -->
|
||||
<!-- end countries routes management -->
|
||||
|
||||
<!-- Shipping zones routes management -->
|
||||
|
||||
<route id="admin.configuration.shipping-zones.default" path="/admin/configuration/shipping-zones">
|
||||
<default key="_controller">Thelia\Controller\Admin\ShippingZoneController::indexAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.shipping-zones.create" path="/admin/configuration/shipping-zones/create">
|
||||
<default key="_controller">Thelia\Controller\Admin\ShippingZoneController::createAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.shipping-zones.update.view" path="/admin/configuration/shipping-zones/update/{shipping_zones_id}" methods="get">
|
||||
<default key="_controller">Thelia\Controller\Admin\ShippingZoneController::updateAction</default>
|
||||
<requirement key="country_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<!-- end shipping routes management -->
|
||||
|
||||
|
||||
<!-- feature and features value management -->
|
||||
|
||||
|
||||
46
core/lib/Thelia/Controller/Admin/FolderController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Class FolderController
|
||||
* @package Thelia\Controller\Admin
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class FolderController extends BaseAdminController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
if (null !== $response = $this->checkAuth("admin.folder.view")) return $response;
|
||||
return $this->render("folders", array("display_folder" => 20));
|
||||
}
|
||||
|
||||
public function updateAction($folder_id)
|
||||
{
|
||||
|
||||
return $this->render("folder-edit", array(
|
||||
"folder_id" => $folder_id
|
||||
));
|
||||
}
|
||||
}
|
||||
46
core/lib/Thelia/Controller/Admin/ShippingZoneController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Class FolderController
|
||||
* @package Thelia\Controller\Admin
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class ShippingZoneController extends BaseAdminController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
if (null !== $response = $this->checkAuth("admin.shipping-zones.view")) return $response;
|
||||
return $this->render("shipping-zones", array("display_shipping_zone" => 20));
|
||||
}
|
||||
|
||||
public function updateAction($shipping_zones_id)
|
||||
{
|
||||
|
||||
return $this->render("shipping-zones-edit", array(
|
||||
"shipping_zones_id" => $shipping_zones_id
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class Image extends BaseI18nLoop
|
||||
/**
|
||||
* @var array Possible image sources
|
||||
*/
|
||||
protected $possible_sources = array('category', 'product', 'folder', 'content');
|
||||
protected $possible_sources = array('category', 'product', 'folder', 'content', 'module');
|
||||
|
||||
/**
|
||||
* @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
|
||||
|
||||
@@ -32,6 +32,7 @@ use Thelia\Core\Template\Element\LoopResultRow;
|
||||
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
||||
use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
|
||||
use Thelia\Exception\TaxEngineException;
|
||||
use Thelia\Model\CategoryQuery;
|
||||
use Thelia\Model\CountryQuery;
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
@@ -605,9 +606,13 @@ class Product extends BaseI18nLoop
|
||||
|
||||
$price = $product->getRealLowestPrice();
|
||||
|
||||
$taxedPrice = null === $price ? null : $product->getTaxedPrice(
|
||||
$taxCountry
|
||||
);
|
||||
try {
|
||||
$taxedPrice = $product->getTaxedPrice(
|
||||
$taxCountry
|
||||
);
|
||||
} catch(TaxEngineException $e) {
|
||||
$taxedPrice = null;
|
||||
}
|
||||
|
||||
// Find previous and next product, in the default category.
|
||||
$default_category_id = $product->getDefaultCategoryId();
|
||||
|
||||
@@ -31,6 +31,7 @@ use Thelia\Core\Template\Element\LoopResultRow;
|
||||
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
||||
use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
|
||||
use Thelia\Exception\TaxEngineException;
|
||||
use Thelia\Model\Base\ProductSaleElementsQuery;
|
||||
use Thelia\Model\CountryQuery;
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
@@ -147,17 +148,27 @@ class ProductSaleElements extends BaseLoop
|
||||
|
||||
$loopResult = new LoopResult($PSEValues);
|
||||
|
||||
$taxCountry = CountryQuery::create()->findPk(64); // @TODO : make it magic
|
||||
|
||||
foreach ($PSEValues as $PSEValue) {
|
||||
$loopResultRow = new LoopResultRow($loopResult, $PSEValue, $this->versionable, $this->timestampable, $this->countable);
|
||||
|
||||
$price = $PSEValue->getPrice();
|
||||
$taxedPrice = $PSEValue->getTaxedPrice(
|
||||
CountryQuery::create()->findOneById(64) // @TODO : make it magic
|
||||
);
|
||||
try {
|
||||
$taxedPrice = $PSEValue->getTaxedPrice(
|
||||
$taxCountry
|
||||
);
|
||||
} catch(TaxEngineException $e) {
|
||||
$taxedPrice = null;
|
||||
}
|
||||
$promoPrice = $PSEValue->getPromoPrice();
|
||||
$taxedPromoPrice = $PSEValue->getTaxedPromoPrice(
|
||||
CountryQuery::create()->findOneById(64) // @TODO : make it magic
|
||||
);
|
||||
try {
|
||||
$taxedPromoPrice = $PSEValue->getTaxedPromoPrice(
|
||||
$taxCountry
|
||||
);
|
||||
} catch(TaxEngineException $e) {
|
||||
$taxedPromoPrice = null;
|
||||
}
|
||||
|
||||
$loopResultRow->set("ID", $PSEValue->getId())
|
||||
->set("QUANTITY", $PSEValue->getQuantity())
|
||||
|
||||
@@ -29,6 +29,8 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||
use Thelia\Core\Security\SecurityContext;
|
||||
use Thelia\Core\Security\Exception\AuthenticationException;
|
||||
use Thelia\Exception\OrderException;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
|
||||
class Security extends AbstractSmartyPlugin
|
||||
{
|
||||
@@ -87,7 +89,12 @@ class Security extends AbstractSmartyPlugin
|
||||
public function checkValidDeliveryFunction($params, &$smarty)
|
||||
{
|
||||
$order = $this->request->getSession()->getOrder();
|
||||
if(null === $order || null === $order->chosenDeliveryAddress || null === $order->getDeliveryModuleId()) {
|
||||
/* Does address and module still exists ? We assume address owner can't change neither module type */
|
||||
if($order !== null) {
|
||||
$checkAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress);
|
||||
$checkModule = ModuleQuery::create()->findPk($order->getDeliveryModuleId());
|
||||
}
|
||||
if(null === $order || null == $checkAddress || null === $checkModule) {
|
||||
throw new OrderException('Delivery must be defined', OrderException::UNDEFINED_DELIVERY, array('missing' => 1));
|
||||
}
|
||||
|
||||
|
||||
39
core/lib/Thelia/Exception/ModuleException.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?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\Exception;
|
||||
|
||||
class ModuleException extends \RuntimeException
|
||||
{
|
||||
const UNKNOWN_EXCEPTION = 0;
|
||||
|
||||
const CODE_NOT_FOUND = 404;
|
||||
|
||||
public function __construct($message, $code = null, $previous = null)
|
||||
{
|
||||
if ($code === null) {
|
||||
$code = self::UNKNOWN_EXCEPTION;
|
||||
}
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
||||
63
core/lib/Thelia/Form/ContentCreationForm.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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;
|
||||
|
||||
class ContentCreationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm($change_mode = false)
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Content title *",
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
))
|
||||
->add("default_folder", "integer", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
))
|
||||
->add("locale", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
))
|
||||
->add("visible", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("This content is online."),
|
||||
"label_attr" => array("for" => "visible_create")
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_content_creation";
|
||||
}
|
||||
}
|
||||
66
core/lib/Thelia/Form/FolderCreationForm.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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;
|
||||
|
||||
class FolderCreationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Folder title *"),
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
))
|
||||
->add("parent", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Parent folder *"),
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label_attr" => array("for" => "parent_create")
|
||||
))
|
||||
->add("locale", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label_attr" => array("for" => "locale_create")
|
||||
))
|
||||
->add("visible", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("This folder is online."),
|
||||
"label_attr" => array("for" => "visible_create")
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_folder_creation";
|
||||
}
|
||||
}
|
||||
55
core/lib/Thelia/Form/FolderModificationForm.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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 Thelia\Core\Translation\Translator;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class FolderModificationForm extends FolderCreationForm
|
||||
{
|
||||
use StandardDescriptionFieldsTrait;
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm(true);
|
||||
|
||||
$this->formBuilder
|
||||
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
|
||||
->add("url", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Rewriten 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
|
||||
$this->addStandardDescFields(array('title', 'locale'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_folder_modification";
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ use Thelia\Model\GroupModuleQuery as ChildGroupModuleQuery;
|
||||
use Thelia\Model\Module as ChildModule;
|
||||
use Thelia\Model\ModuleI18n as ChildModuleI18n;
|
||||
use Thelia\Model\ModuleI18nQuery as ChildModuleI18nQuery;
|
||||
use Thelia\Model\ModuleImage as ChildModuleImage;
|
||||
use Thelia\Model\ModuleImageQuery as ChildModuleImageQuery;
|
||||
use Thelia\Model\ModuleQuery as ChildModuleQuery;
|
||||
use Thelia\Model\Order as ChildOrder;
|
||||
use Thelia\Model\OrderQuery as ChildOrderQuery;
|
||||
@@ -135,6 +137,12 @@ abstract class Module implements ActiveRecordInterface
|
||||
protected $collGroupModules;
|
||||
protected $collGroupModulesPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildModuleImage[] Collection to store aggregation of ChildModuleImage objects.
|
||||
*/
|
||||
protected $collModuleImages;
|
||||
protected $collModuleImagesPartial;
|
||||
|
||||
/**
|
||||
* @var ObjectCollection|ChildModuleI18n[] Collection to store aggregation of ChildModuleI18n objects.
|
||||
*/
|
||||
@@ -187,6 +195,12 @@ abstract class Module implements ActiveRecordInterface
|
||||
*/
|
||||
protected $groupModulesScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
*/
|
||||
protected $moduleImagesScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var ObjectCollection
|
||||
@@ -864,6 +878,8 @@ abstract class Module implements ActiveRecordInterface
|
||||
|
||||
$this->collGroupModules = null;
|
||||
|
||||
$this->collModuleImages = null;
|
||||
|
||||
$this->collModuleI18ns = null;
|
||||
|
||||
} // if (deep)
|
||||
@@ -1067,6 +1083,23 @@ abstract class Module implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->moduleImagesScheduledForDeletion !== null) {
|
||||
if (!$this->moduleImagesScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ModuleImageQuery::create()
|
||||
->filterByPrimaryKeys($this->moduleImagesScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->moduleImagesScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collModuleImages !== null) {
|
||||
foreach ($this->collModuleImages as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->moduleI18nsScheduledForDeletion !== null) {
|
||||
if (!$this->moduleI18nsScheduledForDeletion->isEmpty()) {
|
||||
\Thelia\Model\ModuleI18nQuery::create()
|
||||
@@ -1312,6 +1345,9 @@ abstract class Module implements ActiveRecordInterface
|
||||
if (null !== $this->collGroupModules) {
|
||||
$result['GroupModules'] = $this->collGroupModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collModuleImages) {
|
||||
$result['ModuleImages'] = $this->collModuleImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collModuleI18ns) {
|
||||
$result['ModuleI18ns'] = $this->collModuleI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
@@ -1524,6 +1560,12 @@ abstract class Module implements ActiveRecordInterface
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getModuleImages() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addModuleImage($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getModuleI18ns() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addModuleI18n($relObj->copy($deepCopy));
|
||||
@@ -1583,6 +1625,9 @@ abstract class Module implements ActiveRecordInterface
|
||||
if ('GroupModule' == $relationName) {
|
||||
return $this->initGroupModules();
|
||||
}
|
||||
if ('ModuleImage' == $relationName) {
|
||||
return $this->initModuleImages();
|
||||
}
|
||||
if ('ModuleI18n' == $relationName) {
|
||||
return $this->initModuleI18ns();
|
||||
}
|
||||
@@ -2810,6 +2855,224 @@ abstract class Module implements ActiveRecordInterface
|
||||
return $this->getGroupModules($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collModuleImages collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addModuleImages()
|
||||
*/
|
||||
public function clearModuleImages()
|
||||
{
|
||||
$this->collModuleImages = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset is the collModuleImages collection loaded partially.
|
||||
*/
|
||||
public function resetPartialModuleImages($v = true)
|
||||
{
|
||||
$this->collModuleImagesPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collModuleImages collection.
|
||||
*
|
||||
* By default this just sets the collModuleImages collection to an empty array (like clearcollModuleImages());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @param boolean $overrideExisting If set to true, the method call initializes
|
||||
* the collection even if it is not empty
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initModuleImages($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collModuleImages && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collModuleImages = new ObjectCollection();
|
||||
$this->collModuleImages->setModel('\Thelia\Model\ModuleImage');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of ChildModuleImage objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this ChildModule is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param ConnectionInterface $con optional connection object
|
||||
* @return Collection|ChildModuleImage[] List of ChildModuleImage objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getModuleImages($criteria = null, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collModuleImagesPartial && !$this->isNew();
|
||||
if (null === $this->collModuleImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collModuleImages) {
|
||||
// return empty collection
|
||||
$this->initModuleImages();
|
||||
} else {
|
||||
$collModuleImages = ChildModuleImageQuery::create(null, $criteria)
|
||||
->filterByModule($this)
|
||||
->find($con);
|
||||
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collModuleImagesPartial && count($collModuleImages)) {
|
||||
$this->initModuleImages(false);
|
||||
|
||||
foreach ($collModuleImages as $obj) {
|
||||
if (false == $this->collModuleImages->contains($obj)) {
|
||||
$this->collModuleImages->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collModuleImagesPartial = true;
|
||||
}
|
||||
|
||||
$collModuleImages->getInternalIterator()->rewind();
|
||||
|
||||
return $collModuleImages;
|
||||
}
|
||||
|
||||
if ($partial && $this->collModuleImages) {
|
||||
foreach ($this->collModuleImages as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collModuleImages[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collModuleImages = $collModuleImages;
|
||||
$this->collModuleImagesPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collModuleImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of ModuleImage objects related by a one-to-many relationship
|
||||
* to the current object.
|
||||
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
|
||||
* and new objects from the given Propel collection.
|
||||
*
|
||||
* @param Collection $moduleImages A Propel collection.
|
||||
* @param ConnectionInterface $con Optional connection object
|
||||
* @return ChildModule The current object (for fluent API support)
|
||||
*/
|
||||
public function setModuleImages(Collection $moduleImages, ConnectionInterface $con = null)
|
||||
{
|
||||
$moduleImagesToDelete = $this->getModuleImages(new Criteria(), $con)->diff($moduleImages);
|
||||
|
||||
|
||||
$this->moduleImagesScheduledForDeletion = $moduleImagesToDelete;
|
||||
|
||||
foreach ($moduleImagesToDelete as $moduleImageRemoved) {
|
||||
$moduleImageRemoved->setModule(null);
|
||||
}
|
||||
|
||||
$this->collModuleImages = null;
|
||||
foreach ($moduleImages as $moduleImage) {
|
||||
$this->addModuleImage($moduleImage);
|
||||
}
|
||||
|
||||
$this->collModuleImages = $moduleImages;
|
||||
$this->collModuleImagesPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related ModuleImage objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param ConnectionInterface $con
|
||||
* @return int Count of related ModuleImage objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countModuleImages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
|
||||
{
|
||||
$partial = $this->collModuleImagesPartial && !$this->isNew();
|
||||
if (null === $this->collModuleImages || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collModuleImages) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getModuleImages());
|
||||
}
|
||||
|
||||
$query = ChildModuleImageQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
|
||||
return $query
|
||||
->filterByModule($this)
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collModuleImages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a ChildModuleImage object to this object
|
||||
* through the ChildModuleImage foreign key attribute.
|
||||
*
|
||||
* @param ChildModuleImage $l ChildModuleImage
|
||||
* @return \Thelia\Model\Module The current object (for fluent API support)
|
||||
*/
|
||||
public function addModuleImage(ChildModuleImage $l)
|
||||
{
|
||||
if ($this->collModuleImages === null) {
|
||||
$this->initModuleImages();
|
||||
$this->collModuleImagesPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collModuleImages->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddModuleImage($l);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ModuleImage $moduleImage The moduleImage object to add.
|
||||
*/
|
||||
protected function doAddModuleImage($moduleImage)
|
||||
{
|
||||
$this->collModuleImages[]= $moduleImage;
|
||||
$moduleImage->setModule($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ModuleImage $moduleImage The moduleImage object to remove.
|
||||
* @return ChildModule The current object (for fluent API support)
|
||||
*/
|
||||
public function removeModuleImage($moduleImage)
|
||||
{
|
||||
if ($this->getModuleImages()->contains($moduleImage)) {
|
||||
$this->collModuleImages->remove($this->collModuleImages->search($moduleImage));
|
||||
if (null === $this->moduleImagesScheduledForDeletion) {
|
||||
$this->moduleImagesScheduledForDeletion = clone $this->collModuleImages;
|
||||
$this->moduleImagesScheduledForDeletion->clear();
|
||||
}
|
||||
$this->moduleImagesScheduledForDeletion[]= clone $moduleImage;
|
||||
$moduleImage->setModule(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collModuleI18ns collection
|
||||
*
|
||||
@@ -3087,6 +3350,11 @@ abstract class Module implements ActiveRecordInterface
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collModuleImages) {
|
||||
foreach ($this->collModuleImages as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collModuleI18ns) {
|
||||
foreach ($this->collModuleI18ns as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
@@ -3114,6 +3382,10 @@ abstract class Module implements ActiveRecordInterface
|
||||
$this->collGroupModules->clearIterator();
|
||||
}
|
||||
$this->collGroupModules = null;
|
||||
if ($this->collModuleImages instanceof Collection) {
|
||||
$this->collModuleImages->clearIterator();
|
||||
}
|
||||
$this->collModuleImages = null;
|
||||
if ($this->collModuleI18ns instanceof Collection) {
|
||||
$this->collModuleI18ns->clearIterator();
|
||||
}
|
||||
|
||||
1990
core/lib/Thelia/Model/Base/ModuleImage.php
Normal file
1439
core/lib/Thelia/Model/Base/ModuleImageI18n.php
Normal file
607
core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ModuleImageI18n as ChildModuleImageI18n;
|
||||
use Thelia\Model\ModuleImageI18nQuery as ChildModuleImageI18nQuery;
|
||||
use Thelia\Model\Map\ModuleImageI18nTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'module_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildModuleImageI18nQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildModuleImageI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
|
||||
* @method ChildModuleImageI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildModuleImageI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method ChildModuleImageI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
|
||||
* @method ChildModuleImageI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
|
||||
*
|
||||
* @method ChildModuleImageI18nQuery groupById() Group by the id column
|
||||
* @method ChildModuleImageI18nQuery groupByLocale() Group by the locale column
|
||||
* @method ChildModuleImageI18nQuery groupByTitle() Group by the title column
|
||||
* @method ChildModuleImageI18nQuery groupByDescription() Group by the description column
|
||||
* @method ChildModuleImageI18nQuery groupByChapo() Group by the chapo column
|
||||
* @method ChildModuleImageI18nQuery groupByPostscriptum() Group by the postscriptum column
|
||||
*
|
||||
* @method ChildModuleImageI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildModuleImageI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildModuleImageI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildModuleImageI18nQuery leftJoinModuleImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImage relation
|
||||
* @method ChildModuleImageI18nQuery rightJoinModuleImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImage relation
|
||||
* @method ChildModuleImageI18nQuery innerJoinModuleImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImage relation
|
||||
*
|
||||
* @method ChildModuleImageI18n findOne(ConnectionInterface $con = null) Return the first ChildModuleImageI18n matching the query
|
||||
* @method ChildModuleImageI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildModuleImageI18n matching the query, or a new ChildModuleImageI18n object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildModuleImageI18n findOneById(int $id) Return the first ChildModuleImageI18n filtered by the id column
|
||||
* @method ChildModuleImageI18n findOneByLocale(string $locale) Return the first ChildModuleImageI18n filtered by the locale column
|
||||
* @method ChildModuleImageI18n findOneByTitle(string $title) Return the first ChildModuleImageI18n filtered by the title column
|
||||
* @method ChildModuleImageI18n findOneByDescription(string $description) Return the first ChildModuleImageI18n filtered by the description column
|
||||
* @method ChildModuleImageI18n findOneByChapo(string $chapo) Return the first ChildModuleImageI18n filtered by the chapo column
|
||||
* @method ChildModuleImageI18n findOneByPostscriptum(string $postscriptum) Return the first ChildModuleImageI18n filtered by the postscriptum column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildModuleImageI18n objects filtered by the id column
|
||||
* @method array findByLocale(string $locale) Return ChildModuleImageI18n objects filtered by the locale column
|
||||
* @method array findByTitle(string $title) Return ChildModuleImageI18n objects filtered by the title column
|
||||
* @method array findByDescription(string $description) Return ChildModuleImageI18n objects filtered by the description column
|
||||
* @method array findByChapo(string $chapo) Return ChildModuleImageI18n objects filtered by the chapo column
|
||||
* @method array findByPostscriptum(string $postscriptum) Return ChildModuleImageI18n objects filtered by the postscriptum column
|
||||
*
|
||||
*/
|
||||
abstract class ModuleImageI18nQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ModuleImageI18nQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ModuleImageI18n', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildModuleImageI18nQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ModuleImageI18nQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ModuleImageI18nQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(array(12, 34), $con);
|
||||
* </code>
|
||||
*
|
||||
* @param array[$id, $locale] $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildModuleImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildModuleImageI18n A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM module_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
|
||||
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildModuleImageI18n();
|
||||
$obj->hydrate($row);
|
||||
ModuleImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildModuleImageI18n|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
$this->addUsingAlias(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return $this->add(null, '1<>1', Criteria::CUSTOM);
|
||||
}
|
||||
foreach ($keys as $key) {
|
||||
$cton0 = $this->getNewCriterion(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
|
||||
$cton1 = $this->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
|
||||
$cton0->addAnd($cton1);
|
||||
$this->addOr($cton0);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByModuleImage()
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ModuleImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ModuleImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
|
||||
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $locale 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 ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLocale($locale = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($locale)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $locale)) {
|
||||
$locale = str_replace('*', '%', $locale);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $locale, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the title column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
|
||||
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $title 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 ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTitle($title = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($title)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $title)) {
|
||||
$title = str_replace('*', '%', $title);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::TITLE, $title, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
|
||||
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $description 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 ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDescription($description = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($description)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $description)) {
|
||||
$description = str_replace('*', '%', $description);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::DESCRIPTION, $description, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the chapo column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
|
||||
* $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $chapo 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 ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChapo($chapo = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($chapo)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $chapo)) {
|
||||
$chapo = str_replace('*', '%', $chapo);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::CHAPO, $chapo, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the postscriptum column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
|
||||
* $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $postscriptum 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 ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPostscriptum($postscriptum = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($postscriptum)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $postscriptum)) {
|
||||
$postscriptum = str_replace('*', '%', $postscriptum);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ModuleImage object
|
||||
*
|
||||
* @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByModuleImage($moduleImage, $comparison = null)
|
||||
{
|
||||
if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
|
||||
return $this
|
||||
->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->getId(), $comparison);
|
||||
} elseif ($moduleImage instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ModuleImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinModuleImage($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ModuleImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ModuleImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ModuleImage relation ModuleImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useModuleImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinModuleImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildModuleImageI18n $moduleImageI18n Object to remove from the list of results
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($moduleImageI18n = null)
|
||||
{
|
||||
if ($moduleImageI18n) {
|
||||
$this->addCond('pruneCond0', $this->getAliasedColName(ModuleImageI18nTableMap::ID), $moduleImageI18n->getId(), Criteria::NOT_EQUAL);
|
||||
$this->addCond('pruneCond1', $this->getAliasedColName(ModuleImageI18nTableMap::LOCALE), $moduleImageI18n->getLocale(), Criteria::NOT_EQUAL);
|
||||
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the module_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ModuleImageI18nTableMap::clearInstancePool();
|
||||
ModuleImageI18nTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildModuleImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildModuleImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ModuleImageI18nTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ModuleImageI18nTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ModuleImageI18nQuery
|
||||
846
core/lib/Thelia/Model/Base/ModuleImageQuery.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Model\ModuleImage as ChildModuleImage;
|
||||
use Thelia\Model\ModuleImageI18nQuery as ChildModuleImageI18nQuery;
|
||||
use Thelia\Model\ModuleImageQuery as ChildModuleImageQuery;
|
||||
use Thelia\Model\Map\ModuleImageTableMap;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'module_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildModuleImageQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildModuleImageQuery orderByModuleId($order = Criteria::ASC) Order by the module_id column
|
||||
* @method ChildModuleImageQuery orderByFile($order = Criteria::ASC) Order by the file column
|
||||
* @method ChildModuleImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method ChildModuleImageQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildModuleImageQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildModuleImageQuery groupById() Group by the id column
|
||||
* @method ChildModuleImageQuery groupByModuleId() Group by the module_id column
|
||||
* @method ChildModuleImageQuery groupByFile() Group by the file column
|
||||
* @method ChildModuleImageQuery groupByPosition() Group by the position column
|
||||
* @method ChildModuleImageQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildModuleImageQuery groupByUpdatedAt() Group by the updated_at column
|
||||
*
|
||||
* @method ChildModuleImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildModuleImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildModuleImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildModuleImageQuery leftJoinModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the Module relation
|
||||
* @method ChildModuleImageQuery rightJoinModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Module relation
|
||||
* @method ChildModuleImageQuery innerJoinModule($relationAlias = null) Adds a INNER JOIN clause to the query using the Module relation
|
||||
*
|
||||
* @method ChildModuleImageQuery leftJoinModuleImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImageI18n relation
|
||||
* @method ChildModuleImageQuery rightJoinModuleImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImageI18n relation
|
||||
* @method ChildModuleImageQuery innerJoinModuleImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImageI18n relation
|
||||
*
|
||||
* @method ChildModuleImage findOne(ConnectionInterface $con = null) Return the first ChildModuleImage matching the query
|
||||
* @method ChildModuleImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildModuleImage matching the query, or a new ChildModuleImage object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildModuleImage findOneById(int $id) Return the first ChildModuleImage filtered by the id column
|
||||
* @method ChildModuleImage findOneByModuleId(int $module_id) Return the first ChildModuleImage filtered by the module_id column
|
||||
* @method ChildModuleImage findOneByFile(string $file) Return the first ChildModuleImage filtered by the file column
|
||||
* @method ChildModuleImage findOneByPosition(int $position) Return the first ChildModuleImage filtered by the position column
|
||||
* @method ChildModuleImage findOneByCreatedAt(string $created_at) Return the first ChildModuleImage filtered by the created_at column
|
||||
* @method ChildModuleImage findOneByUpdatedAt(string $updated_at) Return the first ChildModuleImage filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildModuleImage objects filtered by the id column
|
||||
* @method array findByModuleId(int $module_id) Return ChildModuleImage objects filtered by the module_id column
|
||||
* @method array findByFile(string $file) Return ChildModuleImage objects filtered by the file column
|
||||
* @method array findByPosition(int $position) Return ChildModuleImage objects filtered by the position column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildModuleImage objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildModuleImage objects filtered by the updated_at column
|
||||
*
|
||||
*/
|
||||
abstract class ModuleImageQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \Thelia\Model\Base\ModuleImageQuery object.
|
||||
*
|
||||
* @param string $dbName The database name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ModuleImage', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildModuleImageQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildModuleImageQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \Thelia\Model\ModuleImageQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \Thelia\Model\ModuleImageQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ChildModuleImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ModuleImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ModuleImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildModuleImage A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, MODULE_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM module_image WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
|
||||
$obj = new ChildModuleImage();
|
||||
$obj->hydrate($row);
|
||||
ModuleImageTableMap::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param ConnectionInterface $con A connection object
|
||||
*
|
||||
* @return ChildModuleImage|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param ConnectionInterface $con an optional connection object
|
||||
*
|
||||
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$dataFetcher = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterById(1234); // WHERE id = 1234
|
||||
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
|
||||
* $query->filterById(array('min' => 12)); // WHERE id > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $id The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterById($id = null, $comparison = null)
|
||||
{
|
||||
if (is_array($id)) {
|
||||
$useMinMax = false;
|
||||
if (isset($id['min'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the module_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByModuleId(1234); // WHERE module_id = 1234
|
||||
* $query->filterByModuleId(array(12, 34)); // WHERE module_id IN (12, 34)
|
||||
* $query->filterByModuleId(array('min' => 12)); // WHERE module_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByModule()
|
||||
*
|
||||
* @param mixed $moduleId The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByModuleId($moduleId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($moduleId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($moduleId['min'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($moduleId['max'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
|
||||
* $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $file 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 ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByFile($file = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($file)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $file)) {
|
||||
$file = str_replace('*', '%', $file);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::FILE, $file, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByPosition(1234); // WHERE position = 1234
|
||||
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
|
||||
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $position The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPosition($position = null, $comparison = null)
|
||||
{
|
||||
if (is_array($position)) {
|
||||
$useMinMax = false;
|
||||
if (isset($position['min'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($position['max'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::POSITION, $position, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the created_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
|
||||
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $createdAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCreatedAt($createdAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($createdAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($createdAt['min'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($createdAt['max'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the updated_at column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
|
||||
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $updatedAt The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
|
||||
{
|
||||
if (is_array($updatedAt)) {
|
||||
$useMinMax = false;
|
||||
if (isset($updatedAt['min'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($updatedAt['max'])) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\Module object
|
||||
*
|
||||
* @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByModule($module, $comparison = null)
|
||||
{
|
||||
if ($module instanceof \Thelia\Model\Module) {
|
||||
return $this
|
||||
->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->getId(), $comparison);
|
||||
} elseif ($module instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByModule() only accepts arguments of type \Thelia\Model\Module or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Module relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Module');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'Module');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Module relation Module object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ModuleQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinModule($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Module', '\Thelia\Model\ModuleQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ModuleImageI18n object
|
||||
*
|
||||
* @param \Thelia\Model\ModuleImageI18n|ObjectCollection $moduleImageI18n the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByModuleImageI18n($moduleImageI18n, $comparison = null)
|
||||
{
|
||||
if ($moduleImageI18n instanceof \Thelia\Model\ModuleImageI18n) {
|
||||
return $this
|
||||
->addUsingAlias(ModuleImageTableMap::ID, $moduleImageI18n->getId(), $comparison);
|
||||
} elseif ($moduleImageI18n instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useModuleImageI18nQuery()
|
||||
->filterByPrimaryKeys($moduleImageI18n->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByModuleImageI18n() only accepts arguments of type \Thelia\Model\ModuleImageI18n or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ModuleImageI18n relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinModuleImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ModuleImageI18n');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ModuleImageI18n');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ModuleImageI18n relation ModuleImageI18n object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ModuleImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useModuleImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
|
||||
{
|
||||
return $this
|
||||
->joinModuleImageI18n($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildModuleImage $moduleImage Object to remove from the list of results
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($moduleImage = null)
|
||||
{
|
||||
if ($moduleImage) {
|
||||
$this->addUsingAlias(ModuleImageTableMap::ID, $moduleImage->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the module_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += parent::doDeleteAll($con);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
ModuleImageTableMap::clearInstancePool();
|
||||
ModuleImageTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildModuleImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildModuleImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public function delete(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ModuleImageTableMap::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
|
||||
ModuleImageTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ModuleImageTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
// timestampable behavior
|
||||
|
||||
/**
|
||||
* Filter by the latest updated
|
||||
*
|
||||
* @param int $nbDays Maximum age of the latest update in days
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyUpdated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter by the latest created
|
||||
*
|
||||
* @param int $nbDays Maximum age of in days
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function recentlyCreated($nbDays = 7)
|
||||
{
|
||||
return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date desc
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastUpdatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by update date asc
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstUpdatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date desc
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function lastCreatedFirst()
|
||||
{
|
||||
return $this->addDescendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Order by create date asc
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function firstCreatedFirst()
|
||||
{
|
||||
return $this->addAscendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
|
||||
}
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the i18n relation
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$relationName = $relationAlias ? $relationAlias : 'ModuleImageI18n';
|
||||
|
||||
return $this
|
||||
->joinModuleImageI18n($relationAlias, $joinType)
|
||||
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query and hydrates the related I18n object.
|
||||
* Shortcut for $c->joinI18n($locale)->with()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildModuleImageQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$this
|
||||
->joinI18n($locale, null, $joinType)
|
||||
->with('ModuleImageI18n');
|
||||
$this->with['ModuleImageI18n']->setIsWithOneToMany(false);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the I18n relation query object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
|
||||
*
|
||||
* @return ChildModuleImageI18nQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinI18n($locale, $relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
|
||||
}
|
||||
|
||||
} // ModuleImageQuery
|
||||
@@ -60,6 +60,10 @@ use Thelia\Model\Map\ModuleTableMap;
|
||||
* @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
|
||||
* @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
|
||||
*
|
||||
* @method ChildModuleQuery leftJoinModuleImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImage relation
|
||||
* @method ChildModuleQuery rightJoinModuleImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImage relation
|
||||
* @method ChildModuleQuery innerJoinModuleImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImage relation
|
||||
*
|
||||
* @method ChildModuleQuery leftJoinModuleI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleI18n relation
|
||||
* @method ChildModuleQuery rightJoinModuleI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleI18n relation
|
||||
* @method ChildModuleQuery innerJoinModuleI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleI18n relation
|
||||
@@ -861,6 +865,79 @@ abstract class ModuleQuery extends ModelCriteria
|
||||
->useQuery($relationAlias ? $relationAlias : 'GroupModule', '\Thelia\Model\GroupModuleQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ModuleImage object
|
||||
*
|
||||
* @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildModuleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByModuleImage($moduleImage, $comparison = null)
|
||||
{
|
||||
if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
|
||||
return $this
|
||||
->addUsingAlias(ModuleTableMap::ID, $moduleImage->getModuleId(), $comparison);
|
||||
} elseif ($moduleImage instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useModuleImageQuery()
|
||||
->filterByPrimaryKeys($moduleImage->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ModuleImage relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildModuleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinModuleImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ModuleImage');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'ModuleImage');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ModuleImage relation ModuleImage object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useModuleImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinModuleImage($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \Thelia\Model\ModuleI18n object
|
||||
*
|
||||
|
||||
497
core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php
Normal file
@@ -0,0 +1,497 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ModuleImageI18n;
|
||||
use Thelia\Model\ModuleImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'module_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ModuleImageI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ModuleImageI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'module_image_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ModuleImageI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ModuleImageI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'module_image_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'module_image_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'module_image_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'module_image_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* the column name for the CHAPO field
|
||||
*/
|
||||
const CHAPO = 'module_image_i18n.CHAPO';
|
||||
|
||||
/**
|
||||
* the column name for the POSTSCRIPTUM field
|
||||
*/
|
||||
const POSTSCRIPTUM = 'module_image_i18n.POSTSCRIPTUM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* 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(ModuleImageI18nTableMap::ID, ModuleImageI18nTableMap::LOCALE, ModuleImageI18nTableMap::TITLE, ModuleImageI18nTableMap::DESCRIPTION, ModuleImageI18nTableMap::CHAPO, ModuleImageI18nTableMap::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, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* 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(ModuleImageI18nTableMap::ID => 0, ModuleImageI18nTableMap::LOCALE => 1, ModuleImageI18nTableMap::TITLE => 2, ModuleImageI18nTableMap::DESCRIPTION => 3, ModuleImageI18nTableMap::CHAPO => 4, ModuleImageI18nTableMap::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, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('module_image_i18n');
|
||||
$this->setPhpName('ModuleImageI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ModuleImageI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module_image', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ModuleImageI18n $obj A \Thelia\Model\ModuleImageI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ModuleImageI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ModuleImageI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ModuleImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ModuleImageI18nTableMap::CLASS_DEFAULT : ModuleImageI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ModuleImageI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ModuleImageI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ModuleImageI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ModuleImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ModuleImageI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::CHAPO);
|
||||
$criteria->addSelectColumn(ModuleImageI18nTableMap::POSTSCRIPTUM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.CHAPO');
|
||||
$criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ModuleImageI18nTableMap::DATABASE_NAME)->getTable(ModuleImageI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ModuleImageI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ModuleImageI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ModuleImageI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ModuleImageI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ModuleImageI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ModuleImageI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ModuleImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ModuleImageI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ModuleImageI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the module_image_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ModuleImageI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ModuleImageI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ModuleImageI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ModuleImageI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ModuleImageI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ModuleImageI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ModuleImageI18nTableMap::buildTableMap();
|
||||
475
core/lib/Thelia/Model/Map/ModuleImageTableMap.php
Normal file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ModuleImage;
|
||||
use Thelia\Model\ModuleImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'module_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ModuleImageTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ModuleImageTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'module_image';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ModuleImage';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ModuleImage';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'module_image.ID';
|
||||
|
||||
/**
|
||||
* the column name for the MODULE_ID field
|
||||
*/
|
||||
const MODULE_ID = 'module_image.MODULE_ID';
|
||||
|
||||
/**
|
||||
* the column name for the FILE field
|
||||
*/
|
||||
const FILE = 'module_image.FILE';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'module_image.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'module_image.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'module_image.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ModuleId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'moduleId', 'file', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ModuleImageTableMap::ID, ModuleImageTableMap::MODULE_ID, ModuleImageTableMap::FILE, ModuleImageTableMap::POSITION, ModuleImageTableMap::CREATED_AT, ModuleImageTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'MODULE_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'module_id', 'file', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ModuleId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'moduleId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ModuleImageTableMap::ID => 0, ModuleImageTableMap::MODULE_ID => 1, ModuleImageTableMap::FILE => 2, ModuleImageTableMap::POSITION => 3, ModuleImageTableMap::CREATED_AT => 4, ModuleImageTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'MODULE_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'module_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('module_image');
|
||||
$this->setPhpName('ModuleImage');
|
||||
$this->setClassName('\\Thelia\\Model\\ModuleImage');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('MODULE_ID', 'ModuleId', 'INTEGER', 'module', 'ID', true, null, null);
|
||||
$this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Module', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('module_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ModuleImageI18n', '\\Thelia\\Model\\ModuleImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleImageI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
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' => '', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to module_image * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ModuleImageI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ModuleImageTableMap::CLASS_DEFAULT : ModuleImageTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ModuleImage object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ModuleImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ModuleImageTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ModuleImageTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ModuleImageTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ModuleImageTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ModuleImageTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::ID);
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::MODULE_ID);
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::FILE);
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ModuleImageTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.MODULE_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME)->getTable(ModuleImageTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ModuleImageTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ModuleImageTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ModuleImage or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ModuleImage object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ModuleImage) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
|
||||
$criteria->add(ModuleImageTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ModuleImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ModuleImageTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ModuleImageTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the module_image table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ModuleImageQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ModuleImage or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ModuleImage object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ModuleImage object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ModuleImageTableMap::ID) && $criteria->keyContainsValue(ModuleImageTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ModuleImageTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ModuleImageQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ModuleImageTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ModuleImageTableMap::buildTableMap();
|
||||
@@ -188,6 +188,7 @@ class ModuleTableMap extends TableMap
|
||||
$this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId');
|
||||
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
|
||||
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules');
|
||||
$this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'ModuleImages');
|
||||
$this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
@@ -213,6 +214,7 @@ class ModuleTableMap extends TableMap
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
AreaDeliveryModuleTableMap::clearInstancePool();
|
||||
GroupModuleTableMap::clearInstancePool();
|
||||
ModuleImageTableMap::clearInstancePool();
|
||||
ModuleI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
|
||||
10
core/lib/Thelia/Model/ModuleImage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ModuleImage as BaseModuleImage;
|
||||
|
||||
class ModuleImage extends BaseModuleImage
|
||||
{
|
||||
|
||||
}
|
||||
10
core/lib/Thelia/Model/ModuleImageI18n.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ModuleImageI18n as BaseModuleImageI18n;
|
||||
|
||||
class ModuleImageI18n extends BaseModuleImageI18n
|
||||
{
|
||||
|
||||
}
|
||||
21
core/lib/Thelia/Model/ModuleImageI18nQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ModuleImageI18nQuery as BaseModuleImageI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'module_image_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ModuleImageI18nQuery extends BaseModuleImageI18nQuery
|
||||
{
|
||||
|
||||
} // ModuleImageI18nQuery
|
||||
21
core/lib/Thelia/Model/ModuleImageQuery.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\ModuleImageQuery as BaseModuleImageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'module_image' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ModuleImageQuery extends BaseModuleImageQuery
|
||||
{
|
||||
|
||||
} // ModuleImageQuery
|
||||
@@ -25,6 +25,12 @@
|
||||
namespace Thelia\Module;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
use Thelia\Model\Map\ModuleImageTableMap;
|
||||
use Thelia\Tools\Image;
|
||||
use Thelia\Exception\ModuleException;
|
||||
use Thelia\Model\Module;
|
||||
use Thelia\Model\ModuleImage;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
|
||||
abstract class BaseModule extends ContainerAware
|
||||
{
|
||||
@@ -32,14 +38,28 @@ abstract class BaseModule extends ContainerAware
|
||||
const DELIVERY_MODULE_TYPE = 2;
|
||||
const PAYMENT_MODULE_TYPE = 3;
|
||||
|
||||
const IS_ACTIVATED = 1;
|
||||
const IS_NOT_ACTIVATED = 0;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected function activate()
|
||||
public function activate()
|
||||
{
|
||||
|
||||
$moduleModel = $this->getModuleModel();
|
||||
if($moduleModel->getActivate() == self::IS_NOT_ACTIVATED) {
|
||||
$moduleModel->setActivate(self::IS_ACTIVATED);
|
||||
$moduleModel->save();
|
||||
try {
|
||||
$this->afterActivation();
|
||||
} catch(\Exception $e) {
|
||||
$moduleModel->setActivate(self::IS_NOT_ACTIVATED);
|
||||
$moduleModel->save();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hasContainer()
|
||||
@@ -56,7 +76,88 @@ abstract class BaseModule extends ContainerAware
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
public function deployImageFolder(Module $module, $folderPath)
|
||||
{
|
||||
try {
|
||||
$directoryBrowser = new \DirectoryIterator($folderPath);
|
||||
} catch(\UnexpectedValueException $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$con = \Propel\Runtime\Propel::getConnection(
|
||||
ModuleImageTableMap::DATABASE_NAME
|
||||
);
|
||||
|
||||
/* browse the directory */
|
||||
$imagePosition = 1;
|
||||
foreach($directoryBrowser as $directoryContent) {
|
||||
/* is it a file ? */
|
||||
if ($directoryContent->isFile()) {
|
||||
|
||||
$fileName = $directoryContent->getFilename();
|
||||
$filePath = $directoryContent->getPathName();
|
||||
|
||||
/* is it a picture ? */
|
||||
if( Image::isImage($filePath) ) {
|
||||
|
||||
$con->beginTransaction();
|
||||
|
||||
$image = new ModuleImage();
|
||||
$image->setModuleId($module->getId());
|
||||
$image->setPosition($imagePosition);
|
||||
$image->save();
|
||||
|
||||
$imageDirectory = sprintf("%s/../../../../local/media/images/module", __DIR__);
|
||||
$imageFileName = sprintf("%s-%d-%s", $module->getCode(), $image->getId(), $fileName);
|
||||
|
||||
$increment = 0;
|
||||
while(file_exists($imageDirectory . '/' . $imageFileName)) {
|
||||
$imageFileName = sprintf("%s-%d-%d-%s", $module->getCode(), $image->getId(), $increment, $fileName);
|
||||
$increment++;
|
||||
}
|
||||
|
||||
$imagePath = sprintf('%s/%s', $imageDirectory, $imageFileName);
|
||||
|
||||
if (! is_dir($imageDirectory)) {
|
||||
if(! @mkdir($imageDirectory, 0777, true)) {
|
||||
$con->rollBack();
|
||||
throw new ModuleException(sprintf("Cannot create directory : %s", $imageDirectory), ModuleException::CODE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
if(! @copy($filePath, $imagePath)) {
|
||||
$con->rollBack();
|
||||
throw new ModuleException(sprintf("Cannot copy file : %s to : %s", $filePath, $imagePath), ModuleException::CODE_NOT_FOUND);
|
||||
}
|
||||
|
||||
$image->setFile($imageFileName);
|
||||
$image->save();
|
||||
|
||||
$con->commit();
|
||||
$imagePosition++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Module
|
||||
* @throws \Thelia\Exception\ModuleException
|
||||
*/
|
||||
public function getModuleModel()
|
||||
{
|
||||
$moduleModel = ModuleQuery::create()->findOneByCode($this->getCode());
|
||||
|
||||
if(null === $moduleModel) {
|
||||
throw new ModuleException(sprintf("Module Code `%s` not found", $this->getCode()), ModuleException::CODE_NOT_FOUND);
|
||||
}
|
||||
|
||||
return $moduleModel;
|
||||
}
|
||||
|
||||
abstract public function getCode();
|
||||
abstract public function install();
|
||||
abstract public function afterActivation();
|
||||
abstract public function destroy();
|
||||
|
||||
}
|
||||
|
||||
34
core/lib/Thelia/Module/PaymentModuleInterface.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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\Module;
|
||||
|
||||
use Thelia\Model\Country;
|
||||
|
||||
interface PaymentModuleInterface extends BaseModuleInterface
|
||||
{
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function pay();
|
||||
}
|
||||
109
core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php
Executable file
@@ -0,0 +1,109 @@
|
||||
<?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\Tests\Command;
|
||||
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Thelia\Command\ModuleActivateCommand;
|
||||
use Thelia\Core\Application;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
/**
|
||||
* Class ModuleActivateCommandTest
|
||||
*
|
||||
* @package Thelia\Tests\Command
|
||||
* @author Etienne Roudeix <eroudeix@openstudio.fr>
|
||||
*/
|
||||
class ModuleActivateCommandTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testModuleActivateCommand()
|
||||
{
|
||||
$module = ModuleQuery::create()->findOne();
|
||||
|
||||
if(null !== $module) {
|
||||
$application = new Application($this->getKernel());
|
||||
|
||||
$module->setActivate(BaseModule::IS_NOT_ACTIVATED);
|
||||
$module->save();
|
||||
|
||||
$moduleActivate = new ModuleActivateCommand();
|
||||
$moduleActivate->setContainer($this->getContainer());
|
||||
|
||||
$application->add($moduleActivate);
|
||||
|
||||
$command = $application->find("module:activate");
|
||||
$commandTester = new CommandTester($command);
|
||||
$commandTester->execute(array(
|
||||
"command" => $command->getName(),
|
||||
"module" => $module->getCode(),
|
||||
));
|
||||
|
||||
$this->assertEquals(BaseModule::IS_ACTIVATED, ModuleQuery::create()->findPk($module->getId())->getActivate());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage module Letshopethismoduledoesnotexists not found
|
||||
*/
|
||||
public function testModuleActivateCommandUnknownModule()
|
||||
{
|
||||
$module = ModuleQuery::create()->findOne();
|
||||
$testedModule = ModuleQuery::create()->findOneByCode('Letshopethismoduledoesnotexists');
|
||||
|
||||
if(null !== $module && null == $testedModule) {
|
||||
$application = new Application($this->getKernel());
|
||||
|
||||
$module->setActivate(BaseModule::IS_NOT_ACTIVATED);
|
||||
$module->save();
|
||||
|
||||
$moduleActivate = new ModuleActivateCommand();
|
||||
$moduleActivate->setContainer($this->getContainer());
|
||||
|
||||
$application->add($moduleActivate);
|
||||
|
||||
$command = $application->find("module:activate");
|
||||
$commandTester = new CommandTester($command);
|
||||
$commandTester->execute(array(
|
||||
"command" => $command->getName(),
|
||||
"module" => "letshopethismoduledoesnotexists",
|
||||
));
|
||||
|
||||
$out = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKernel()
|
||||
{
|
||||
$kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface");
|
||||
|
||||
return $kernel;
|
||||
}
|
||||
|
||||
public function getContainer()
|
||||
{
|
||||
$container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
|
||||
|
||||
return $container;
|
||||
}
|
||||
}
|
||||
53
core/lib/Thelia/Tests/Module/BaseModuleTestor.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Tests\Module;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Etienne Roudeix <eroudeix@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
abstract class BaseModuleTestor extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $instance;
|
||||
|
||||
abstract public function getTestedClassName();
|
||||
abstract public function getTestedInstance();
|
||||
|
||||
/*protected function getMethod($name)
|
||||
{
|
||||
$class = new \ReflectionClass($this->getTestedClassName());
|
||||
$method = $class->getMethod($name);
|
||||
$method->setAccessible(true);
|
||||
|
||||
return $method;
|
||||
}*/
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->instance = $this->getTestedInstance();
|
||||
}
|
||||
}
|
||||
|
||||
44
core/lib/Thelia/Tools/Image.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?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\Tools;
|
||||
|
||||
class Image
|
||||
{
|
||||
static public function isImage($filePath, $allowedImageTypes = null)
|
||||
{
|
||||
$imageFile = getimagesize($filePath);
|
||||
$imageType = $imageFile[2];
|
||||
|
||||
if(!is_array($allowedImageTypes) && $imageType != IMAGETYPE_UNKNOWN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(in_array($imageType , $allowedImageTypes))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,10 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat
|
||||
|
||||
|
||||
INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
|
||||
(1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW()),
|
||||
(2, 'Colissimo', 2, 1, 1, 'Colissimo\\Colissimo', NOW(), NOW());
|
||||
(1, 'TheliaDebugBar', 1, 1, 1, 'TheliaDebugBar\\TheliaDebugBar', NOW(), NOW()),
|
||||
(2, 'Colissimo', 2, 0, 1, 'Colissimo\\Colissimo', NOW(), NOW()),
|
||||
(3, 'Cheque', 3, 0, 1, 'Cheque\\Cheque', NOW(), NOW()),
|
||||
(4, 'FakeCB', 3, 0, 2, 'FakeCB\\FakeCB', NOW(), NOW());
|
||||
|
||||
INSERT INTO `module_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `postscriptum`) VALUES
|
||||
('2', 'en_US', '72h delivery', NULL, NULL, NULL),
|
||||
@@ -68,6 +70,21 @@ VALUES
|
||||
(3, 'fr_FR', 'Livre anglaise'),
|
||||
(3, 'en_US', 'UK Pound');
|
||||
|
||||
INSERT INTO `area` (`id`, `name`, `postage`, `created_at`, `updated_at`) VALUES
|
||||
(1, 'France', NULL, NOW(), NOW()),
|
||||
(2, 'Area 1', NULL, NOW(), NOW()),
|
||||
(3, 'Area 2', NULL, NOW(), NOW()),
|
||||
(4, 'Area 3', NULL, NOW(), NOW()),
|
||||
(5, 'Area 4', NULL, NOW(), NOW()),
|
||||
(6, 'Area 5', NULL, NOW(), NOW()),
|
||||
(7, 'Area 6', NULL, NOW(), NOW()),
|
||||
(8, 'Area 7', NULL, NOW(), NOW()),
|
||||
(9, 'Area 8', NULL, NOW(), NOW()),
|
||||
(10, 'DOM', NULL, NOW(), NOW()),
|
||||
(11, 'TOM', NULL, NOW(), NOW());
|
||||
|
||||
INSERT INTO `area_delivery_module` (`id`, `area_id`, `delivery_module_id`, `created_at`, `updated_at`) VALUES
|
||||
(1, 1, 2, NOW(), NOW());
|
||||
|
||||
INSERT INTO `country` (`id`, `area_id`, `isocode`, `isoalpha2`, `isoalpha3`, `by_default`, `created_at`, `updated_at`) VALUES
|
||||
(1, NULL, '4', 'AF', 'AFG', 0, NOW(), NOW()),
|
||||
@@ -131,7 +148,7 @@ INSERT INTO `country` (`id`, `area_id`, `isocode`, `isoalpha2`, `isoalpha3`, `by
|
||||
(61, NULL, '231', 'ET', 'ETH', 0, NOW(), NOW()),
|
||||
(62, NULL, '242', 'FJ', 'FJI', 0, NOW(), NOW()),
|
||||
(63, NULL, '246', 'FI', 'FIN', 0, NOW(), NOW()),
|
||||
(64, NULL, '250', 'FR', 'FRA', 1, NOW(), NOW()),
|
||||
(64, 1, '250', 'FR', 'FRA', 1, NOW(), NOW()),
|
||||
(65, NULL, '266', 'GA', 'GAB', 0, NOW(), NOW()),
|
||||
(66, NULL, '270', 'GM', 'GMB', 0, NOW(), NOW()),
|
||||
(67, NULL, '268', 'GE', 'GEO', 0, NOW(), NOW()),
|
||||
|
||||
@@ -896,6 +896,7 @@ CREATE TABLE `area_delivery_module`
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `area_id_delivery_module_id_UNIQUE` (`area_id`, `delivery_module_id`),
|
||||
INDEX `idx_area_delivery_module_area_id` (`area_id`),
|
||||
INDEX `idx_area_delivery_module_delivery_module_id_idx` (`delivery_module_id`),
|
||||
CONSTRAINT `fk_area_delivery_module_area_id`
|
||||
@@ -1535,6 +1536,29 @@ CREATE TABLE `template`
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- module_image
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `module_image`;
|
||||
|
||||
CREATE TABLE `module_image`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`module_id` INTEGER NOT NULL,
|
||||
`file` VARCHAR(255) NOT NULL,
|
||||
`position` INTEGER,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_module_image_module_id` (`module_id`),
|
||||
CONSTRAINT `fk_module_image_module_id`
|
||||
FOREIGN KEY (`module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- category_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
@@ -2131,6 +2155,27 @@ CREATE TABLE `template_i18n`
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- module_image_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `module_image_i18n`;
|
||||
|
||||
CREATE TABLE `module_image_i18n`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
|
||||
`title` VARCHAR(255),
|
||||
`description` LONGTEXT,
|
||||
`chapo` TEXT,
|
||||
`postscriptum` TEXT,
|
||||
PRIMARY KEY (`id`,`locale`),
|
||||
CONSTRAINT `module_image_i18n_FK_1`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `module_image` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- category_version
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
86
local/modules/Cheque/Cheque.php
Executable file
@@ -0,0 +1,86 @@
|
||||
<?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 Cheque;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Model\ModuleImageQuery;
|
||||
use Thelia\Module\BaseModule;
|
||||
use Thelia\Module\PaymentModuleInterface;
|
||||
|
||||
class Cheque extends BaseModule implements PaymentModuleInterface
|
||||
{
|
||||
protected $request;
|
||||
protected $dispatcher;
|
||||
|
||||
public function setRequest(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function setDispatcher(EventDispatcherInterface $dispatcher)
|
||||
{
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
public function getDispatcher()
|
||||
{
|
||||
return $this->dispatcher;
|
||||
}
|
||||
|
||||
public function pay()
|
||||
{
|
||||
// TODO: Implement pay() method.
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function afterActivation()
|
||||
{
|
||||
/* insert the images from image folder if first module activation */
|
||||
$module = $this->getModuleModel();
|
||||
if(ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
||||
$this->deployImageFolder($module, sprintf('%s/images', __DIR__));
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy()
|
||||
{
|
||||
// TODO: Implement destroy() method.
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return 'Cheque';
|
||||
}
|
||||
|
||||
}
|
||||
36
local/modules/Cheque/Config/config.xml
Executable file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<loops>
|
||||
<!-- sample definition
|
||||
<loop name="MySuperLoop" class="MyModule\Loop\MySuperLoop" />
|
||||
-->
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<!--
|
||||
<form name="MyFormName" class="MyModule\Form\MySuperForm" />
|
||||
-->
|
||||
</forms>
|
||||
|
||||
<commands>
|
||||
<!--
|
||||
<command class="MyModule\Command\MySuperCommand" />
|
||||
-->
|
||||
</commands>
|
||||
|
||||
<templateDirectives>
|
||||
<!-- Sample definition
|
||||
<templateDirectives class="MyModule\Directive\MyTemplateDirective" name="my_filter"/>
|
||||
-->
|
||||
</templateDirectives>
|
||||
|
||||
<!--
|
||||
<services>
|
||||
|
||||
</services>
|
||||
-->
|
||||
</config>
|
||||
BIN
local/modules/Cheque/images/cheque.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
@@ -63,10 +63,15 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
|
||||
*/
|
||||
public function getPostage(Country $country)
|
||||
{
|
||||
// TODO: Implement calculate() method.
|
||||
// TODO: Implement getPostage() method.
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function afterActivation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class
|
||||
* Like install and destroy
|
||||
@@ -81,4 +86,9 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
|
||||
// TODO: Implement destroy() method.
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return 'Colissimo';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia" namespace="DebugBar\Model">
|
||||
<!--
|
||||
See propel documentation on http://propelorm.org for all information about schema file
|
||||
-->
|
||||
<external-schema filename="/home/manu/dev/www/thelia/local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
36
local/modules/FakeCB/Config/config.xml
Executable file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<loops>
|
||||
<!-- sample definition
|
||||
<loop name="MySuperLoop" class="MyModule\Loop\MySuperLoop" />
|
||||
-->
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<!--
|
||||
<form name="MyFormName" class="MyModule\Form\MySuperForm" />
|
||||
-->
|
||||
</forms>
|
||||
|
||||
<commands>
|
||||
<!--
|
||||
<command class="MyModule\Command\MySuperCommand" />
|
||||
-->
|
||||
</commands>
|
||||
|
||||
<templateDirectives>
|
||||
<!-- Sample definition
|
||||
<templateDirectives class="MyModule\Directive\MyTemplateDirective" name="my_filter"/>
|
||||
-->
|
||||
</templateDirectives>
|
||||
|
||||
<!--
|
||||
<services>
|
||||
|
||||
</services>
|
||||
-->
|
||||
</config>
|
||||
0
local/modules/FakeCB/Config/plugin.xml
Executable file
86
local/modules/FakeCB/FakeCB.php
Executable file
@@ -0,0 +1,86 @@
|
||||
<?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 FakeCB;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Model\Base\ModuleImageQuery;
|
||||
use Thelia\Module\BaseModule;
|
||||
use Thelia\Module\PaymentModuleInterface;
|
||||
|
||||
class FakeCB extends BaseModule implements PaymentModuleInterface
|
||||
{
|
||||
protected $request;
|
||||
protected $dispatcher;
|
||||
|
||||
public function setRequest(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function setDispatcher(EventDispatcherInterface $dispatcher)
|
||||
{
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
public function getDispatcher()
|
||||
{
|
||||
return $this->dispatcher;
|
||||
}
|
||||
|
||||
public function pay()
|
||||
{
|
||||
// TODO: Implement pay() method.
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function afterActivation()
|
||||
{
|
||||
/* insert the images from image folder if first module activation */
|
||||
$module = $this->getModuleModel();
|
||||
if(ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
||||
$this->deployImageFolder($module, sprintf('%s/images', __DIR__));
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy()
|
||||
{
|
||||
// TODO: Implement destroy() method.
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return 'FakeCB';
|
||||
}
|
||||
|
||||
}
|
||||
52
local/modules/FakeCB/Tests/FakeCBTest.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?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 FakeCB\Tests;
|
||||
|
||||
use FakeCB\FakeCB;
|
||||
use Thelia\Tests\Module\BaseModuleTestor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Etienne Roudeix <eroudeix@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class FakeCBTest extends BaseModuleTestor
|
||||
{
|
||||
public function getTestedClassName()
|
||||
{
|
||||
return 'FakeCB\FakeCB';
|
||||
}
|
||||
|
||||
public function getTestedInstance()
|
||||
{
|
||||
return new FakeCB();
|
||||
}
|
||||
|
||||
public function testInstall()
|
||||
{
|
||||
//$fakeCB = new FakeCB();
|
||||
|
||||
//$fakeCB->install();
|
||||
}
|
||||
}
|
||||
BIN
local/modules/FakeCB/images/mastercard.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
local/modules/FakeCB/images/visa.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@@ -32,13 +32,13 @@
|
||||
<services>
|
||||
<service id="debugBar" class="DebugBar\DebugBar"/>
|
||||
|
||||
<service id="smarty.debugbar" class="DebugBar\Smarty\Plugin\DebugBar">
|
||||
<service id="smarty.debugbar" class="TheliaDebugBar\Smarty\Plugin\DebugBar">
|
||||
<argument type="service" id="debugBar"/>
|
||||
<argument >%kernel.debug%</argument>
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
</service>
|
||||
|
||||
<service id="debugBar.listener" class="DebugBar\Listeners\DebugBarListeners">
|
||||
<service id="debugBar.listener" class="TheliaDebugBar\Listeners\DebugBarListeners">
|
||||
<argument type="service" id="service_container"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
0
local/modules/TheliaDebugBar/Config/plugin.xml
Executable file
6
local/modules/TheliaDebugBar/Config/schema.xml
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia" namespace="TheliaDebugBar\Model">
|
||||
<!--
|
||||
See propel documentation on http://propelorm.org for all information about schema file
|
||||
-->
|
||||
</database>
|
||||
@@ -21,14 +21,17 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace DebugBar\DataCollector;
|
||||
namespace TheliaDebugBar\DataCollector;
|
||||
|
||||
use DebugBar\DataCollector\DataCollector;
|
||||
use DebugBar\DataCollector\Renderable;
|
||||
use Propel\Runtime\Propel;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Class PropelCollector
|
||||
* @package DebugBar\DataCollector
|
||||
* @package TheliaDebugBar\DataCollector
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class PropelCollector extends DataCollector implements Renderable, LoggerInterface
|
||||
@@ -21,11 +21,12 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace DebugBar\Listeners;
|
||||
namespace TheliaDebugBar\Listeners;
|
||||
|
||||
use DebugBar\DataCollector\MemoryCollector;
|
||||
use DebugBar\DataCollector\MessagesCollector;
|
||||
use DebugBar\DataCollector\PhpInfoCollector;
|
||||
use DebugBar\DataCollector\PropelCollector;
|
||||
use TheliaDebugBar\DataCollector\PropelCollector;
|
||||
use DebugBar\DataCollector\TimeDataCollector;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
@@ -35,7 +36,7 @@ use Thelia\Core\Event\TheliaEvents;
|
||||
|
||||
/**
|
||||
* Class DebugBarListeners
|
||||
* @package DebugBar\Listeners
|
||||
* @package TheliaDebugBar\Listeners
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class DebugBarListeners extends BaseAction implements EventSubscriberInterface {
|
||||
@@ -21,7 +21,7 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace DebugBar\Smarty\Plugin;
|
||||
namespace TheliaDebugBar\Smarty\Plugin;
|
||||
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||
use Thelia\Core\Template\Smarty\an;
|
||||
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
|
||||
@@ -21,17 +21,22 @@
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace DebugBar;
|
||||
namespace TheliaDebugBar;
|
||||
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
class DebugBar extends BaseModule
|
||||
class TheliaDebugBar extends BaseModule
|
||||
{
|
||||
/**
|
||||
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class
|
||||
* Like install and destroy
|
||||
*/
|
||||
|
||||
public function afterActivation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
// TODO: Implement install() method.
|
||||
@@ -41,4 +46,9 @@ class DebugBar extends BaseModule
|
||||
{
|
||||
// TODO: Implement destroy() method.
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return 'TheliaDebugBar';
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
<testsuites>
|
||||
<testsuite name="Thelia">
|
||||
<directory>core/lib/Thelia/Tests</directory>
|
||||
<directory>local/modules/*/Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
|
||||
@@ -2,34 +2,43 @@
|
||||
# @author Guillaume MOREL
|
||||
# v0.2
|
||||
|
||||
echo -e "\033[47m\033[1;31m\n[WARN] This script will reset this Thelia2 install\n\033[0m"
|
||||
echo -e "\033[47m\033[1;31m\n[WARNING] This script will reset this Thelia2 install\nPress ENTER to continue or ^C to cancel\033[0m"
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Clearing caches\e[00m\n"
|
||||
read test
|
||||
|
||||
echo -e "\n\033[01;34m[INFO] Clearing caches\033[00m\n"
|
||||
php Thelia cache:clear
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Downloading vendors\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Downloading vendors\033[00m\n"
|
||||
composer install --prefer-dist --optimize-autoloader
|
||||
|
||||
cd local/config/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Building Models file\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Building Models file\033[00m\n"
|
||||
../../bin/propel build -v --output-dir=../../core/lib/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Building SQL CREATE file\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Building SQL CREATE file\033[00m\n"
|
||||
../../bin/propel sql:build -v --output-dir=../../install/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Reloading Thelia2 database\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Reloading Thelia2 database\033[00m\n"
|
||||
cd ../..
|
||||
rm install/sqldb.map
|
||||
php Thelia thelia:dev:reloadDB
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Installing fixtures\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Installing fixtures\033[00m\n"
|
||||
php install/faker.php
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Adding admin\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Adding admin\033[00m\n"
|
||||
php Thelia thelia:create-admin --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Clearing caches\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Clearing caches\033[00m\n"
|
||||
php Thelia cache:clear
|
||||
|
||||
echo -e "\n\e[00;32m[SUCCESS] Reset done\e[00m\n"
|
||||
echo -e "\n\033[01;34m[INFO] Activating Delivery Module(s)\033[00m\n"
|
||||
php Thelia module:activate Colissimo
|
||||
|
||||
echo -e "\n\033[01;34m[INFO] Activating Payment Module(s)\033[00m\n"
|
||||
php Thelia module:activate Cheque
|
||||
php Thelia module:activate FakeCB
|
||||
|
||||
echo -e "\n\033[00;32m[SUCCESS] Reset done\033[00m\n"
|
||||
@@ -138,9 +138,9 @@
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-content" type="auth" roles="ADMIN" permissions="admin.content.view"}
|
||||
<li class="{if $admin_current_location == 'content'}active{/if}" id="content_menu">
|
||||
<a href="{url path='/admin/content'}">{intl l="Content"}</a>
|
||||
{loop name="menu-auth-content" type="auth" roles="ADMIN" permissions="admin.folders.view"}
|
||||
<li class="{if $admin_current_location == 'folder'}active{/if}" id="folders_menu">
|
||||
<a href="{url path='/admin/folders'}">{intl l="Folders"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
|
||||
@@ -286,6 +286,27 @@
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
<script src="/web/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: ".wysiwyg",
|
||||
theme: "modern",
|
||||
menubar : false,
|
||||
language: "",
|
||||
plugins: [
|
||||
"advlist autolink link image lists charmap print preview hr anchor pagebreak",
|
||||
"searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
|
||||
"table contextmenu directionality emoticons paste textcolor filemanager"
|
||||
],
|
||||
toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect | filemanager | link unlink anchor | image media | forecolor backcolor | print preview code ",
|
||||
image_advtab: true ,
|
||||
external_filemanager_path:"/web/tinymce/plugins/filemanager/",
|
||||
filemanager_title:"{intl l='Files manager'}" ,
|
||||
external_plugins: { "filemanager" : "/web/tinymce/plugins/filemanager/plugin.min.js"}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
|
||||
344
templates/admin/default/folder-edit.html
Normal file
@@ -0,0 +1,344 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="check-permissions"}admin.folder.view{/block}
|
||||
|
||||
{block name="page-title"}{intl l='Edit folder'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="folder edit-folder">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{* include file="includes/folder-breadcrumb.html" editing_category="true" *}
|
||||
|
||||
<div class="row">
|
||||
{loop name="folder_edit" type="folder" visible="*" id="{$folder_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 folder %title' title=$TITLE}
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 actions">
|
||||
|
||||
{if $HAS_PREVIOUS != 0}
|
||||
<a href="{url path='/admin/folders/update' folder_id=$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' folder_id=$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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<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="#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>
|
||||
<li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade active in" id="general">
|
||||
|
||||
<div class="form-container">
|
||||
|
||||
{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}"}
|
||||
|
||||
{* 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/folder' folder_id={$folder_id}}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='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}
|
||||
|
||||
{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">
|
||||
{intl l="{$label}"} :
|
||||
</label>
|
||||
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewriten URL'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{form_field form=$form field='parent'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
|
||||
<label for="{$label_attr.for}" class="control-label">
|
||||
{intl l="{$label}"} :
|
||||
</label>
|
||||
|
||||
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
|
||||
<option value="0">{intl l="Top level"}</option>
|
||||
|
||||
{$myparent=$PARENT}
|
||||
{loop name="fold-parent" type="folder-tree" visible="*" folder="0"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $myparent == $ID}selected="selected"{/if} {if $folder_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}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="control-group">
|
||||
<lablel> </lablel>
|
||||
<div class="controls">
|
||||
<p>{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}"}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="details">
|
||||
<div class="form-container">
|
||||
<div class="form-group">
|
||||
<form action="{url path='/admin/folders/related-content/add'}" id="related_content_form">
|
||||
|
||||
{include
|
||||
file="includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons=true
|
||||
close_url="{url path='/admin/folders' folder_id=$folder_id}"
|
||||
}
|
||||
|
||||
<input type="hidden" name="folder_id" value="{$folder_id}" />
|
||||
<input type="hidden" name="current_tab" value="details" />
|
||||
|
||||
{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="">Select a folder...</option>
|
||||
{loop name="folders" type="folder" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-block">{intl l='Select a folder to get its content'}</span>
|
||||
</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="">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>
|
||||
|
||||
</div>
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="folders"}
|
||||
<div class="alert alert-info">{intl l="No folders found"}</div>
|
||||
{/elseloop}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
|
||||
<th>{intl l='Attribute title'}</th>
|
||||
|
||||
{module_include location='folder_contents_table_header'}
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="assigned_contents" type="associated_content" folder="$folder_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
{module_include location='folder_contents_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.folder.content.delete"}
|
||||
<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 folder contains no contents"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="images">
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="documents">
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="modules">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{* 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="" />
|
||||
|
||||
<input type="hidden" name="current_tab" value="details" />
|
||||
{/capture}
|
||||
|
||||
{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 ?"}
|
||||
|
||||
form_action = {url path='/admin/folders/related-content/delete'}
|
||||
form_content = {$smarty.capture.delete_content_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
|
||||
$('.use_default_rewriten_url').click(function(ev) {
|
||||
alert("Not functionnal");
|
||||
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
// Show proper tab, if defined
|
||||
{if ! empty($current_tab)}
|
||||
$('#tabbed-menu a[href="#{$current_tab}"]').tab('show')
|
||||
{/if}
|
||||
|
||||
|
||||
// Set proper content ID in delete content from
|
||||
$('a.delete-content').click(function(ev) {
|
||||
$('#content_delete_id').val($(this).data('id'));
|
||||
$('#folder_delete_id').val($('#folder_id').val());
|
||||
});
|
||||
|
||||
// Load content on folder selection
|
||||
$('#folder_id').change(function(event) {
|
||||
$.ajax({
|
||||
url : '{url path="/admin/folder/$folder_id/available-related-content/"}' + $(this).val() + '.xml',
|
||||
type : 'get',
|
||||
dataType : 'json',
|
||||
success : function(json) {
|
||||
$('#content_id :not(:first-child)').remove();
|
||||
|
||||
var have_content = false;
|
||||
|
||||
$.each(json, function(idx, value) {
|
||||
$('#content_id').append($('<option>').text(value.title).attr('value', value.id));
|
||||
|
||||
have_content = true; // Lame...
|
||||
});
|
||||
|
||||
if (have_content)
|
||||
$('#content_selector').removeClass('hide');
|
||||
else
|
||||
$('#content_selector').addClass('hide');
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize folder (id={$folder_id}) select value
|
||||
{if $folder_id != 0}
|
||||
$('#folder_id').val("{$folder_id}").change();
|
||||
{/if}
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
626
templates/admin/default/folders.html
Normal file
@@ -0,0 +1,626 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Folders'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.folders.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="folders">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{* include file="includes/folder-breadcrumb.html" *}
|
||||
|
||||
{module_include location='folders_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<table class="table table-striped table-condensed" id="folder_list">
|
||||
<caption>
|
||||
{* display parent folder name, and get current folder ID *}
|
||||
{loop name="folder_title" type="folder" visible="*" id=$folder_id}
|
||||
{intl l="Folders in %fold" fold=$TITLE}
|
||||
{$fold_id = $ID}
|
||||
{/loop}
|
||||
{elseloop rel="folder_title"}
|
||||
{intl l="Top level folders"}
|
||||
{/elseloop}
|
||||
|
||||
{module_include location='folder_list_caption'}
|
||||
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new folder'}" href="#folder_creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</caption>
|
||||
|
||||
{ifloop rel="folder_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$folder_order
|
||||
order='id'
|
||||
reverse_order='id_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id}
|
||||
request_parameter_name='folder_order'
|
||||
label="{intl l='ID'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th class="object-image"> </th>
|
||||
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$folder_order
|
||||
order='alpha'
|
||||
reverse_order='alpha_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id}
|
||||
request_parameter_name='folder_order'
|
||||
label="{intl l='Folder title'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
{module_include location='folder_list_header'}
|
||||
|
||||
<th>
|
||||
{admin_sortable_header
|
||||
current_order=$folder_order
|
||||
order='visible'
|
||||
reverse_order='visible_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id}
|
||||
request_parameter_name='folder_order'
|
||||
label="{intl l='Online'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{admin_sortable_header
|
||||
current_order=$folder_order
|
||||
order='manual'
|
||||
reverse_order='manual_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id}
|
||||
request_parameter_name='folder_order'
|
||||
label="{intl l='Position'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th class="actions">{intl l='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="folder_list" type="folder" visible="*" parent=$folder_id order=$folder_order backend_context="1" lang=$lang_id}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='admin/folder' folder_id=$ID}" title="{intl l='Browse this folder'}"><img class="img-thumbnail" src="{$IMAGE_URL}" alt="{$TITLE}" /></a>
|
||||
{/loop}
|
||||
</td>
|
||||
|
||||
<td class="object-title">
|
||||
<a href="{url path='admin/folder' folder_id=$ID}" title="{intl l='Browse this folder'}">
|
||||
{$TITLE}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
{module_include location='folder_list_row'}
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
|
||||
<div class="make-switch switch-small folderVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" class="folderVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="can_change"}
|
||||
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{admin_position_block
|
||||
permission="admin.folders.edit"
|
||||
path={url path='admin/folders/update-position' folder_id=$ID}
|
||||
url_parameter="folder_id"
|
||||
in_place_edit_class="folderPositionChange"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Browse this folder'}" href="{url path='admin/folder' folder_id=$ID}"><i class="glyphicon glyphicon-folder-open"></i></a>
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this folder'}" href="{url path='/admin/folders/update' folder_id=$ID}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.folders.delete"}
|
||||
<a class="btn btn-default btn-xs folder-delete" title="{intl l='Delete this folder and all its contents'}" href="#folder_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="folder_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="message">
|
||||
<div class="alert alert-info">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"}
|
||||
{intl l="This folder has no sub-folders. To create a new one, click the + button above."}
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="can_create"}
|
||||
{intl l="This folder has no sub-folders."}
|
||||
{/elseloop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
{/elseloop}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- CONTENT MANAGEMENT ---------------------------------------------------- *}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<table class="table table-striped table-condensed">
|
||||
<caption>
|
||||
{* display parent folder name *}
|
||||
{loop name="folder_title" type="folder" visible="*" id=$folder_id}
|
||||
{intl l="Contents in %fold" fold=$TITLE}
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="folder_title"}
|
||||
{intl l="Top level Contents"}
|
||||
{/elseloop}
|
||||
|
||||
{module_include location='content_list_caption'}
|
||||
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new content'}" href="#content_creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
</caption>
|
||||
|
||||
{ifloop rel="content_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$content_order
|
||||
order='id'
|
||||
reverse_order='id_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
||||
label="{intl l='ID'}"
|
||||
}
|
||||
|
||||
<th> </th>
|
||||
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$content_order
|
||||
order='alpha'
|
||||
reverse_order='alpha_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
||||
label="{intl l='Content title'}"
|
||||
}
|
||||
|
||||
{module_include location='content_list_header'}
|
||||
|
||||
<th>
|
||||
{admin_sortable_header
|
||||
current_order=$content_order
|
||||
order='visible'
|
||||
reverse_order='visible_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
||||
label="{intl l='Online'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{admin_sortable_header
|
||||
current_order=$content_order
|
||||
order='manual'
|
||||
reverse_order='manual_reverse'
|
||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
||||
label="{intl l='Position'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="content_list" type="content" visible="*" folder_default=$folder_id order=$content_order}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='admin/content/edit' id=$ID}" title="{intl l='Edit this content'}">
|
||||
<img src="{$IMAGE_URL}" alt="{$TITLE}" />
|
||||
</a>
|
||||
{/loop}
|
||||
|
||||
<td class="object-title"><a href="{url path="/admin/content/update/$ID"}" title="{intl l='Edit this content'}">{$TITLE}</a></td>
|
||||
|
||||
{module_include location='content_list_row'}
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.contents.edit"}
|
||||
<div class="make-switch switch-small contentVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" class="contentVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="can_change"}
|
||||
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{admin_position_block
|
||||
permission="admin.content.edit"
|
||||
path={url path='/admin/contents/update-position' content_id=$ID}
|
||||
url_parameter="content_id"
|
||||
in_place_edit_class="contentPositionChange"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.content.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this content'}" href="{url path="admin/content/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.content.delete"}
|
||||
<a class="btn btn-default btn-xs content-delete" title="{intl l='Delete this content'}" href="#content_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="content_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="message"><div class="alert alert-info">{intl l="This folder doesn't contains any contents. To add a new content, <strong>click the + button</strong> above."}</div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
{/elseloop}
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='folders_bottom'}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{* -- Adding a new folder ------------------------------------------------- *}
|
||||
|
||||
{form name="thelia.admin.folder.creation"}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "folder_creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/folders/update' folder_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='parent'}
|
||||
<input type="hidden" name="{$name}" value="{$folder_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Folder title'}" placeholder="{intl l='Name'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the folder name in the default language (%title)' title="$TITLE"}</div>
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='visible'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" checked="checked">
|
||||
{$label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{module_include location='folder_create_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "folder_creation_dialog"
|
||||
dialog_title = {intl l="Create a new folder"}
|
||||
dialog_body = {$smarty.capture.folder_creation_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create this folder"}
|
||||
|
||||
form_action = {url path='/admin/folders/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
{* -- Adding a new content -------------------------------------------------- *}
|
||||
|
||||
{form name="thelia.admin.content.creation"}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "content_creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{* Be sure to get the folder_id, even if the form could not be validated *}
|
||||
<input type="hidden" name="folder_id" value="{$folder_id}" />
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/contents/update' content_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='default_folder'}
|
||||
<input type="hidden" name="{$name}" value="{$folder_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Title'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the content name in the default language (%title)' title="$TITLE"}</div>
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='visible'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" checked="checked">
|
||||
{$label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{module_include location='content_create_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "content_creation_dialog"
|
||||
dialog_title = {intl l="Create a new content"}
|
||||
dialog_body = {$smarty.capture.content_creation_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create this content"}
|
||||
|
||||
form_action = {url path='/admin/contents/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
{* -- Delete folder confirmation dialog ----------------------------------- *}
|
||||
|
||||
{capture "folder_delete_dialog"}
|
||||
<input type="hidden" name="folder_id" id="folder_delete_id" value="" />
|
||||
|
||||
{module_include location='folder_delete_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "folder_delete_dialog"
|
||||
dialog_title = {intl l="Delete folder"}
|
||||
dialog_message = {intl l="Do you really want to delete this folder and all its content ?"}
|
||||
|
||||
form_action = {url path='/admin/folders/delete'}
|
||||
form_content = {$smarty.capture.folder_delete_dialog nofilter}
|
||||
}
|
||||
|
||||
{* -- Delete content confirmation dialog ------------------------------------ *}
|
||||
|
||||
{capture "content_delete_dialog"}
|
||||
<input type="hidden" name="content_id" id="content_delete_id" value="" />
|
||||
<input type="hidden" name="folder_id" value="{$folder_id}" />
|
||||
|
||||
{module_include location='content_delete_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "content_delete_dialog"
|
||||
dialog_title = {intl l="Delete content"}
|
||||
dialog_message = {intl l="Do you really want to delete this content ?"}
|
||||
|
||||
form_action = {url path='/admin/contents/delete'}
|
||||
form_content = {$smarty.capture.content_delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
// Set proper folder ID in delete from
|
||||
$('a.folder-delete').click(function(ev) {
|
||||
$('#folder_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
// Set proper content ID in delete from
|
||||
$('a.content-delete').click(function(ev) {
|
||||
$('#content_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "folder_creation_dialog"
|
||||
form_name = "thelia.admin.folder.creation"
|
||||
}
|
||||
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "content_creation_dialog"
|
||||
form_name = "thelia.admin.content.creation"
|
||||
}
|
||||
|
||||
{* Toggle object visibility *}
|
||||
|
||||
$(".folderVisibleToggle").on('switch-change', function(event, data) {
|
||||
$.ajax({
|
||||
url : "{url path='admin/folders/toggle-online'}",
|
||||
data : {
|
||||
folder_id : $(this).data('id'),
|
||||
action : 'visibilityToggle'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(".contentVisibleToggle").on('switch-change', function(event, data) {
|
||||
$.ajax({
|
||||
url : "{url path='admin/contents/toggle-online'}",
|
||||
data : {
|
||||
content_id : $(this).data('id'),
|
||||
action : 'visibilityToggle'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
|
||||
$('.folderPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new folder position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='/admin/folders/update-position' folder_id='__ID__' position='__POS__'}";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
$('.contentPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new content position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='/admin/contents/update-position' content_id='__ID__' position='__POS__'}";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
{* Change default status *}
|
||||
|
||||
$('.change-default').change(function(ev) {
|
||||
var url = "{url path='/admin/folders/set-default' folder_id='__ID__'}";
|
||||
|
||||
// Perform ID subtitutions
|
||||
url = url.replace('__ID__', $(this).val());
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
26
templates/admin/default/includes/folder-breadcrumb.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{* Breadcrumb for folders browsing and editing *}
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='admin/home'}">Home</a></li>
|
||||
<li><a href="{url path='admin/folders'}">Folders</a>
|
||||
|
||||
{ifloop rel="folder_path"}</li>
|
||||
{loop name="folder_path" type="folder-path" visible="*" folder=$folder_id}
|
||||
{if $ID == $folder_id}
|
||||
<li class="active">
|
||||
{if $editing_folder == true}
|
||||
{intl l='Editing %fold' fold="{$TITLE}"}
|
||||
{else}
|
||||
{$TITLE} <a href="{url path='/admin/folders/update' folder_id=$ID}" title="{intl l='Edit this folder'}">{intl l="(edit)"}</a>
|
||||
{/if}
|
||||
</li>
|
||||
{else}
|
||||
<li><a href="{url path='/admin/folders' folder_id=" $ID" action='browse'}">{$TITLE}</a></li>
|
||||
{/if}
|
||||
{/loop}
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="folder_path"}
|
||||
</li>
|
||||
{/elseloop}
|
||||
</ul>
|
||||
@@ -25,7 +25,7 @@
|
||||
<span class="label-help-block">{intl l="The détailed description."}</span>
|
||||
</label>
|
||||
|
||||
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control">{$value}</textarea>
|
||||
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{$value}</textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
|
||||
111
templates/admin/default/shipping-zones-edit.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Edit a shipping zone'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.configuration.shipping-zones.edit{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="shipping-zones edit-shipping-zones">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/shipping-zones'}">{intl l="Shipping zones"}</a></li>
|
||||
<li>{intl l='Editing shipping zone "%name"' name="{$TITLE}"}</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl l='Edit shipping zone %title' title=$TITLE}
|
||||
</div>
|
||||
|
||||
<div class="form-container clearfix">
|
||||
<div class="col-md-4">
|
||||
|
||||
<form method="POST" action="">
|
||||
<label class="control-label" for="">{intl l="Zones"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<select name="" id="" class="form-control">
|
||||
<option value="">1</option>
|
||||
<option value="">2</option>
|
||||
<option value="">3</option>
|
||||
<option value="">4</option>
|
||||
<option value="">5</option>
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-plus-sign"></span> {intl l="Add"}</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Zones"}</th>
|
||||
<th>{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>France</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this zone'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zone 1</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this zone'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zone 2</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this zone'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete related content confirmation dialog *}
|
||||
|
||||
{capture "delete_zone_dialog"}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_zone_dialog"
|
||||
dialog_title = {intl l="Remove zone"}
|
||||
dialog_message = {intl l="Do you really want to remove this zone ?"}
|
||||
|
||||
form_action = {url path=''}
|
||||
form_content = {$smarty.capture.delete_zone_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
119
templates/admin/default/shipping-zones.html
Normal file
@@ -0,0 +1,119 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Thelia Shipping zones'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.configuration.shipping-zones.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="shipping-zones">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/shipping-zones'}">{intl l="Shipping zones"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='shipping_zones_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption>
|
||||
{intl l='Thelia Shipping zones'}
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Name"}</th>
|
||||
|
||||
{module_include location='shipping_zones_table_header'}
|
||||
|
||||
<th>{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>So Colissimo</td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<a class="btn btn-default btn-xs shipping-zones-change" title="{intl l='Change this shipping zone'}" href="{url path="/admin/configuration/shipping-zones/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Chronopost</td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<a class="btn btn-default btn-xs shipping-zones-change" title="{intl l='Change this shipping zone'}" href="{url path="/admin/configuration/shipping-zones/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kiala</td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<a class="btn btn-default btn-xs shipping-zones-change" title="{intl l='Change this shipping zone'}" href="{url path="/admin/configuration/shipping-zones/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='shipping_zones_bottom'}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="shipping_zones_id" id="shipping_zones_delete_id" value="" />
|
||||
|
||||
{module_include location='shipping_zones_delete_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete shipping zone"}
|
||||
dialog_message = {intl l="Do you really want to delete this shipping zone ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/shipping-zones/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
@@ -267,14 +267,18 @@
|
||||
|
||||
{loop type="payment" name="payments" force_return="true"}
|
||||
|
||||
<li>
|
||||
<div class="radio">
|
||||
<label for="payment_<?php echo $key; ?>">
|
||||
<input type="radio" name="payment" id="payment_<?php echo $key; ?>" value="<?php echo $value; ?>">
|
||||
<img src="img/payment/<?php echo $value; ?>.png">
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
{loop type="image" name="paymentspicture" source="module" source_id=$ID force_return="true" width="100" height="72"}
|
||||
|
||||
<li>
|
||||
<div class="radio">
|
||||
<label for="payment_{$ID}">
|
||||
<input type="radio" name="payment" id="payment_{$ID}" value="test">
|
||||
<img src="{$IMAGE_URL}">
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{/loop}
|
||||
|
||||
{/loop}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
"title" : "Stats on September 2013",
|
||||
"series" : [
|
||||
{
|
||||
"datas" : [[0,10.00],[1,200.00],[2,5.00],[3,2.75],[4,20.30],[5,14.09]],
|
||||
"datas" : [[0,10.00],[1,200.00],[2,5.00],[3,2.75],[4,20.30],[5,14.09],[6,5],[7,23],[8,5],[9,42],[10,0],[11,4],[12,78],[13,75],[14,70],[15,65],[16,102],[17,50],[18,27],[19,35],[20,37],[21,29],[22,56],[23,52],[24,12],[25,6],[26,82],[27,32],[28,15],[29,50],[30,42]],
|
||||
"color" : "#adadad"
|
||||
},
|
||||
{
|
||||
"datas" : [[0,2],[1,5],[2,3],[3,10],[4,50],[5,55]],
|
||||
"datas" : [[0,2],[1,5],[2,5],[3,7],[4,8],[5,9],[6,5],[7,2],[8,5],[9,4],[10,0],[11,4],[12,7],[13,7],[14,7],[15,6],[16,1],[17,5],[18,2],[19,3],[20,3],[21,2],[22,5],[23,5],[24,1],[25,6],[26,8],[27,3],[28,1],[29,5],[30,4]],
|
||||
"color" : "#f39922"
|
||||
},
|
||||
{
|
||||
|
||||
175
web/tinymce/langs/de.js
Executable file
@@ -0,0 +1,175 @@
|
||||
tinymce.addI18n('de',{
|
||||
"Cut": "Ausschneiden",
|
||||
"Header 2": "\u00dcberschrift 2",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Ihr Browser unterst\u00fctzt leider keinen direkten Zugriff auf die Zwischenablage. Bitte benutzen Sie die Strg + X \/ C \/ V Tastenkombinationen.",
|
||||
"Div": "Textblock",
|
||||
"Paste": "Einf\u00fcgen",
|
||||
"Close": "Schlie\u00dfen",
|
||||
"Pre": "Vorformatierter Text",
|
||||
"Align right": "Rechtsb\u00fcndig ausrichten",
|
||||
"New document": "Neues Dokument",
|
||||
"Blockquote": "Zitat",
|
||||
"Numbered list": "Nummerierte Liste",
|
||||
"Increase indent": "Einzug vergr\u00f6\u00dfern",
|
||||
"Formats": "Formate",
|
||||
"Headers": "\u00dcberschriften",
|
||||
"Select all": "Alles ausw\u00e4hlen",
|
||||
"Header 3": "\u00dcberschrift 3",
|
||||
"Blocks": "Absatzformate",
|
||||
"Undo": "R\u00fcckg\u00e4ngig",
|
||||
"Strikethrough": "Durchgestrichen",
|
||||
"Bullet list": "Aufz\u00e4hlung",
|
||||
"Header 1": "\u00dcberschrift 1",
|
||||
"Superscript": "Hochgestellt",
|
||||
"Clear formatting": "Formatierung entfernen",
|
||||
"Subscript": "Tiefgestellt",
|
||||
"Header 6": "\u00dcberschrift 6",
|
||||
"Redo": "Wiederholen",
|
||||
"Paragraph": "Absatz",
|
||||
"Ok": "Ok",
|
||||
"Bold": "Fett",
|
||||
"Code": "Quelltext",
|
||||
"Italic": "Kursiv",
|
||||
"Align center": "Zentriert ausrichten",
|
||||
"Header 5": "\u00dcberschrift 5",
|
||||
"Decrease indent": "Einzug verkleinern",
|
||||
"Header 4": "\u00dcberschrift 4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Einf\u00fcgungen erfolgen bis zum Abschalten dieses Modus als unformatierter Text.",
|
||||
"Underline": "Unterstrichen",
|
||||
"Cancel": "Abbrechen",
|
||||
"Justify": "Blocksatz",
|
||||
"Inline": "Zeichenformate",
|
||||
"Copy": "Kopieren",
|
||||
"Align left": "Linksb\u00fcndig ausrichten",
|
||||
"Visual aids": "Visuelle Hilfen",
|
||||
"Lower Greek": "Griechische Kleinbuchstaben",
|
||||
"Square": "Quadrat",
|
||||
"Default": "Standard",
|
||||
"Lower Alpha": "Kleinbuchstaben",
|
||||
"Circle": "Kreis",
|
||||
"Disc": "Punkt",
|
||||
"Upper Alpha": "Gro\u00dfbuchstaben",
|
||||
"Upper Roman": "R\u00f6mische Zahlen (Gro\u00dfbuchstaben)",
|
||||
"Lower Roman": "R\u00f6mische Zahlen (Kleinbuchstaben)",
|
||||
"Name": "Name",
|
||||
"Anchor": "Textmarke",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "Die \u00c4nderungen wurden noch nicht gespeichert, sind Sie sicher, dass Sie diese Seite verlassen wollen?",
|
||||
"Restore last draft": "Zur\u00fcckholen den letzten Entwurf",
|
||||
"Special character": "Sonderzeichen",
|
||||
"Source code": "Quelltext",
|
||||
"Right to left": "Von rechts nach links",
|
||||
"Left to right": "Von links nach rechts",
|
||||
"Emoticons": "Emoticons",
|
||||
"Robots": "Robots",
|
||||
"Document properties": "Dokumenteigenschaften",
|
||||
"Title": "Titel",
|
||||
"Keywords": "Sch\u00fcsselw\u00f6rter",
|
||||
"Encoding": "Enkodieren",
|
||||
"Description": "Beschreibung",
|
||||
"Author": "Verfasser",
|
||||
"Fullscreen": "Vollbild",
|
||||
"Horizontal line": "Horizontale Linie",
|
||||
"Horizontal space": "Horizontaler Abstand",
|
||||
"Insert\/edit image": "Bild einf\u00fcgen\/bearbeiten",
|
||||
"General": "Allgemein",
|
||||
"Advanced": "Erweitert",
|
||||
"Source": "Quelle",
|
||||
"Border": "Rahmen",
|
||||
"Constrain proportions": "Seitenverh\u00e4ltnis beibehalten",
|
||||
"Vertical space": "Vertikaler Abstand",
|
||||
"Image description": "Bildbeschreibung",
|
||||
"Style": "Stil",
|
||||
"Dimensions": "Abmessungen",
|
||||
"Insert image": "Bild einf\u00fcgen",
|
||||
"Insert date\/time": "Datum\/Uhrzeit einf\u00fcgen ",
|
||||
"Remove link": "Link entfernen",
|
||||
"Url": "URL",
|
||||
"Text to display": "Anzuzeigender Text",
|
||||
"Anchors": "Textmarken",
|
||||
"Insert link": "Link einf\u00fcgen",
|
||||
"New window": "Neues Fenster",
|
||||
"None": "Keine",
|
||||
"Target": "Ziel",
|
||||
"Insert\/edit link": "Link einf\u00fcgen\/bearbeiten",
|
||||
"Insert\/edit video": "Video einf\u00fcgen\/bearbeiten",
|
||||
"Poster": "Poster",
|
||||
"Alternative source": "Alternative Quelle",
|
||||
"Paste your embed code below:": "F\u00fcgen Sie Ihren Einbettungscode hier ein:",
|
||||
"Insert video": "Video einf\u00fcgen",
|
||||
"Embed": "Einbetten",
|
||||
"Nonbreaking space": "Gesch\u00fctztes Leerzeichen",
|
||||
"Page break": "Seitenumbruch",
|
||||
"Paste as text": "Als Text einf\u00fcgen",
|
||||
"Preview": "Vorschau",
|
||||
"Print": "Drucken",
|
||||
"Save": "Speichern",
|
||||
"Could not find the specified string.": "Die Zeichenfolge wurde nicht gefunden.",
|
||||
"Replace": "Ersetzen",
|
||||
"Next": "Weiter",
|
||||
"Whole words": "Nur ganze W\u00f6rter",
|
||||
"Find and replace": "Suchen und ersetzen",
|
||||
"Replace with": "Ersetzen durch",
|
||||
"Find": "Suchen",
|
||||
"Replace all": "Alles ersetzen",
|
||||
"Match case": "Gro\u00df-\/Kleinschreibung beachten",
|
||||
"Prev": "Zur\u00fcck",
|
||||
"Spellcheck": "Rechtschreibpr\u00fcfung",
|
||||
"Finish": "Ende",
|
||||
"Ignore all": "Alles Ignorieren",
|
||||
"Ignore": "Ignorieren",
|
||||
"Insert row before": "Neue Zeile davor einf\u00fcgen ",
|
||||
"Rows": "Zeilen",
|
||||
"Height": "H\u00f6he",
|
||||
"Paste row after": "Zeile danach einf\u00fcgen",
|
||||
"Alignment": "Ausrichtung",
|
||||
"Column group": "Spaltengruppe",
|
||||
"Row": "Zeile",
|
||||
"Insert column before": "Neue Spalte davor einf\u00fcgen",
|
||||
"Split cell": "Zelle aufteilen",
|
||||
"Cell padding": "Zelleninnenabstand",
|
||||
"Cell spacing": "Zellenabstand",
|
||||
"Row type": "Zeilentyp",
|
||||
"Insert table": "Tabelle einf\u00fcgen",
|
||||
"Body": "Inhalt",
|
||||
"Caption": "Beschriftung",
|
||||
"Footer": "Fu\u00dfzeile",
|
||||
"Delete row": "Zeile l\u00f6schen",
|
||||
"Paste row before": "Zeile davor einf\u00fcgen",
|
||||
"Scope": "G\u00fcltigkeitsbereich",
|
||||
"Delete table": "Tabelle l\u00f6schen",
|
||||
"Header cell": "Kopfzelle",
|
||||
"Column": "Spalte",
|
||||
"Cell": "Zelle",
|
||||
"Header": "Kopfzeile",
|
||||
"Cell type": "Zellentyp",
|
||||
"Copy row": "Zeile kopieren",
|
||||
"Row properties": "Zeileneigenschaften",
|
||||
"Table properties": "Tabelleneigenschaften",
|
||||
"Row group": "Zeilengruppe",
|
||||
"Right": "Rechtsb\u00fcndig",
|
||||
"Insert column after": "Neue Spalte danach einf\u00fcgen",
|
||||
"Cols": "Spalten",
|
||||
"Insert row after": "Neue Zeile danach einf\u00fcgen",
|
||||
"Width": "Breite",
|
||||
"Cell properties": "Zelleneigenschaften",
|
||||
"Left": "Linksb\u00fcndig",
|
||||
"Cut row": "Zeile ausschneiden",
|
||||
"Delete column": "Spalte l\u00f6schen",
|
||||
"Center": "Zentriert",
|
||||
"Merge cells": "Zellen verbinden",
|
||||
"Insert template": "Vorlage einf\u00fcgen ",
|
||||
"Templates": "Vorlagen",
|
||||
"Background color": "Hintergrundfarbe",
|
||||
"Text color": "Textfarbe",
|
||||
"Show blocks": " Bl\u00f6cke anzeigen",
|
||||
"Show invisible characters": "Unsichtbare Zeichen anzeigen",
|
||||
"Words: {0}": "W\u00f6rter: {0}",
|
||||
"Insert": "Einf\u00fcgen",
|
||||
"File": "Datei",
|
||||
"Edit": "Bearbeiten",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich-Text- Area. Dr\u00fccken Sie ALT-F9 f\u00fcr das Men\u00fc. Dr\u00fccken Sie ALT-F10 f\u00fcr Symbolleiste. Dr\u00fccken Sie ALT-0 f\u00fcr Hilfe",
|
||||
"Tools": "Werkzeuge",
|
||||
"View": "Ansicht",
|
||||
"Table": "Tabelle",
|
||||
"Format": "Format"
|
||||
});
|
||||
175
web/tinymce/langs/es.js
Executable file
@@ -0,0 +1,175 @@
|
||||
tinymce.addI18n('es',{
|
||||
"Cut": "Cortar",
|
||||
"Header 2": "Header 2 ",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Tu navegador no soporta acceso directo al portapapeles. Por favor usa las teclas Crtl+X\/C\/V de tu teclado",
|
||||
"Div": "Capa",
|
||||
"Paste": "Pegar",
|
||||
"Close": "Cerrar",
|
||||
"Pre": "Pre",
|
||||
"Align right": "Alinear a la derecha",
|
||||
"New document": "Nuevo documento",
|
||||
"Blockquote": "Bloque de cita",
|
||||
"Numbered list": "Lista numerada",
|
||||
"Increase indent": "Incrementar sangr\u00eda",
|
||||
"Formats": "Formatos",
|
||||
"Headers": "Headers",
|
||||
"Select all": "Seleccionar todo",
|
||||
"Header 3": "Header 3",
|
||||
"Blocks": "Bloques",
|
||||
"Undo": "Deshacer",
|
||||
"Strikethrough": "Tachado",
|
||||
"Bullet list": "Lista de vi\u00f1etas",
|
||||
"Header 1": "Header 1",
|
||||
"Superscript": "Super\u00edndice",
|
||||
"Clear formatting": "Limpiar formato",
|
||||
"Subscript": "Sub\u00edndice",
|
||||
"Header 6": "Header 6",
|
||||
"Redo": "Rehacer",
|
||||
"Paragraph": "P\u00e1rrafo",
|
||||
"Ok": "Ok",
|
||||
"Bold": "Negrita",
|
||||
"Code": "C\u00f3digo",
|
||||
"Italic": "It\u00e1lica",
|
||||
"Align center": "Alinear al centro",
|
||||
"Header 5": "Header 5 ",
|
||||
"Decrease indent": "Disminuir sangr\u00eda",
|
||||
"Header 4": "Header 4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Pegar est\u00e1 ahora en modo de texto plano. El contenido se pegar\u00e1 como texto plano hasta que desactive esta opci\u00f3n.",
|
||||
"Underline": "Subrayado",
|
||||
"Cancel": "Cancelar",
|
||||
"Justify": "Justificar",
|
||||
"Inline": "en l\u00ednea",
|
||||
"Copy": "Copiar",
|
||||
"Align left": "Alinear a la izquierda",
|
||||
"Visual aids": "Ayudas visuales",
|
||||
"Lower Greek": "Inferior Griega",
|
||||
"Square": "Cuadrado",
|
||||
"Default": "Por defecto",
|
||||
"Lower Alpha": "Inferior Alfa",
|
||||
"Circle": "C\u00edrculo",
|
||||
"Disc": "Disco",
|
||||
"Upper Alpha": "Superior Alfa",
|
||||
"Upper Roman": "Superior Romana",
|
||||
"Lower Roman": "Inferior Romana",
|
||||
"Name": "Nombre",
|
||||
"Anchor": "Ancla",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "Tiene cambios sin guardar. \u00bfEst\u00e1 seguro de que quiere salir fuera?",
|
||||
"Restore last draft": "Restaurar el \u00faltimo borrador",
|
||||
"Special character": "Car\u00e1cter especial",
|
||||
"Source code": "C\u00f3digo fuente",
|
||||
"Right to left": "De derecha a izquierda",
|
||||
"Left to right": "De izquierda a derecha",
|
||||
"Emoticons": "Emoticonos",
|
||||
"Robots": "Robots",
|
||||
"Document properties": "Propiedades del documento",
|
||||
"Title": "T\u00edtulo",
|
||||
"Keywords": "Palabras clave",
|
||||
"Encoding": "Codificaci\u00f3n",
|
||||
"Description": "Descripci\u00f3n",
|
||||
"Author": "Autor",
|
||||
"Fullscreen": "Pantalla completa",
|
||||
"Horizontal line": "L\u00ednea horizontal",
|
||||
"Horizontal space": "Espacio horizontal",
|
||||
"Insert\/edit image": "Insertar\/editar imagen",
|
||||
"General": "General",
|
||||
"Advanced": "Avanzado",
|
||||
"Source": "Origen",
|
||||
"Border": "Borde",
|
||||
"Constrain proportions": "Restringir proporciones",
|
||||
"Vertical space": "Espacio vertical",
|
||||
"Image description": "Descripci\u00f3n de la imagen",
|
||||
"Style": "Estilo",
|
||||
"Dimensions": "Dimensiones",
|
||||
"Insert image": "Insertar imagen",
|
||||
"Insert date\/time": "Insertar fecha\/hora",
|
||||
"Remove link": "Quitar enlace",
|
||||
"Url": "Url",
|
||||
"Text to display": "Texto para mostrar",
|
||||
"Anchors": "Anclas",
|
||||
"Insert link": "Insertar enlace",
|
||||
"New window": "Nueva ventana",
|
||||
"None": "Ninguno",
|
||||
"Target": "Destino",
|
||||
"Insert\/edit link": "Insertar\/editar enlace",
|
||||
"Insert\/edit video": "Insertar\/editar video",
|
||||
"Poster": "Miniatura",
|
||||
"Alternative source": "Fuente alternativa",
|
||||
"Paste your embed code below:": "Pega tu c\u00f3digo embebido debajo",
|
||||
"Insert video": "Insertar video",
|
||||
"Embed": "Incrustado",
|
||||
"Nonbreaking space": "Espacio fijo",
|
||||
"Page break": "Salto de p\u00e1gina",
|
||||
"Paste as text": "Pegar como texto",
|
||||
"Preview": "Previsualizar",
|
||||
"Print": "Imprimir",
|
||||
"Save": "Guardar",
|
||||
"Could not find the specified string.": "No se encuentra la cadena de texto especificada",
|
||||
"Replace": "Reemplazar",
|
||||
"Next": "Siguiente",
|
||||
"Whole words": "Palabras completas",
|
||||
"Find and replace": "Buscar y reemplazar",
|
||||
"Replace with": "Reemplazar con",
|
||||
"Find": "Buscar",
|
||||
"Replace all": "Reemplazar todo",
|
||||
"Match case": "Coincidencia exacta",
|
||||
"Prev": "Anterior",
|
||||
"Spellcheck": "Corrector ortogr\u00e1fico",
|
||||
"Finish": "Finalizar",
|
||||
"Ignore all": "Ignorar todos",
|
||||
"Ignore": "Ignorar",
|
||||
"Insert row before": "Insertar fila antes",
|
||||
"Rows": "Filas",
|
||||
"Height": "Alto",
|
||||
"Paste row after": "Pegar la fila despu\u00e9s",
|
||||
"Alignment": "Alineaci\u00f3n",
|
||||
"Column group": "Grupo de columnas",
|
||||
"Row": "Fila",
|
||||
"Insert column before": "Insertar columna antes",
|
||||
"Split cell": "Dividir celdas",
|
||||
"Cell padding": "Relleno de celda",
|
||||
"Cell spacing": "Espacio entre celdas",
|
||||
"Row type": "Tipo de fila",
|
||||
"Insert table": "Insertar tabla",
|
||||
"Body": "Cuerpo",
|
||||
"Caption": "Subt\u00edtulo",
|
||||
"Footer": "Pie de p\u00e1gina",
|
||||
"Delete row": "Eliminar fila",
|
||||
"Paste row before": "Pegar la fila antes",
|
||||
"Scope": "\u00c1mbito",
|
||||
"Delete table": "Eliminar tabla",
|
||||
"Header cell": "Celda de la cebecera",
|
||||
"Column": "Columna",
|
||||
"Cell": "Celda",
|
||||
"Header": "Cabecera",
|
||||
"Cell type": "Tipo de celda",
|
||||
"Copy row": "Copiar fila",
|
||||
"Row properties": "Propiedades de la fila",
|
||||
"Table properties": "Propiedades de la tabla",
|
||||
"Row group": "Grupo de filas",
|
||||
"Right": "Derecha",
|
||||
"Insert column after": "Insertar columna despu\u00e9s",
|
||||
"Cols": "Columnas",
|
||||
"Insert row after": "Insertar fila despu\u00e9s ",
|
||||
"Width": "Ancho",
|
||||
"Cell properties": "Propiedades de la celda",
|
||||
"Left": "Izquierda",
|
||||
"Cut row": "Cortar fila",
|
||||
"Delete column": "Eliminar columna",
|
||||
"Center": "Centrado",
|
||||
"Merge cells": "Combinar celdas",
|
||||
"Insert template": "Insertar plantilla",
|
||||
"Templates": "Plantillas",
|
||||
"Background color": "Color de fondo",
|
||||
"Text color": "Color del texto",
|
||||
"Show blocks": "Mostrar bloques",
|
||||
"Show invisible characters": "Mostrar caracteres invisibles",
|
||||
"Words: {0}": "Palabras: {0}",
|
||||
"Insert": "Insertar",
|
||||
"File": "Archivo",
|
||||
"Edit": "Editar",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u00c1rea de texto enriquecido. Pulse ALT-F9 para el menu. Pulse ALT-F10 para la barra de herramientas. Pulse ALT-0 para ayuda",
|
||||
"Tools": "Herramientas",
|
||||
"View": "Ver",
|
||||
"Table": "Tabla",
|
||||
"Format": "Formato"
|
||||
});
|
||||
175
web/tinymce/langs/fr_FR.js
Executable file
@@ -0,0 +1,175 @@
|
||||
tinymce.addI18n('fr_FR',{
|
||||
"Cut": "Couper",
|
||||
"Header 2": "En-t\u00eate 2",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Votre navigateur ne supporte pas la copie directe. Merci d'utiliser les touches Ctrl+X\/C\/V.",
|
||||
"Div": "Div",
|
||||
"Paste": "Coller",
|
||||
"Close": "Fermer",
|
||||
"Pre": "Pre",
|
||||
"Align right": "Aligner \u00e0 droite",
|
||||
"New document": "Nouveau document",
|
||||
"Blockquote": "Citation",
|
||||
"Numbered list": "Num\u00e9rotation",
|
||||
"Increase indent": "Augmenter le retrait",
|
||||
"Formats": "Formats",
|
||||
"Headers": "En-t\u00eates",
|
||||
"Select all": "Tout s\u00e9lectionner",
|
||||
"Header 3": "En-t\u00eate 3",
|
||||
"Blocks": "Blocs",
|
||||
"Undo": "Annuler",
|
||||
"Strikethrough": "Barr\u00e9",
|
||||
"Bullet list": "Puces",
|
||||
"Header 1": "En-t\u00eate 1",
|
||||
"Superscript": "Exposant",
|
||||
"Clear formatting": "Effacer la mise en forme",
|
||||
"Subscript": "Indice",
|
||||
"Header 6": "En-t\u00eate 6",
|
||||
"Redo": "R\u00e9tablir",
|
||||
"Paragraph": "Paragraphe",
|
||||
"Ok": "Ok",
|
||||
"Bold": "Gras",
|
||||
"Code": "Code",
|
||||
"Italic": "Italique",
|
||||
"Align center": "Aligner au centre",
|
||||
"Header 5": "En-t\u00eate 5",
|
||||
"Decrease indent": "Diminuer le retrait",
|
||||
"Header 4": "En-t\u00eate 4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Le presse-papiers est maintenant en mode \"texte plein\". Les contenus seront coll\u00e9s sans retenir les formatages jusqu'\u00e0 ce que vous d\u00e9sactiviez cette option.",
|
||||
"Underline": "Soulign\u00e9",
|
||||
"Cancel": "Annuler",
|
||||
"Justify": "Justifi\u00e9",
|
||||
"Inline": "en place",
|
||||
"Copy": "Copier",
|
||||
"Align left": "Aligner \u00e0 gauche",
|
||||
"Visual aids": "Aides visuelle",
|
||||
"Lower Greek": "Grec minuscule",
|
||||
"Square": "Carr\u00e9",
|
||||
"Default": "Par d\u00e9faut",
|
||||
"Lower Alpha": "Alpha inf\u00e9rieure",
|
||||
"Circle": "Cercle",
|
||||
"Disc": "Disque",
|
||||
"Upper Alpha": "Alpha majuscule",
|
||||
"Upper Roman": "Romain majuscule",
|
||||
"Lower Roman": "Romain minuscule",
|
||||
"Name": "Nom",
|
||||
"Anchor": "Ancre",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "Vous avez des modifications non enregistr\u00e9es, \u00eates-vous s\u00fbr de quitter la page?",
|
||||
"Restore last draft": "Restaurer le dernier brouillon",
|
||||
"Special character": "Caract\u00e8res sp\u00e9ciaux",
|
||||
"Source code": "Code source",
|
||||
"Right to left": "Droite \u00e0 gauche",
|
||||
"Left to right": "Gauche \u00e0 droite",
|
||||
"Emoticons": "Emotic\u00f4nes",
|
||||
"Robots": "Robots",
|
||||
"Document properties": "Propri\u00e9t\u00e9 du document",
|
||||
"Title": "Titre",
|
||||
"Keywords": "Mots-cl\u00e9s",
|
||||
"Encoding": "Encodage",
|
||||
"Description": "Description",
|
||||
"Author": "Auteur",
|
||||
"Fullscreen": "Plein \u00e9cran",
|
||||
"Horizontal line": "Ligne horizontale",
|
||||
"Horizontal space": "Espacement horizontal",
|
||||
"Insert\/edit image": "Ins\u00e9rer\/\u00e9diter une image",
|
||||
"General": "G\u00e9n\u00e9ral",
|
||||
"Advanced": "Avanc\u00e9",
|
||||
"Source": "Source",
|
||||
"Border": "Bordure",
|
||||
"Constrain proportions": "Contraindre les proportions",
|
||||
"Vertical space": "Espacement vertical",
|
||||
"Image description": "Description de l'image",
|
||||
"Style": "Style",
|
||||
"Dimensions": "Dimensions",
|
||||
"Insert image": "Ins\u00e9rer une image",
|
||||
"Insert date\/time": "Ins\u00e9rer date\/heure",
|
||||
"Remove link": "Enlever le lien",
|
||||
"Url": "Url",
|
||||
"Text to display": "Texte \u00e0 afficher",
|
||||
"Anchors": "Ancre",
|
||||
"Insert link": "Ins\u00e9rer un lien",
|
||||
"New window": "Nouvelle fen\u00eatre",
|
||||
"None": "n\/a",
|
||||
"Target": "Cible",
|
||||
"Insert\/edit link": "Ins\u00e9rer\/\u00e9diter un lien",
|
||||
"Insert\/edit video": "Ins\u00e9rer\/\u00e9diter une vid\u00e9o",
|
||||
"Poster": "Afficher",
|
||||
"Alternative source": "Source alternative",
|
||||
"Paste your embed code below:": "Collez votre code d'int\u00e9gration ci-dessous :",
|
||||
"Insert video": "Ins\u00e9rer une vid\u00e9o",
|
||||
"Embed": "Int\u00e9grer",
|
||||
"Nonbreaking space": "Espace ins\u00e9cable",
|
||||
"Page break": "Saut de page",
|
||||
"Paste as text": "Coller comme texte",
|
||||
"Preview": "Pr\u00e9visualiser",
|
||||
"Print": "Imprimer",
|
||||
"Save": "Enregistrer",
|
||||
"Could not find the specified string.": "Impossible de trouver la cha\u00eene sp\u00e9cifi\u00e9e.",
|
||||
"Replace": "Remplacer",
|
||||
"Next": "Suiv",
|
||||
"Whole words": "Mots entiers",
|
||||
"Find and replace": "Trouver et remplacer",
|
||||
"Replace with": "Remplacer par",
|
||||
"Find": "Chercher",
|
||||
"Replace all": "Tout remplacer",
|
||||
"Match case": "Respecter la casse",
|
||||
"Prev": "Pr\u00e9c ",
|
||||
"Spellcheck": "V\u00e9rification orthographique",
|
||||
"Finish": "Finie",
|
||||
"Ignore all": "Tout ignorer",
|
||||
"Ignore": "Ignorer",
|
||||
"Insert row before": "Ins\u00e9rer une ligne avant",
|
||||
"Rows": "Lignes",
|
||||
"Height": "Hauteur",
|
||||
"Paste row after": "Coller la ligne apr\u00e8s",
|
||||
"Alignment": "Alignement",
|
||||
"Column group": "Groupe de colonnes",
|
||||
"Row": "Ligne",
|
||||
"Insert column before": "Ins\u00e9rer une colonne avant",
|
||||
"Split cell": "Diviser la cellule",
|
||||
"Cell padding": "Espacement interne cellule",
|
||||
"Cell spacing": "Espacement inter-cellulles",
|
||||
"Row type": "Type de ligne",
|
||||
"Insert table": "Ins\u00e9rer un tableau",
|
||||
"Body": "Corps",
|
||||
"Caption": "Titre",
|
||||
"Footer": "Pied",
|
||||
"Delete row": "Effacer la ligne",
|
||||
"Paste row before": "Coller la ligne avant",
|
||||
"Scope": "Etendue",
|
||||
"Delete table": "Supprimer le tableau",
|
||||
"Header cell": "Cellule d'en-t\u00eate",
|
||||
"Column": "Colonne",
|
||||
"Cell": "Cellule",
|
||||
"Header": "En-t\u00eate",
|
||||
"Cell type": "Type de cellule",
|
||||
"Copy row": "Copier la ligne",
|
||||
"Row properties": "Propri\u00e9t\u00e9s de la ligne",
|
||||
"Table properties": "Propri\u00e9t\u00e9s du tableau",
|
||||
"Row group": "Groupe de lignes",
|
||||
"Right": "Droite",
|
||||
"Insert column after": "Ins\u00e9rer une colonne apr\u00e8s",
|
||||
"Cols": "Colonnes",
|
||||
"Insert row after": "Ins\u00e9rer une ligne apr\u00e8s",
|
||||
"Width": "Largeur",
|
||||
"Cell properties": "Propri\u00e9t\u00e9s de la cellule",
|
||||
"Left": "Gauche",
|
||||
"Cut row": "Couper la ligne",
|
||||
"Delete column": "Effacer la colonne",
|
||||
"Center": "Centr\u00e9",
|
||||
"Merge cells": "Fusionner les cellules",
|
||||
"Insert template": "Ajouter un th\u00e8me",
|
||||
"Templates": "Th\u00e8mes",
|
||||
"Background color": "Couleur d'arri\u00e8re-plan",
|
||||
"Text color": "Couleur du texte",
|
||||
"Show blocks": "Afficher les blocs",
|
||||
"Show invisible characters": "Afficher les caract\u00e8res invisibles",
|
||||
"Words: {0}": "Mots : {0}",
|
||||
"Insert": "Ins\u00e9rer",
|
||||
"File": "Fichier",
|
||||
"Edit": "Editer",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.",
|
||||
"Tools": "Outils",
|
||||
"View": "Voir",
|
||||
"Table": "Tableau",
|
||||
"Format": "Format"
|
||||
});
|
||||
174
web/tinymce/langs/it.js
Executable file
@@ -0,0 +1,174 @@
|
||||
tinymce.addI18n('it',{
|
||||
"Cut": "Taglia",
|
||||
"Header 2": "Header 2",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Il tuo browser non supporta l'accesso diretto negli Appunti. Per favore usa i tasti di scelta rapida Ctrl+X\/C\/V.",
|
||||
"Div": "Div",
|
||||
"Paste": "Incolla",
|
||||
"Close": "Chiudi",
|
||||
"Pre": "Pre",
|
||||
"Align right": "Allinea a Destra",
|
||||
"New document": "Nuovo Documento",
|
||||
"Blockquote": "Blockquote",
|
||||
"Numbered list": "Elenchi Numerati",
|
||||
"Increase indent": "Aumenta Rientro",
|
||||
"Formats": "Formattazioni",
|
||||
"Headers": "Intestazioni",
|
||||
"Select all": "Seleziona Tutto",
|
||||
"Header 3": "Intestazione 3",
|
||||
"Blocks": "Blocchi",
|
||||
"Undo": "Indietro",
|
||||
"Strikethrough": "Barrato",
|
||||
"Bullet list": "Elenchi Puntati",
|
||||
"Header 1": "Intestazione 1",
|
||||
"Superscript": "Apice",
|
||||
"Clear formatting": "Cancella Formattazione",
|
||||
"Subscript": "Pedice",
|
||||
"Header 6": "Intestazione 6",
|
||||
"Redo": "Ripeti",
|
||||
"Paragraph": "Paragrafo",
|
||||
"Ok": "Ok",
|
||||
"Bold": "Grassetto",
|
||||
"Code": "Codice",
|
||||
"Italic": "Corsivo",
|
||||
"Align center": "Allinea al Cento",
|
||||
"Header 5": "Intestazione 5",
|
||||
"Decrease indent": "Riduci Rientro",
|
||||
"Header 4": "Intestazione 4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Incolla \u00e8 in modalit\u00e0 testo normale. I contenuti sono incollati come testo normale se non disattivi l'opzione.",
|
||||
"Underline": "Sottolineato",
|
||||
"Cancel": "Cancella",
|
||||
"Justify": "Giustifica",
|
||||
"Inline": "Inlinea",
|
||||
"Copy": "Copia",
|
||||
"Align left": "Allinea a Sinistra",
|
||||
"Visual aids": "Elementi Visivi",
|
||||
"Lower Greek": "Greek Minore",
|
||||
"Square": "Quadrato",
|
||||
"Default": "Default",
|
||||
"Lower Alpha": "Alpha Minore",
|
||||
"Circle": "Cerchio",
|
||||
"Disc": "Disco",
|
||||
"Upper Alpha": "Alpha Superiore",
|
||||
"Upper Roman": "Roman Superiore",
|
||||
"Lower Roman": "Roman Minore",
|
||||
"Name": "Nome",
|
||||
"Anchor": "Fissa",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "Non hai salvato delle modifiche, sei sicuro di andartene?",
|
||||
"Restore last draft": "Ripristina l'ultima bozza.",
|
||||
"Special character": "Carattere Speciale",
|
||||
"Source code": "Codice Sorgente",
|
||||
"Right to left": "Da Destra a Sinistra",
|
||||
"Left to right": "Da Sinistra a Destra",
|
||||
"Emoticons": "Emoction",
|
||||
"Robots": "Robot",
|
||||
"Document properties": "Propriet\u00e0 Documento",
|
||||
"Title": "Titolo",
|
||||
"Keywords": "Parola Chiave",
|
||||
"Encoding": "Codifica",
|
||||
"Description": "Descrizione",
|
||||
"Author": "Autore",
|
||||
"Fullscreen": "Schermo Intero",
|
||||
"Horizontal line": "Linea Orizzontale",
|
||||
"Horizontal space": "Spazio Orizzontale",
|
||||
"Insert\/edit image": "Aggiungi\/Modifica Immagine",
|
||||
"General": "Generale",
|
||||
"Advanced": "Avanzato",
|
||||
"Source": "Fonte",
|
||||
"Border": "Bordo",
|
||||
"Constrain proportions": "Mantieni Proporzioni",
|
||||
"Vertical space": "Spazio Verticale",
|
||||
"Image description": "Descrizione Immagine",
|
||||
"Style": "Stile",
|
||||
"Dimensions": "Dimenzioni",
|
||||
"Insert image": "Inserisci immagine",
|
||||
"Insert date\/time": "Inserisci Data\/Ora",
|
||||
"Remove link": "Rimuovi link",
|
||||
"Url": "Url",
|
||||
"Text to display": "Testo da Visualizzare",
|
||||
"Anchors": "Anchors",
|
||||
"Insert link": "Inserisci il Link",
|
||||
"New window": "Nuova Finestra",
|
||||
"None": "No",
|
||||
"Target": "Target",
|
||||
"Insert\/edit link": "Inserisci\/Modifica Link",
|
||||
"Insert\/edit video": "Inserisci\/Modifica Video",
|
||||
"Poster": "Anteprima",
|
||||
"Alternative source": "Alternativo",
|
||||
"Paste your embed code below:": "Incolla il codice d'incorporamento qui:",
|
||||
"Insert video": "Inserisci Video",
|
||||
"Embed": "Incorporare",
|
||||
"Nonbreaking space": "Spazio unificatore",
|
||||
"Paste as text": "incolla come testo",
|
||||
"Preview": "Anteprima",
|
||||
"Print": "Stampa",
|
||||
"Save": "Salva",
|
||||
"Could not find the specified string.": "Impossibile trovare la parola specifica.",
|
||||
"Replace": "Sostituisci",
|
||||
"Next": "Successivo",
|
||||
"Whole words": "Parole Sbagliate",
|
||||
"Find and replace": "Trova e Sostituisci",
|
||||
"Replace with": "Sostituisci Con",
|
||||
"Find": "Trova",
|
||||
"Replace all": "Sostituisci Tutto",
|
||||
"Match case": "Maiuscole\/Minuscole ",
|
||||
"Prev": "Precedente",
|
||||
"Spellcheck": "Controllo ortografico",
|
||||
"Finish": "Termina",
|
||||
"Ignore all": "Ignora Tutto",
|
||||
"Ignore": "Ignora",
|
||||
"Insert row before": "Inserisci una Riga Prima",
|
||||
"Rows": "Righe",
|
||||
"Height": "Altezza",
|
||||
"Paste row after": "Incolla una Riga Dopo",
|
||||
"Alignment": "Allineamento",
|
||||
"Column group": "Gruppo di Colonne",
|
||||
"Row": "Riga",
|
||||
"Insert column before": "Inserisci una Colonna Prima",
|
||||
"Split cell": "Dividi Cella",
|
||||
"Cell padding": "Padding della Cella",
|
||||
"Cell spacing": "Spaziatura della Cella",
|
||||
"Row type": "Tipo di Riga",
|
||||
"Insert table": "Inserisci Tabella",
|
||||
"Body": "Body",
|
||||
"Caption": "Didascalia",
|
||||
"Footer": "Footer",
|
||||
"Delete row": "Cancella Riga",
|
||||
"Paste row before": "Incolla una Riga Prima",
|
||||
"Scope": "Campo",
|
||||
"Delete table": "Cancella Tabella",
|
||||
"Header cell": "cella d'intestazione",
|
||||
"Column": "Colonna",
|
||||
"Cell": "Cella",
|
||||
"Header": "Header",
|
||||
"Cell type": "Tipo di Cella",
|
||||
"Copy row": "Copia Riga",
|
||||
"Row properties": "Propriet\u00e0 della Riga",
|
||||
"Table properties": "Propiet\u00e0 della Tabella",
|
||||
"Row group": "Gruppo di Righe",
|
||||
"Right": "Destra",
|
||||
"Insert column after": "Inserisci una Colonna Dopo",
|
||||
"Cols": "Colonne",
|
||||
"Insert row after": "Inserisci una Riga Dopo",
|
||||
"Width": "Larghezza",
|
||||
"Cell properties": "Propiet\u00e0 della Cella",
|
||||
"Left": "Sinistra",
|
||||
"Cut row": "Taglia Riga",
|
||||
"Delete column": "Cancella Colonna",
|
||||
"Center": "Centro",
|
||||
"Merge cells": "Unisci Cella",
|
||||
"Insert template": "Inserisci Template",
|
||||
"Templates": "Template",
|
||||
"Background color": "Colore Background",
|
||||
"Text color": "Colore Testo",
|
||||
"Show blocks": "Mostra Blocchi",
|
||||
"Show invisible characters": "Mostra Caratteri Invisibili",
|
||||
"Words: {0}": "Parole: {0}",
|
||||
"Insert": "Inserisci",
|
||||
"File": "File",
|
||||
"Edit": "Modifica",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Premi ALT-F9 per il men\u00f9. Premi ALT-F10 per la barra degli strumenti. Premi ALT-0 per l'aiuto.",
|
||||
"Tools": "Strumenti",
|
||||
"View": "Visualiza",
|
||||
"Table": "Tabella",
|
||||
"Format": "Formato"
|
||||
});
|
||||
504
web/tinymce/license.txt
Executable file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
1
web/tinymce/plugins/advlist/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("advlist",function(t){function e(t,e){var n=[];return tinymce.each(e.split(/[ ,]/),function(t){n.push({text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"==t?"":t})}),n}function n(e,n){var i,r=t.dom,a=t.selection;i=r.getParent(a.getNode(),"ol,ul"),i&&i.nodeName==e&&n!==!1||t.execCommand("UL"==e?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?o[e]:n,o[e]=n,i=r.getParent(a.getNode(),"ol,ul"),i&&(r.setStyle(i,"listStyleType",n),i.removeAttribute("data-mce-style")),t.focus()}function i(e){var n=t.dom.getStyle(t.dom.getParent(t.selection.getNode(),"ol,ul"),"listStyleType")||"";e.control.items().each(function(t){t.active(t.settings.data===n)})}var r,a,o={};r=e("OL",t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),a=e("UL",t.getParam("advlist_bullet_styles","default,circle,disc,square")),t.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:r,onshow:i,onselect:function(t){n("OL",t.control.settings.data)},onclick:function(){n("OL",!1)}}),t.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:a,onshow:i,onselect:function(t){n("UL",t.control.settings.data)},onclick:function(){n("UL",!1)}})});
|
||||
1
web/tinymce/plugins/anchor/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("anchor",function(e){function t(){var t=e.selection.getNode();e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:t.name||t.id},onsubmit:function(t){e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t.data.name}))}})}e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:t,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:t})});
|
||||
1
web/tinymce/plugins/autolink/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("autolink",function(t){function e(t){o(t,-1,"(",!0)}function n(t){o(t,0,"",!0)}function i(t){o(t,-1,"",!1)}function o(t,e,n){var i,o,r,a,s,l,c,u,d;if(i=t.selection.getRng(!0).cloneRange(),i.startOffset<5){if(u=i.endContainer.previousSibling,!u){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;u=i.endContainer.firstChild.nextSibling}if(d=u.length,i.setStart(u,d),i.setEnd(u,d),i.endOffset<5)return;o=i.endOffset,a=u}else{if(a=i.endContainer,3!=a.nodeType&&a.firstChild){for(;3!=a.nodeType&&a.firstChild;)a=a.firstChild;3==a.nodeType&&(i.setStart(a,0),i.setEnd(a,a.nodeValue.length))}o=1==i.endOffset?2:i.endOffset-1-e}r=o;do i.setStart(a,o>=2?o-2:0),i.setEnd(a,o>=1?o-1:0),o-=1;while(" "!=i.toString()&&""!==i.toString()&&160!=i.toString().charCodeAt(0)&&o-2>=0&&i.toString()!=n);if(i.toString()==n||160==i.toString().charCodeAt(0)?(i.setStart(a,o),i.setEnd(a,r),o+=1):0===i.startOffset?(i.setStart(a,0),i.setEnd(a,r)):(i.setStart(a,o),i.setEnd(a,r)),l=i.toString(),"."==l.charAt(l.length-1)&&i.setEnd(a,r-1),l=i.toString(),c=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),c&&("www."==c[1]?c[1]="http://www.":/@$/.test(c[1])&&!/^mailto:/.test(c[1])&&(c[1]="mailto:"+c[1]),s=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,c[1]+c[2]),t.selection.moveToBookmark(s),t.nodeChanged(),tinymce.Env.webkit)){t.selection.collapse(!1);var m=Math.min(a.length,r+1);i.setStart(a,m),i.setEnd(a,m),t.selection.setRng(i)}}t.on("keydown",function(e){return 13==e.keyCode?i(t):void 0}),tinymce.Env.ie||(t.on("keypress",function(n){return 41==n.which?e(t):void 0}),t.on("keyup",function(e){return 32==e.keyCode?n(t):void 0}))});
|
||||
1
web/tinymce/plugins/autoresize/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("autoresize",function(e){function t(a){var r,o,c=e.getDoc(),s=c.body,u=c.documentElement,l=tinymce.DOM,m=n.autoresize_min_height;"setcontent"==a.type&&a.initial||e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()||(o=tinymce.Env.ie?s.scrollHeight:tinymce.Env.webkit&&0===s.clientHeight?0:s.offsetHeight,o>n.autoresize_min_height&&(m=o),n.autoresize_max_height&&o>n.autoresize_max_height?(m=n.autoresize_max_height,s.style.overflowY="auto",u.style.overflowY="auto"):(s.style.overflowY="hidden",u.style.overflowY="hidden",s.scrollTop=0),m!==i&&(r=m-i,l.setStyle(l.get(e.id+"_ifr"),"height",m+"px"),i=m,tinymce.isWebKit&&0>r&&t(a)))}var n=e.settings,i=0;e.settings.inline||(n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){e.dom.setStyle(e.getBody(),"paddingBottom",e.getParam("autoresize_bottom_margin",50)+"px")}),e.on("change setcontent paste keyup",t),e.getParam("autoresize_on_init",!0)&&e.on("load",t),e.addCommand("mceAutoResize",t))});
|
||||
1
web/tinymce/plugins/autosave/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(f.getItem(h+"autosave.time"),10)||0;return(new Date).getTime()-e>d.autosave_retention?(i(!1),!1):!0}function i(t){f.removeItem(h+"autosave.draft"),f.removeItem(h+"autosave.time"),t!==!1&&e.fire("RemoveDraft")}function a(){c()||(f.setItem(h+"autosave.draft",e.getContent({format:"raw",no_events:!0})),f.setItem(h+"autosave.time",(new Date).getTime()),e.fire("StoreDraft"))}function r(){n()&&(e.setContent(f.getItem(h+"autosave.draft"),{format:"raw"}),e.fire("RestoreDraft"))}function o(){m||(setInterval(function(){e.removed||a()},d.autosave_interval),m=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),o()}function l(){e.undoManager.beforeChange(),r(),i(),e.undoManager.add()}function u(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e}function c(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+">(( | |[ ]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(t)}var m,d=e.settings,f=tinymce.util.LocalStorage,h=e.id;d.autosave_interval=t(d.autosave_interval,"30s"),d.autosave_retention=t(d.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&r()}),e.on("saveContent",function(){i()})),window.onbeforeunload=u,this.hasDraft=n,this.storeDraft=a,this.restoreDraft=r,this.removeDraft=i,this.isEmpty=c});
|
||||
1
web/tinymce/plugins/bbcode/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/<font>(.*?)<\/font>/gi,"$1"),t(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),t(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),t(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),t(/<u>/gi,"[u]"),t(/<blockquote[^>]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/<br \/>/gi,"\n"),t(/<br\/>/gi,"\n"),t(/<br>/gi,"\n"),t(/<p>/gi,""),t(/<\/p>/gi,"\n"),t(/ |\u00a0/gi," "),t(/"/gi,'"'),t(/</gi,"<"),t(/>/gi,">"),t(/&/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"<br />"),t(/\[b\]/gi,"<strong>"),t(/\[\/b\]/gi,"</strong>"),t(/\[i\]/gi,"<em>"),t(/\[\/i\]/gi,"</em>"),t(/\[u\]/gi,"<u>"),t(/\[\/u\]/gi,"</u>"),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),t(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),t(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),t(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();
|
||||
1
web/tinymce/plugins/charmap/plugin.min.js
vendored
Executable file
1
web/tinymce/plugins/code/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("code",function(e){function o(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),value:e.getContent({source_view:!0}),spellcheck:!1},onSubmit:function(o){e.undoManager.transact(function(){e.setContent(o.data.code)}),e.nodeChanged()}})}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})});
|
||||
1
web/tinymce/plugins/contextmenu/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("contextmenu",function(e){var t;e.on("contextmenu",function(n){var i;if(n.preventDefault(),i=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var o=[];tinymce.each(i.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",o.push(n))});for(var a=0;a<o.length;a++)"|"==o[a].text&&(0===a||a==o.length-1)&&o.splice(a,1);t=new tinymce.ui.Menu({items:o,context:"contextmenu"}),t.renderTo(document.body)}var r={x:n.pageX,y:n.pageY};e.inline||(r=tinymce.DOM.getPos(e.getContentAreaContainer()),r.x+=n.clientX,r.y+=n.clientY),t.moveTo(r.x,r.y),e.on("remove",function(){t.remove(),t=null})})});
|
||||
1
web/tinymce/plugins/directionality/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("directionality",function(e){function t(t){var n,i=e.dom,a=e.selection.getSelectedBlocks();a.length&&(n=i.getAttrib(a[0],"dir"),tinymce.each(a,function(e){i.getParent(e.parentNode,"*[dir='"+t+"']",i.getRoot())||(n!=t?i.setAttrib(e,"dir",t):i.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})});
|
||||
BIN
web/tinymce/plugins/emoticons/img/smiley-cool.gif
Executable file
|
After Width: | Height: | Size: 354 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-cry.gif
Executable file
|
After Width: | Height: | Size: 329 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-embarassed.gif
Executable file
|
After Width: | Height: | Size: 331 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif
Executable file
|
After Width: | Height: | Size: 342 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-frown.gif
Executable file
|
After Width: | Height: | Size: 340 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-innocent.gif
Executable file
|
After Width: | Height: | Size: 336 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-kiss.gif
Executable file
|
After Width: | Height: | Size: 338 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-laughing.gif
Executable file
|
After Width: | Height: | Size: 343 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-money-mouth.gif
Executable file
|
After Width: | Height: | Size: 321 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-sealed.gif
Executable file
|
After Width: | Height: | Size: 323 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-smile.gif
Executable file
|
After Width: | Height: | Size: 344 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-surprised.gif
Executable file
|
After Width: | Height: | Size: 338 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-tongue-out.gif
Executable file
|
After Width: | Height: | Size: 328 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-undecided.gif
Executable file
|
After Width: | Height: | Size: 337 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-wink.gif
Executable file
|
After Width: | Height: | Size: 350 B |
BIN
web/tinymce/plugins/emoticons/img/smiley-yell.gif
Executable file
|
After Width: | Height: | Size: 336 B |
1
web/tinymce/plugins/emoticons/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='<table role="presentation" class="mce-grid">',tinymce.each(i,function(n){e+="<tr>",tinymce.each(n,function(n){var i=t+"/img/smiley-"+n+".gif";e+='<td><a href="#" data-mce-url="'+i+'" tabindex="-1"><img src="'+i+'" style="width: 18px; height: 18px"></a></td>'}),e+="</tr>"}),e+="</table>"}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent('<img src="'+n.getAttribute("data-mce-url")+'" />'),this.hide())}},tooltip:"Emoticons"})});
|
||||
1
web/tinymce/plugins/example/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("example",function(t){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:"http://www.tinymce.com",width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})}})});
|
||||
1
web/tinymce/plugins/example_dependency/plugin.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
tinymce.PluginManager.add("example_dependency",function(){},["example"]);
|
||||