Removed AdminSmartyParser, to use directly SmartyParser

This commit is contained in:
franck
2013-06-19 11:52:55 +02:00
parent f32daae118
commit 9e95f034ec
6 changed files with 56 additions and 76 deletions

View File

@@ -37,15 +37,23 @@ use Symfony\Component\DependencyInjection\ContainerAware;
* @author Franck Allimant <franck@cqfdev.fr>
*/
class BaseAdminController extends ContainerAware
class BaseAdminController
{
protected function render($templateName, $args = array()) {
protected $parser;
$parser = $this->container->get('thelia.admin.parser');
public function __construct($parser) {
$this->parser = $parser;
// FIXME: should be red from config
$this->parser->setTemplate('admin/default');
}
protected function render($templateName, $args = array()) {
$args = array('lang' => 'fr');
return $parser->render($templateName, $args);
return $this->parser->render($templateName, $args);
}
public function indexAction()

View File

@@ -1,46 +0,0 @@
<?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\Admin\Template;
use Thelia\Core\Template\SmartyParser;
use Symfony\Component\DependencyInjection\ContainerInterface;
// smarty configuration
class AdminSmartyParser extends SmartyParser
{
public function __construct(ContainerInterface $container, $template = false)
{
$this->template = $template == false ? 'admin/default' : $template;
parent::__construct($container, $template);
}
public function render($realTemplateName, $parameters) {
$this->assign($parameters);
return $this->fetch($realTemplateName);
}
}
?>