Intégration de Assetic
This commit is contained in:
@@ -28,7 +28,9 @@
|
|||||||
"symfony/security": "2.2.*",
|
"symfony/security": "2.2.*",
|
||||||
"symfony/templating": "2.2.*",
|
"symfony/templating": "2.2.*",
|
||||||
|
|
||||||
"smarty/smarty": "v3.1.13"
|
"smarty/smarty": "v3.1.13",
|
||||||
|
"kriswallsmith/assetic": "1.2.*@dev",
|
||||||
|
"leafo/lessphp": "0.3.*@dev"
|
||||||
},
|
},
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"fzaninotto/faker": "dev-master"
|
"fzaninotto/faker": "dev-master"
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ define('THELIA_ROOT' , rtrim(realpath(__DIR__ .'/../'),'/') . "/");
|
|||||||
define('THELIA_LOCAL_DIR' , THELIA_ROOT . '/local/');
|
define('THELIA_LOCAL_DIR' , THELIA_ROOT . '/local/');
|
||||||
define('THELIA_CONF_DIR' , THELIA_LOCAL_DIR . 'config/');
|
define('THELIA_CONF_DIR' , THELIA_LOCAL_DIR . 'config/');
|
||||||
define('THELIA_MODULE_DIR' , THELIA_LOCAL_DIR . 'modules/');
|
define('THELIA_MODULE_DIR' , THELIA_LOCAL_DIR . 'modules/');
|
||||||
define('THELIA_TEMPLATE_DIR' , THELIA_ROOT . '/web/templates/');
|
define('THELIA_WEB_DIR' , THELIA_ROOT . '/web/');
|
||||||
|
define('THELIA_TEMPLATE_DIR' , THELIA_ROOT . '/templates/');
|
||||||
|
|
||||||
$loader = require __DIR__ . "/vendor/autoload.php";
|
$loader = require __DIR__ . "/vendor/autoload.php";
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
namespace Thelia\Admin\Controller;
|
namespace Thelia\Admin\Controller;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Thelia\Admin\Template;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Thelia\Admin\Templating\Template;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -46,9 +47,11 @@ class BaseAdminController
|
|||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
echo "called";
|
$rep = new Response();
|
||||||
|
|
||||||
return $this->render('login');
|
$rep->setContent($this->render('login'));
|
||||||
|
|
||||||
|
return $rep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,89 +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;
|
|
||||||
|
|
||||||
use \Smarty;
|
|
||||||
|
|
||||||
// smarty configuration
|
|
||||||
class Template extends Smarty
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
$compile_dir = THELIA_LOCAL_DIR . 'cache/smarty/compile';
|
|
||||||
if (! is_dir($compile_dir)) @mkdir($compile_dir, 0777, true);
|
|
||||||
|
|
||||||
$cache_dir = THELIA_LOCAL_DIR . 'cache/smarty/cache';
|
|
||||||
if (! is_dir($cache_dir)) @mkdir($cache_dir, 0777, true);
|
|
||||||
|
|
||||||
$this->setTemplateDir(__DIR__.'/template/');
|
|
||||||
$this->setCompileDir($compile_dir);
|
|
||||||
$this->setCacheDir($cache_dir);
|
|
||||||
|
|
||||||
/*
|
|
||||||
$this->setConfigDir(GUESTBOOK_DIR . 'configs');
|
|
||||||
$this->setCacheDir(GUESTBOOK_DIR . 'cache');
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
function render($templateName, $parameters) {
|
|
||||||
|
|
||||||
$realTemplateName = $templateName . '.tpl';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Assign variables/objects to the templates.
|
|
||||||
*
|
|
||||||
* Description
|
|
||||||
* void assign(mixed var);
|
|
||||||
* void assign(string varname, mixed var, bool nocache);
|
|
||||||
*
|
|
||||||
* You can explicitly pass name/value pairs, or associative arrays
|
|
||||||
* containing the name/value pairs.
|
|
||||||
*
|
|
||||||
* If you pass the optional third nocache parameter of TRUE, the
|
|
||||||
* variable is assigned as nocache variable. See {@link http://www.smarty.net/docs/en/caching.cacheable.tpl#cacheability.variables} for details.
|
|
||||||
*
|
|
||||||
* Too learn more see {@link http://www.smarty.net/docs/en/api.assign.tpl}
|
|
||||||
*/
|
|
||||||
$this->smarty->assign($parameters);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This returns the template output instead of displaying it. Supply a
|
|
||||||
* valid template resource type and path. As an optional second
|
|
||||||
* parameter, you can pass a $cache id, see the caching section for more
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* As an optional third parameter, you can pass a $compile_id. This is
|
|
||||||
* in the event that you want to compile different versions of the same
|
|
||||||
* template, such as having separate templates compiled for different
|
|
||||||
* languages. You can also set the $compile_id variable once instead of
|
|
||||||
* passing this to each call to this function.
|
|
||||||
*
|
|
||||||
* Too learn more see {@link http://www.smarty.net/docs/en/api.fetch.tpl}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return $this->smarty->fetch($realTemplateName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
order deny,allow
|
|
||||||
deny from all
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
2280
core/lib/Thelia/Admin/template/bootstrap/js/bootstrap.js
vendored
2280
core/lib/Thelia/Admin/template/bootstrap/js/bootstrap.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,6 +0,0 @@
|
|||||||
{* Include required JS files *}
|
|
||||||
<script src="http://code.jquery.com/jquery.js"></script>
|
|
||||||
<script src="bootstrap/js/bootstrap.min.js"></script>
|
|
||||||
{* TODO allow modules to include JS here *}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="{$lang}">
|
|
||||||
<head>
|
|
||||||
<title>{$page_title}</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
|
|
||||||
{* TODO allow modules to include CSS here *}
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
6
core/lib/Thelia/Admin/template/js/jquery.js
vendored
6
core/lib/Thelia/Admin/template/js/jquery.js
vendored
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
Hio, I'm the default template.
|
|
||||||
@@ -56,12 +56,10 @@
|
|||||||
<call method="setContext">
|
<call method="setContext">
|
||||||
<argument type="service" id="request.context"/>
|
<argument type="service" id="request.context"/>
|
||||||
</call>
|
</call>
|
||||||
<!--
|
|
||||||
<call method="add">
|
<call method="add">
|
||||||
<argument type="service" id="router.default_route"/>
|
<argument type="service" id="router.default_route"/>
|
||||||
<argument>-255</argument>
|
<argument>-255</argument>
|
||||||
</call>
|
</call>
|
||||||
-->
|
|
||||||
<call method="add">
|
<call method="add">
|
||||||
<argument type="service" id="router.admin"/>
|
<argument type="service" id="router.admin"/>
|
||||||
<argument>0</argument>
|
<argument>0</argument>
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ $response = $thelia->handle($request)->prepare($request)->send();
|
|||||||
|
|
||||||
$thelia->terminate($request, $response);
|
$thelia->terminate($request, $response);
|
||||||
|
|
||||||
echo "page parsed in : " . (microtime(true) - $thelia->getStartTime());
|
echo "<!-- page parsed in : " . (microtime(true) - $thelia->getStartTime())." s. -->";
|
||||||
Reference in New Issue
Block a user