track admin ârt
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -11,3 +11,7 @@ bin/*
|
||||
local/session/*
|
||||
coverage
|
||||
.idea
|
||||
.buildpath
|
||||
.project
|
||||
.settings/
|
||||
local/cache/*
|
||||
|
||||
54
core/lib/Thelia/Admin/Controller/BaseAdminController.php
Normal file
54
core/lib/Thelia/Admin/Controller/BaseAdminController.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Admin\Template;
|
||||
|
||||
/**
|
||||
*
|
||||
* The defaut administration controller. Basically, display the login form if
|
||||
* user is not yet logged in, or back-office home page if the user is logged in.
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*/
|
||||
|
||||
class BaseAdminController
|
||||
{
|
||||
protected function render($templateName, $args = array()) {
|
||||
|
||||
$tpl = new Template();
|
||||
|
||||
$data = $tpl->render($templateName, $args);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
echo "called";
|
||||
|
||||
return $this->render('login');
|
||||
}
|
||||
}
|
||||
?>
|
||||
95
core/lib/Thelia/Admin/Template.class.php
Normal file
95
core/lib/Thelia/Admin/Template.class.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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(THELIA_TEMPLATE_DIR . 'admin/');
|
||||
$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}
|
||||
*/
|
||||
|
||||
try {
|
||||
return $this->smarty->fetch($realTemplateName);
|
||||
} catch (\SmartyException $e) {
|
||||
throw RuntimeException::createFromPrevious($e, $templateName);
|
||||
} catch (\ErrorException $e) {
|
||||
throw RuntimeException::createFromPrevious($e, $templateName);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
core/lib/Thelia/Admin/templates/admin/.htaccess
Normal file
2
core/lib/Thelia/Admin/templates/admin/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
order deny,allow
|
||||
deny from all
|
||||
1109
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap-responsive.css
vendored
Normal file
1109
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap-responsive.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap-responsive.min.css
vendored
Normal file
9
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap-responsive.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6167
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap.css
vendored
Normal file
6167
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap.min.css
vendored
Normal file
9
core/lib/Thelia/Admin/templates/admin/bootstrap/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
2280
core/lib/Thelia/Admin/templates/admin/bootstrap/js/bootstrap.js
vendored
Normal file
2280
core/lib/Thelia/Admin/templates/admin/bootstrap/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
core/lib/Thelia/Admin/templates/admin/bootstrap/js/bootstrap.min.js
vendored
Normal file
6
core/lib/Thelia/Admin/templates/admin/bootstrap/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
0
core/lib/Thelia/Admin/templates/admin/home.tpl
Normal file
0
core/lib/Thelia/Admin/templates/admin/home.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
{* 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>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!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/templates/admin/js/jquery.js
vendored
Normal file
6
core/lib/Thelia/Admin/templates/admin/js/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
core/lib/Thelia/Admin/templates/admin/login.tpl
Normal file
1
core/lib/Thelia/Admin/templates/admin/login.tpl
Normal file
@@ -0,0 +1 @@
|
||||
Hio, I'm the default template.
|
||||
10
core/lib/Thelia/Config/Resources/routing/admin.xml
Normal file
10
core/lib/Thelia/Config/Resources/routing/admin.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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">
|
||||
|
||||
<route id="admin" path="/admin">
|
||||
<default key="_controller">\Thelia\Admin\Controller\BaseAdminController::indexAction</default>
|
||||
</route>
|
||||
</routes>
|
||||
0
local/cache/.gitkeep
vendored
Normal file
0
local/cache/.gitkeep
vendored
Normal file
Reference in New Issue
Block a user