This commit is contained in:
Franck Allimant
2013-11-13 16:31:03 +01:00
403 changed files with 641 additions and 925 deletions

View File

@@ -40,13 +40,13 @@ use Symfony\Component\Filesystem\Exception\IOException;
*/
class AsseticAssetManager implements AssetManagerInterface
{
protected $developmentMode;
protected $debugMode;
protected $source_file_extensions = array('less', 'js', 'coffee', 'html', 'tpl', 'htm', 'xml');
public function __construct($developmentMode)
public function __construct($debugMode)
{
$this->developmentMode = $developmentMode;
$this->debugMode = $debugMode;
}
/**
@@ -336,7 +336,7 @@ class AsseticAssetManager implements AssetManagerInterface
Tlog::getInstance()->addDebug("Asset destination full path: $asset_destination_path");
// We generate an asset only if it does not exists, or if the asset processing is forced in development mode
if (! file_exists($asset_destination_path) || ($this->developmentMode && ConfigQuery::read('process_assets', true)) ) {
if (! file_exists($asset_destination_path) || ($this->debugMode && ConfigQuery::read('process_assets', true)) ) {
$writer = new AssetWriter($output_directory);

View File

@@ -33,6 +33,8 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\LangQuery;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Type\TypeCollection;
use Thelia\Type;
/**
* Language loop, to get a list of available languages
@@ -56,7 +58,14 @@ class Lang extends BaseLoop implements PropelSearchLoopInterface
return new ArgumentCollection(
Argument::createIntTypeArgument('id', null),
Argument::createIntListTypeArgument('exclude'),
Argument::createBooleanTypeArgument('default_only', false)
Argument::createBooleanTypeArgument('default_only', false),
new Argument(
'order',
new TypeCollection(
new Type\EnumListType(array('id', 'id_reverse', 'alpha', 'alpha_reverse', 'position', 'position_reverse'))
),
'position'
)
);
}
@@ -79,6 +88,30 @@ class Lang extends BaseLoop implements PropelSearchLoopInterface
}
$search->orderByPosition(Criteria::ASC);
$orders = $this->getOrder();
foreach ($orders as $order) {
switch ($order) {
case "id":
$search->orderById(Criteria::ASC);
break;
case "id_reverse":
$search->orderById(Criteria::DESC);
break;
case "alpha":
$search->orderByTitle(Criteria::ASC);
break;
case "alpha_reverse":
$search->orderByTitle(Criteria::DESC);
break;
case "position":
$search->orderByPosition(Criteria::ASC);
break;
case "position_reverse":
$search->orderByPosition(Criteria::DESC);
break;
}
}
return $search;

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/
namespace Thelia\Core\Template;
use Thelia\Model\ConfigQuery;
class TemplateDefinition
{
@@ -30,7 +29,8 @@ class TemplateDefinition
const BACK_OFFICE = 2;
const PDF = 3;
const BACK_OFFICE_SUBDIR = 'admin/';
const FRONT_OFFICE_SUBDIR = 'frontOffice/';
const BACK_OFFICE_SUBDIR = 'backOffice/';
const PDF_SUBDIR = 'pdf/';
/**
@@ -58,6 +58,8 @@ class TemplateDefinition
$this->path = self::BACK_OFFICE_SUBDIR . $name;
else if ($type == self::PDF)
$this->path = self::PDF_SUBDIR . $name;
else if ($type == self::FRONT_OFFICE)
$this->path = self::FRONT_OFFICE_SUBDIR . $name;
else
$this->path = $name;
}

View File

@@ -78,7 +78,7 @@ class TemplateHelper
$baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::PDF_SUBDIR;
}
else {
$baseDir = THELIA_TEMPLATE_DIR;
$baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::FRONT_OFFICE_SUBDIR;
$exclude = array(TemplateDefinition::BACK_OFFICE_SUBDIR, TemplateDefinition::PDF_SUBDIR);
}