Merge remote-tracking branch 'upstream/master' into typo
Conflicts: templates/backOffice/default/I18n/fr_FR.php
This commit is contained in:
@@ -42,6 +42,10 @@ abstract class BaseModuleGenerate extends ContainerAwareCommand
|
||||
'Config',
|
||||
'Model',
|
||||
'Loop',
|
||||
'Command',
|
||||
'Controller',
|
||||
'EventListeners',
|
||||
'I18n',
|
||||
'AdminIncludes',
|
||||
'templates',
|
||||
);
|
||||
|
||||
@@ -88,6 +88,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate
|
||||
try {
|
||||
$skeletonDir = str_replace("/", DIRECTORY_SEPARATOR, THELIA_ROOT . "/core/lib/Thelia/Command/Skeleton/Module/");
|
||||
|
||||
// config.xml file
|
||||
$fs->copy($skeletonDir . "config.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.xml");
|
||||
|
||||
$moduleContent = file_get_contents($skeletonDir . "module.xml");
|
||||
@@ -97,6 +98,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate
|
||||
|
||||
file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "module.xml", $moduleContent);
|
||||
|
||||
// PHP Class template
|
||||
$classContent = file_get_contents($skeletonDir . "Class.php.template");
|
||||
|
||||
$classContent = str_replace("%%CLASSNAME%%", $this->module, $classContent);
|
||||
@@ -104,11 +106,31 @@ class ModuleGenerateCommand extends BaseModuleGenerate
|
||||
|
||||
file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . $this->module.".php", $classContent);
|
||||
|
||||
// schema.xml file
|
||||
$schemaContent = file_get_contents($skeletonDir . "schema.xml");
|
||||
|
||||
$schemaContent = str_replace("%%NAMESPACE%%", $this->module, $schemaContent);
|
||||
|
||||
file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "schema.xml", $schemaContent);
|
||||
|
||||
// routing.xml file
|
||||
$routingContent = file_get_contents($skeletonDir . "routing.xml");
|
||||
|
||||
$routingContent = str_replace("%%NAMESPACE%%", $this->module, $routingContent);
|
||||
$routingContent = str_replace("%%CLASSNAME_LOWER%%", strtolower($this->module), $routingContent);
|
||||
|
||||
file_put_contents($this->moduleDirectory . DIRECTORY_SEPARATOR . "Config". DIRECTORY_SEPARATOR . "routing.xml", $routingContent);
|
||||
|
||||
// I18n sample files
|
||||
$fs->copy(
|
||||
$skeletonDir . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "fr_FR.php",
|
||||
$this->moduleDirectory . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "fr_FR.php"
|
||||
);
|
||||
|
||||
$fs->copy(
|
||||
$skeletonDir . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "en_US.php",
|
||||
$this->moduleDirectory . DIRECTORY_SEPARATOR . "I18n" . DIRECTORY_SEPARATOR . "en_US.php"
|
||||
);
|
||||
} catch (\Exception $ex) {
|
||||
$fs->remove($this->moduleDirectory);
|
||||
|
||||
|
||||
4
core/lib/Thelia/Command/Skeleton/Module/I18n/en_US.php
Normal file
4
core/lib/Thelia/Command/Skeleton/Module/I18n/en_US.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
// 'an english string' => 'The displayed english string',
|
||||
);
|
||||
4
core/lib/Thelia/Command/Skeleton/Module/I18n/fr_FR.php
Normal file
4
core/lib/Thelia/Command/Skeleton/Module/I18n/fr_FR.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
// 'an english string' => 'La traduction française de la chaine',
|
||||
);
|
||||
31
core/lib/Thelia/Command/Skeleton/Module/routing.xml
Normal file
31
core/lib/Thelia/Command/Skeleton/Module/routing.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<!--
|
||||
|
||||
if a /admin/module/%%CLASSNAME_LOWER%%/ route is provided, a "Configuration" button will be displayed
|
||||
for the module in the module list. Clicking this button will invoke this route.
|
||||
|
||||
<route id="my_route_id" path="/admin/module/%%CLASSNAME_LOWER%%">
|
||||
<default key="_controller">%%NAMESPACE%%\Full\Class\Name\Of\YourConfigurationController::methodName</default>
|
||||
</route>
|
||||
|
||||
<route id="my_route_id" path="/admin/module/%%CLASSNAME_LOWER%%/route-name">
|
||||
<default key="_controller">%%NAMESPACE%%\Full\Class\Name\Of\YourAdminController::methodName</default>
|
||||
</route>
|
||||
|
||||
<route id="my_route_id" path="/my/route/name">
|
||||
<default key="_controller">%%NAMESPACE%%\Full\Class\Name\Of\YourOtherController::methodName</default>
|
||||
</route>
|
||||
|
||||
...add as many routes as required.
|
||||
|
||||
<route>
|
||||
...
|
||||
</route>
|
||||
-->
|
||||
|
||||
</routes>
|
||||
@@ -335,6 +335,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$error_msg = $ex->getMessage();
|
||||
}
|
||||
|
||||
if (false !== $error_msg) {
|
||||
$this->setupFormErrorContext(
|
||||
$this->getTranslator()->trans("%obj creation", array('%obj' => $this->objectName)),
|
||||
$error_msg,
|
||||
@@ -345,6 +346,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
// At this point, the form has error, and should be redisplayed.
|
||||
return $this->renderList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a object for modification, and display the edit template.
|
||||
@@ -435,6 +437,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$error_msg = $ex->getMessage();*/
|
||||
}
|
||||
|
||||
if (false !== $error_msg) {
|
||||
// At this point, the form has errors, and should be redisplayed.
|
||||
$this->setupFormErrorContext(
|
||||
$this->getTranslator()->trans("%obj modification", array('%obj' => $this->objectName)),
|
||||
@@ -445,6 +448,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
|
||||
return $this->renderEditionTemplate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update object position (only for objects whichsupport that)
|
||||
|
||||
@@ -222,6 +222,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
|
||||
$this->getParserContext()->addForm($changeForm);
|
||||
}
|
||||
|
||||
if (false !== $error_msg) {
|
||||
$this->setupFormErrorContext(
|
||||
$this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)),
|
||||
$error_msg,
|
||||
@@ -232,4 +233,5 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
|
||||
// At this point, the form has errors, and should be redisplayed.
|
||||
return $this->renderEditionTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class HomeController extends BaseAdminController
|
||||
|
||||
$data = new \stdClass();
|
||||
|
||||
$data->title = "Stats on " . $this->getRequest()->query->get('month', date('m')) . "/" . $this->getRequest()->query->get('year', date('Y'));
|
||||
$data->title = $this->getTranslator()->trans("Stats on %month/%year", array('%month' => $this->getRequest()->query->get('month', date('m')), '%year' => $this->getRequest()->query->get('year', date('Y'))));
|
||||
|
||||
/* sales */
|
||||
$saleSeries = new \stdClass();
|
||||
|
||||
@@ -753,6 +753,7 @@ return array(
|
||||
'Sorry, variable ID=%id was not found.' => 'Sorry, variable ID=%id was not found.',
|
||||
'Source IP' => 'Source IP',
|
||||
'Source IP :' => 'Source IP :',
|
||||
'Stats on %month/%year' => 'Stats on %month/%year',
|
||||
'Status' => 'Status',
|
||||
'Stock' => 'Stock',
|
||||
'Store' => 'Store',
|
||||
|
||||
Reference in New Issue
Block a user