* some changes

* moved some admin html code from php to twig templates (.html files)
* minimum PHP version required by installer is now 5.1.2, cause of spl_autoload_register functon.
* depracated Twig to version 1.20.0 cause of Autoloader
* removed unused admin stylish template
This commit is contained in:
slawkens 2017-08-28 10:02:49 +02:00
parent 603c2175e3
commit 15961f0c17
418 changed files with 15624 additions and 4322 deletions

View File

@ -1,281 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dashboard - Admin Template</title>
<link rel="stylesheet" type="text/css" href="css/theme2.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script>
var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
<h2>My eCommerce Admin area</h2>
<div id="topmenu">
<ul>
<li class="current"><a href="index.html">Dashboard</a></li>
<li><a href="#">Orders</a></li>
<li><a href="users.html">Users</a></li>
<li><a href="#">Manage</a></li>
<li><a href="#">CMS</a></li>
<li><a href="#">Statistics</a></li>
<li><a href="#">Settings</a></li>
</ul>
</div>
</div>
<div id="top-panel">
<div id="panel">
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
<li><a href="#" class="feed">RSS Feed</a></li>
</ul>
</div>
</div>
<div id="wrapper">
<div id="content">
<div id="rightnow">
<h3 class="reallynow">
<span>Right Now</span>
<a href="#" class="add">Add New Product</a>
<a href="#" class="app_add">Some Action</a>
<br />
</h3>
<p class="youhave">You have <a href="#">19 new orders</a>, <a href="#">12 new users</a> and <a href="#">5 new reviews</a>, today you made <a href="#">$1523.63 in sales</a> and a total of <strong>$328.24 profit </strong>
</p>
</div>
<div id="infowrap">
<div id="infobox">
<h3>Sales for July</h3>
<p><img src="img/graph.jpg" width="360" height="266" /></p>
</div>
<div id="infobox" class="margin-left">
<h3>Traffic for July</h3>
<p><img src="img/graph2.jpg" alt="a" width="359" height="266" /></p>
</div>
<div id="infobox">
<h3>Last 5 Orders</h3>
<table>
<thead>
<tr>
<th>Customer</th>
<th>Items</th>
<th>Grand Total</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td>1</td>
<td>14.95 €</td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td>2</td>
<td>34.27 €</td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td>2</td>
<td>61.39 €</td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td>5</td>
<td>1472.56 €</td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td>1</td>
<td>9.95 €</td>
</tr>
</tbody>
</table>
</div>
<div id="infobox" class="margin-left">
<h3>Bestsellers</h3>
<table>
<thead>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>Orders</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Apple iPhone 3G 8GB</a></td>
<td>199.00 €</td>
<td>24</td>
</tr>
<tr>
<td><a href="#">Fuji FinePix S5800</a></td>
<td>365.24 €</td>
<td>19</td>
</tr>
<tr>
<td><a href="#">Canon PIXMA MP140</a></td>
<td>59.50 €</td>
<td>12</td>
</tr>
<tr>
<td><a href="#">Apple iPhone 3G 16GB</a></td>
<td>199.00 €</td>
<td>10</td>
</tr>
<tr>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td>499.00 €</td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
<div id="infobox">
<h3>New Customers</h3>
<table>
<thead>
<tr>
<th>Customer</th>
<th>Orders</th>
<th>Average</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td>1</td>
<td>5.6€</td>
<td>14.95 €</td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td>2</td>
<td>14.97€</td>
<td>34.27 €</td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td>2</td>
<td>15.31€</td>
<td>61.39 €</td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td>5</td>
<td>502.61€</td>
<td>1472.56 €</td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td>1</td>
<td>5.1€</td>
<td>9.95 €</td>
</tr>
</tbody>
</table>
</div>
<div id="infobox" class="margin-left">
<h3>Last 5 Reviews</h3>
<table>
<thead>
<tr>
<th>Reviewer</th>
<th>Product</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td><a href="#">Apple iPhone 3G 8GB</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td><a href="#">Fuji FinePix S5800</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td><a href="#">Canon PIXMA MP140</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="sidebar">
<ul>
<li><h3><a href="#" class="house">Dashboard</a></h3>
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
</ul>
</li>
<li><h3><a href="#" class="folder_table">Orders</a></h3>
<ul>
<li><a href="#" class="addorder">New order</a></li>
<li><a href="#" class="shipping">Shipments</a></li>
<li><a href="#" class="invoices">Invoices</a></li>
</ul>
</li>
<li><h3><a href="#" class="manage">Manage</a></h3>
<ul>
<li><a href="#" class="manage_page">Pages</a></li>
<li><a href="#" class="cart">Products</a></li>
<li><a href="#" class="folder">Product categories</a></li>
<li><a href="#" class="promotions">Promotions</a></li>
</ul>
</li>
<li><h3><a href="#" class="user">Users</a></h3>
<ul>
<li><a href="#" class="useradd">Add user</a></li>
<li><a href="#" class="group">User groups</a></li>
<li><a href="#" class="search">Find user</a></li>
<li><a href="#" class="online">Users online</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="footer">
<div id="credits">
Template by <a href="http://www.bloganje.com">Bloganje</a>
</div>
<div id="styleswitcher">
<ul>
<li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
<li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
<li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
<li><a href="javascript: document.cookie='theme=5'; window.location.reload();" title="Mix" id="defswitch">m</a></li>
</ul>
</div><br />
</div>
</div>
</body>
</html>

View File

@ -1,100 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dashboard - Admin Template</title>
<link rel="stylesheet" type="text/css" href="css/theme.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script>
var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
<h2>My eCommerce Admin area</h2>
<div id="topmenu">
<ul>
<li class="current"><a href="index.html">Dashboard</a></li>
<li><a href="#">Orders</a></li>
<li><a href="users.html">Users</a></li>
<li><a href="#">Manage</a></li>
<li><a href="#">CMS</a></li>
<li><a href="#">Statistics</a></li>
<li><a href="#">Settings</a></li>
</ul>
</div>
</div>
<div id="top-panel">
<div id="panel">
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
<li><a href="#" class="feed">RSS Feed</a></li>
</ul>
</div>
</div>
<div id="wrapper">
<div id="content">
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div id="sidebar">
<ul>
<li><h3><a href="#" class="house">Dashboard</a></h3>
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
</ul>
</li>
<li><h3><a href="#" class="folder_table">Orders</a></h3>
<ul>
<li><a href="#" class="addorder">New order</a></li>
<li><a href="#" class="shipping">Shipments</a></li>
<li><a href="#" class="invoices">Invoices</a></li>
</ul>
</li>
<li><h3><a href="#" class="manage">Manage</a></h3>
<ul>
<li><a href="#" class="manage_page">Pages</a></li>
<li><a href="#" class="cart">Products</a></li>
<li><a href="#" class="folder">Product categories</a></li>
<li><a href="#" class="promotions">Promotions</a></li>
</ul>
</li>
<li><h3><a href="#" class="user">Users</a></h3>
<ul>
<li><a href="#" class="useradd">Add user</a></li>
<li><a href="#" class="group">User groups</a></li>
<li><a href="#" class="search">Find user</a></li>
<li><a href="#" class="online">Users online</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="footer">
<div id="credits">
Template by <a href="http://www.bloganje.com">Bloganje</a>
</div>
<div id="styleswitcher">
<ul>
<li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
<li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
<li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
</ul>
</div><br />
</div>
</div>
</body>
</html>

View File

@ -1,121 +0,0 @@
body{
background:#f7f6f0 url(../img/bg.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#993300;
}
input{
border:1px solid #e8e7e1;
}
select{
border:1px solid #e8e7e1;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
}
#topmenu a,#topmenu a:visited{
color:#f7f6f0;
background:#cc3300;
}
#topmenu a:hover{
color: #FFF;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#993400;
background: #FFF url(../img/bg_menu_red.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #e8e7e1;
}
thead{
background:#f7f6f0;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #e8e7e1;
}
#box h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
color:#993300;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #e8e7e1;
}
form#form legend {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x center left;
color:#993300;
}
form#form input {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#e8e7e1;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#c00;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #e8e7e1;
}
#infobox h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
color:#993300;
}
#rightnow {
border:1px solid #e8e7e1;
}
#rightnow .reallynow {
background:#f7f6f0;
color:#993300;
}
#rightnow h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
}

View File

@ -1,21 +0,0 @@
#content{
width:740px;
}
#topmenu{
margin-top:26px;
}
#sidebar{
width:160px;
}
#sidebar ul{
width:150px;
}
#sidebar ul li ul{
width:140px;
}
#sidebar h3{
margin-bottom:5px;
}
#rightnow .reallynow a {
padding:0 0 0 10px;
}

View File

@ -1,68 +0,0 @@
<public:component>
<public:attach event="onpropertychange" onevent="doFix()" />
<script type="text/javascript">
// IE5.5+ PNG Alpha Fix v1.0RC4
// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
// This is licensed under the CC-GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
// This must be a path to a blank image. That's all the configuration you need.
if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
function filt(s, m)
{
if (filters[f])
{
filters[f].enabled = s ? true : false;
if (s) with (filters[f]) { src = s; sizingMethod = m }
}
else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
}
function doFix()
{
// Assume IE7 is OK.
if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
(event && !/(background|src)/.test(event.propertyName))) return;
var bgImg = currentStyle.backgroundImage || style.backgroundImage;
if (tagName == 'IMG')
{
if ((/\.png$/i).test(src))
{
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
style.width = offsetWidth + 'px';
filt(src, 'scale');
src = blankImg;
}
else if (src.indexOf(blankImg) < 0) filt();
}
else if (bgImg && bgImg != 'none')
{
if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
{
var s = RegExp.$1;
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
style.width = offsetWidth + 'px';
style.backgroundImage = 'none';
filt(s, 'crop');
// IE link fix.
for (var n = 0; n < childNodes.length; n++)
if (childNodes[n].style) childNodes[n].style.position = 'relative';
}
else filt();
}
}
doFix();
</script>
</public:component>

View File

@ -1,397 +0,0 @@
/*********************
HTML Elements
*********************/
*{
margin:0;
padding:0;
}
img, div,a { behavior: url(css/iepngfix.htc) }
body{
font-size: 12px;
font-family: Arial, Tahoma, Verdana;
}
a, a:visited{
text-decoration:none;
}
img{
border:0;
margin:1px;
}
p{
padding:3px;
}
h2{
}
input{
padding:2px;
}
select{
padding:2px;
}
/*********************
Status
*********************/
#status {
position: absolute; top: 10px; left: 10px;
margin: 0px;
float: right;
font-size: 12px;
}
#status .success {
margin: 0px:
}
#version {
position: absolute; top: 10px; right: 10px;
float: right;
text-align: right;
font-size: 12px;
}
/*********************
Structure
*********************/
#container{
width:960px;
margin-left:auto;
margin-right:auto;
}
#header{
width:960px;
}
#header h2{
margin-top:20px;
}
#content{
width:740px;
float:left;
margin:10px 0 10px 0;
padding:10px;
}
#sidebar{
background:#FFF;
width:170px;
float:right;
margin:10px 0 10px 0;
padding:10px;
}
#footer{
clear:both;
padding:5px;
margin-top:10px;
}
#box h3{
padding:5px;
font-size:14px;
}
/*********************
Sidebar
*********************/
#sidebar ul{
list-style:none;
line-height:22px;
}
#sidebar ul li a,#sidebar ul li a:visited{
padding-left:19px;
text-decoration:none;
margin:0 3px;
display:block;
}
#sidebar ul li a:hover{
text-decoration:underline;
}
#sidebar ul li ul{
margin-left:10px;
}
#sidebar h3{
padding:2px;
font-size:14px;
}
/*********************
TopMenu, Top-Panel
*********************/
#topmenu{
margin-top:33px;
width:700px;
float:left;
voice-family:inherit;
}
#topmenu ul{
list-style:none;
line-height:25px;
}
#topmenu li{
display:inline;
}
#topmenu a,#topmenu a:visited{
padding:5px 12px 5px 12px;
text-decoration:none;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
padding:5px 12px 5px 12px;
font-weight:bold;
}
#top-panel{
background:#FFF;
padding:5px;
height:20px;
float:left;
width:950px;
}
#top-panel ul{
list-style:none;
}
#top-panel ul li{
display:inline;
line-height:20px;
}
#top-panel ul li a{
padding-left:19px;
text-decoration:none;
margin:0 3px;
display:inline-block;
}
#top-panel a:hover{
text-decoration:underline;
}
/*********************
Other
*********************/
.a-right{text-align:right;}
.a-left{text-align:left;}
.a-center{text-align:center;}
#pager{
margin:5px;
height:25px;
}
#styleswitcher{
float:right;
}
#styleswitcher ul{
list-style:none;
line-height:10px;
}
#styleswitcher li{
height:12px;
display:inline;
}
#footer ul {
list-style:none;
}
#footer li {
display:inline;
}
a#defswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#bd3f09;
font-size: 8px;
color:#bd3f09;
display:inline-block;
}
a#blueswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#375b91;
font-size: 8px;
color:#375b91;
display:inline-block;
}
a#greenswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#d0e0b8;
font-size: 8px;
color:#d0e0b8;
display:inline-block;
}
a#brownswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#654322;
font-size: 8px;
color:#654322;
display:inline-block;
}
a#mixswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#294145;
font-size: 8px;
color:#294145;
display:inline-block;
}
#credits{
clear:both;
width:250px;
float:left;
}
/*********************
Tables
*********************/
table{
margin:5px;
border-collapse: collapse;
table-layout:automatic;
width:98%;
}
td, th{
padding: 2px;
}
thead{
}
/*********************
Home
*********************/
#infowrap li{
display:inline:
}
#infobox{
width:365px;
float:left;
margin-top:10px;
}
#infobox h3{
padding:5px;
font-size:14px;
}
.margin-left{
margin-left:5px;
}
#rightnow .reallynow {
padding: 5px;
font-size:14px;
}
#rightnow h3{
padding:2px;
padding: 0 10px;
font-size:14px;
}
#rightnow .reallynow span {
display: block;
text-align: left;
float: left;
padding:0 2px;
font-size:14px
}
#rightnow .reallynow a {
text-decoration:none;
display: block;
text-align: right;
float: right;
padding:0 0 0 18px;
margin-left:4px;
font-weight:normal;
font-size:12px;
}
#rightnow .reallynow a:hover{
text-decoration:underline;
}
#rightnow .youhave {
font-size: 12px;
padding: 10px;
}
#rightnow a {
font-weight: bold;
}
/*********************
Forms
*********************/
form{
padding:10px;
margin:0 auto;
}
form#form fieldset {
display:block;
padding:5px 10px 5px 10px;
line-height:20px;
margin-bottom:10px;
}
form#form legend {
font-size:12px;
font-weight:bold;
margin-bottom:5px;
padding:3px;
width:254px;
}
form#form label {
clear:left;
display:block;
float:left;
width:100px;
text-align:right;
padding-right:10px;
margin-bottom:5px;
}
form#form input {
padding:3px;
margin-bottom:5px;
}
form#form select {
margin-left:5px;
}
form#form textarea {
width:410px;
height:200px;
padding:5px;
overflow:auto;
}
form#form option {
background:#FFF;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
padding-right:5px;
cursor:pointer;
width:205px;
margin-left:8px;
font-weight:bold;
}
form#form #button1:hover, form#form #button2:hover {
background-position:center left;
}
/*********************
Icons
*********************/
.icon{
padding-left:19px;
text-decoration:none;
height:20px;
font-size:12x;
margin:0 3px;
display:inline-block;
line-height:20px;
}
.user{background:transparent url(../img/icons/user.png) no-repeat left;}
.useradd{background:transparent url(../img/icons/user_add.png) no-repeat left;}
.group{background:transparent url(../img/icons/group.png) no-repeat left;}
.search{background:transparent url(../img/icons/magnifier.png) no-repeat left;}
.online{background:transparent url(../img/icons/world.png) no-repeat left;}
.pagenew{background:transparent url(../img/icons/page_add.png) no-repeat left;}
.rss{background:transparent url(../img/icons/rss.png) no-repeat left;}
.feed{background:transparent url(../img/icons/feed.png) no-repeat left;}
.report{background:transparent url(../img/icons/report.png) no-repeat left;}
.house{background:transparent url(../img/icons/house.png) no-repeat left;}
.manage{background:transparent url(../img/icons/cog.png) no-repeat left;}
.manage_page{background:transparent url(../img/icons/page_gear.png) no-repeat left;}
.folder{background:transparent url(../img/icons/folder.png) no-repeat left;}
.promotions{background:transparent url(../img/icons/coins.png) no-repeat left;}
.cart{background:transparent url(../img/icons/cart.png) no-repeat left;}
.folder_table{background:transparent url(../img/icons/folder_page.png) no-repeat left;}
.shipping{background:transparent url(../img/icons/car.png) no-repeat left;}
.invoices{background:transparent url(../img/icons/page_white_text_width.png) no-repeat left;}
.addorder{background:transparent url(../img/icons/folder_page_add.png) no-repeat left;}
.add{background:transparent url(../img/icons/add.png) no-repeat left;}
.app_add{background:transparent url(../img/icons/application_add.png) no-repeat left;}
.report_seo{background:transparent url(../img/icons/report_link.png) no-repeat left;}
.modules{background:transparent url(../img/icons/bricks.png) no-repeat left;}
.modules_manage{background:transparent url(../img/icons/bricks_gear.png) no-repeat left;}

View File

@ -1,51 +0,0 @@
#footer ul {
list-style:none;
}
#footer li {
display:inline;
}
a#defswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#bd3f09;
font-size: 8px;
color:#bd3f09;
display:inline-block;
}
a#blueswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#375b91;
font-size: 8px;
color:#375b91;
display:inline-block;
}
a#greenswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#d0e0b8;
font-size: 8px;
color:#d0e0b8;
display:inline-block;
}
a#brownswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#654322;
font-size: 8px;
color:#654322;
display:inline-block;
}
a#mixswitch {
width:15px;
height:10px;
margin: 3px 0 3px 0;
background-color:#294145;
font-size: 8px;
color:#294145;
display:inline-block;
}

View File

@ -1,121 +0,0 @@
body{
background:#f7f6f0 url(../img/bg.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#a43708;
}
input{
border:1px solid #e8e7e1;
}
select{
border:1px solid #e8e7e1;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
}
#topmenu a,#topmenu a:visited{
color:#f7f6f0;
background:#bd3f09;
}
#topmenu a:hover{
color: #FFF;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#993400;
background: #FFF url(../img/bg_menu_red.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #e8e7e1;
}
thead{
background:#f7f6f0;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #e8e7e1;
}
#box h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
color:#a43708;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #e8e7e1;
}
form#form legend {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x center left;
color:#a43708;
}
form#form input {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#e8e7e1;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#c00;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #e8e7e1;
}
#infobox h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
color:#a43708;
}
#rightnow {
border:1px solid #e8e7e1;
}
#rightnow .reallynow {
background:#f7f6f0;
color:#a43708;
}
#rightnow h3{
background:#f7f6f0;
border-bottom:1px solid #e8e7e1;
}

View File

@ -1,121 +0,0 @@
body{
background:#f3f9ff url(../img/bg_blue.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#375b91;
}
input{
border:1px solid #d9e6f0;
}
select{
border:1px solid #d9e6f0;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#f3f9ff;
border-bottom:1px solid #d9e6f0;
}
#topmenu a,#topmenu a:visited{
color:#FFF;
background:#7e9dcc;
}
#topmenu a:hover{
color: #FFF;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#375b91;
background: #FFF url(../img/bg_menu_blue.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #d9e6f0;
}
thead{
background:#f3f9ff;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #d9e6f0;
}
#box h3{
background:#f3f9ff;
border-bottom:1px solid #d9e6f0;
color:#375b91;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #d9e6f0;
}
form#form legend {
border:1px solid #d9e6f0;
background:#fff url(../img/form_blue.gif) repeat-x center left;
color:#375b91;
}
form#form input {
border:1px solid #d9e6f0;
background:#fff url(../img/form_blue.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #d9e6f0;
background:#fff url(../img/form_blue.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#d9e6f0;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#375b91;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #d9e6f0;
}
#infobox h3{
background:#f3f9ff;
border-bottom:1px solid #d9e6f0;
color:#375b91;
}
#rightnow {
border:1px solid #d9e6f0;
}
#rightnow .reallynow {
background:#f3f9ff;
color:#375b91;
}
#rightnow h3{
background:#f3f9ff;
border-bottom:1px solid #d9e6f0;
}

View File

@ -1,121 +0,0 @@
body{
background:#f0f7e8 url(../img/bg_light_green.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#93ad7e;
}
input{
border:1px solid #e7eedf;
}
select{
border:1px solid #e7eedf;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#f0f7e8;
border-bottom:1px solid #e7eedf;
}
#topmenu a,#topmenu a:visited{
color:#93ad7e;
background:#e7eedc;
}
#topmenu a:hover{
color: #93ad7e;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#93ad7e;
background: #FFF url(../img/bg_menu_green.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #e7eedf;
}
thead{
background:#f0f7e8;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #e7eedf;
}
#box h3{
background:#f0f7e8;
border-bottom:1px solid #e7eedf;
color:#93ad7e;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #e7eedf;
}
form#form legend {
border:1px solid #e7eedf;
background:#fff url(../img/form_green.gif) repeat-x center left;
color:#93ad7e;
}
form#form input {
border:1px solid #e7eedf;
background:#fff url(../img/form_green.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #e7eedf;
background:#fff url(../img/form_green.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#e7eedf;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#93ad7e;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #e7eedf;
}
#infobox h3{
background:#f0f7e8;
border-bottom:1px solid #e7eedf;
color:#93ad7e;
}
#rightnow {
border:1px solid #e7eedf;
}
#rightnow .reallynow {
background:#f0f7e8;
color:#93ad7e;
}
#rightnow h3{
background:#f0f7e8;
border-bottom:1px solid #e7eedf;
}

View File

@ -1,121 +0,0 @@
body{
background:#f7f6f1 url(../img/bg_brown.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#654322;
}
input{
border:1px solid #e9e8e3;
}
select{
border:1px solid #e9e8e3;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#f7f6f1;
border-bottom:1px solid #e9e8e3;
}
#topmenu a,#topmenu a:visited{
color:#FFF;
background:#8f6831;
}
#topmenu a:hover{
color: #654322;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#654322;
background: #FFF url(../img/bg_menu_brown.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #e9e8e3;
}
thead{
background:#f7f6f1;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #e9e8e3;
}
#box h3{
background:#f7f6f1;
border-bottom:1px solid #e9e8e3;
color:#654322;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #e9e8e3;
}
form#form legend {
border:1px solid #e9e8e3;
background:#fff url(../img/form_brown.gif) repeat-x center left;
color:#654322;
}
form#form input {
border:1px solid #e9e8e3;
background:#fff url(../img/form_brown.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #e9e8e3;
background:#fff url(../img/form_brown.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#e9e8e3;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#654322;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #e9e8e3;
}
#infobox h3{
background:#f7f6f1;
border-bottom:1px solid #e9e8e3;
color:#654322;
}
#rightnow {
border:1px solid #e9e8e3;
}
#rightnow .reallynow {
background:#f7f6f1;
color:#654322;
}
#rightnow h3{
background:#f7f6f1;
border-bottom:1px solid #e9e8e3;
}

View File

@ -1,122 +0,0 @@
body{
background:#d9eaed url(../img/bg_mix.jpg) repeat-x top;
color: #202020;
}
a, a:visited{
color:#294145;
text-decoration:underline;
}
input{
border:1px solid #c3d7db;
}
select{
border:1px solid #c3d7db;
}
#header h2{
color:#FFF;
}
#content{
background:#FFF;
}
#sidebar{
background:#FFF;
}
#sidebar h3{
background:#d9eaed;
border-bottom:1px solid #c3d7db;
}
#topmenu a,#topmenu a:visited{
color:#FFF;
background:#5d99a3;
}
#topmenu a:hover{
color: #294145;
}
#topmenu .current a, #topmenu .current a:hover, #topmenu .current a:visited{
color:#294145;
background: #FFF url(../img/bg_menu_mix.jpg) repeat-x top;
border-left: #FFF 1px solid;
border-right: #FFF 1px solid;
}
#top-panel{
background:#FFF;
}
table{
background:none;
}
td, th{
border:1px solid #c3d7db;
}
thead{
background:#d9eaed;
}
#styleswitcher{
background:#FFFFFF;
}
#footer{
background:#FFF;
}
#box{
border:1px solid #c3d7db;
}
#box h3{
background:#d9eaed;
border-bottom:1px solid #c3d7db;
color:#294145;
}
/***************
Forms
***************/
form#form fieldset {
border:1px solid #c3d7db;
}
form#form legend {
border:1px solid #c3d7db;
background:#fff url(../img/form_mix.gif) repeat-x center left;
color:#294145;
}
form#form input {
border:1px solid #c3d7db;
background:#fff url(../img/form_mix.gif) repeat-x top left;
}
form#form textarea {
border:1px solid #c3d7db;
background:#fff url(../img/form_mix.gif) repeat-x bottom left;
}
form#form option {
background:#FFF;
}
form#form optgroup {
background:#c3d7db;
}
form#form optgroup option {
}
form#form #button1, form#form #button2 {
color:#294145;
}
form#form #button1:hover, form#form #button2:hover {
color:#000;
}
/***************
Home
***************/
#infobox{
border:1px solid #c3d7db;
}
#infobox h3{
background:#d9eaed;
border-bottom:1px solid #c3d7db;
color:#294145;
}
#rightnow {
border:1px solid #c3d7db;
}
#rightnow .reallynow {
background:#d9eaed;
color:#294145;
}
#rightnow h3{
background:#d9eaed;
border-bottom:1px solid #c3d7db;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

View File

@ -1,296 +0,0 @@
<?php defined('MYAAC') or die('Direct access not allowed!'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php echo template_header(true); ?>
<title><?php echo $title . $config['title_separator'] . $config['lua']['serverName']; ?> - Powered by MyAAC</title>
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>css/theme2.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>css/style.css" />
<script>
var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
<?php if($logged): ?>
<div id="status">
<?php if($status['online']): ?>
<p class="success" style="width: 120px; text-align: center;">Status: Online<br/>
<?php echo $status['uptimeReadable'] . ', ' . $status['players'] . '/' . $status['playersMax']; ?><br/>
<?php echo $config['lua']['ip'] . ' : ' . $config['lua']['loginPort']; ?>
</p>
<?php else: ?>
<p class="error" style="width: 120px; text-align: center;">Status: Offline</p>
<?php endif; ?>
</div>
<div id="version">Version: <?php echo MYAAC_VERSION; ?> (<a id="update" href="#">Check for updates</a>)<br/>
<a href="http://<?php echo $_SERVER['HTTP_HOST']; ?>" target="_blank">Preview</a> <span class="separator">|</span> <a href="?action=logout">Logout<img src="images/logout.png" alt="" title="Logout" /></a>
</div>
<?php endif; ?>
<h2><?php echo $config['lua']['serverName']; ?> - Admin Panel</h2>
<div id="topmenu">
<ul>
<li class="current"><a href="index.html">Dashboard</a></li>
<li><a href="#">Orders</a></li>
<li><a href="users.html">Users</a></li>
<li><a href="#">Manage</a></li>
<li><a href="#">CMS</a></li>
<li><a href="#">Statistics</a></li>
<li><a href="#">Settings</a></li>
</ul>
</div>
</div>
<div id="top-panel">
<div id="panel">
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
<li><a href="#" class="feed">RSS Feed</a></li>
</ul>
</div>
</div>
<div id="wrapper">
<div id="content">
<div id="rightnow">
<h3 class="reallynow">
<span>Right Now</span>
<a href="#" class="add">Add New Product</a>
<a href="#" class="app_add">Some Action</a>
<br />
</h3>
<p class="youhave">You have <a href="#">19 new orders</a>, <a href="#">12 new users</a> and <a href="#">5 new reviews</a>, today you made <a href="#">$1523.63 in sales</a> and a total of <strong>$328.24 profit </strong>
</p>
</div>
<div id="infowrap">
<div id="infobox">
<h3>Sales for July</h3>
<p><img src="img/graph.jpg" width="360" height="266" /></p>
</div>
<div id="infobox" class="margin-left">
<h3>Traffic for July</h3>
<p><img src="img/graph2.jpg" alt="a" width="359" height="266" /></p>
</div>
<div id="infobox">
<h3>Last 5 Orders</h3>
<table>
<thead>
<tr>
<th>Customer</th>
<th>Items</th>
<th>Grand Total</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td>1</td>
<td>14.95 </td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td>2</td>
<td>34.27 </td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td>2</td>
<td>61.39 </td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td>5</td>
<td>1472.56 </td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td>1</td>
<td>9.95 </td>
</tr>
</tbody>
</table>
</div>
<div id="infobox" class="margin-left">
<h3>Bestsellers</h3>
<table>
<thead>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>Orders</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Apple iPhone 3G 8GB</a></td>
<td>199.00 </td>
<td>24</td>
</tr>
<tr>
<td><a href="#">Fuji FinePix S5800</a></td>
<td>365.24 </td>
<td>19</td>
</tr>
<tr>
<td><a href="#">Canon PIXMA MP140</a></td>
<td>59.50 </td>
<td>12</td>
</tr>
<tr>
<td><a href="#">Apple iPhone 3G 16GB</a></td>
<td>199.00 </td>
<td>10</td>
</tr>
<tr>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td>499.00 </td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
<div id="infobox">
<h3>New Customers</h3>
<table>
<thead>
<tr>
<th>Customer</th>
<th>Orders</th>
<th>Average</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td>1</td>
<td>5.6</td>
<td>14.95 </td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td>2</td>
<td>14.97</td>
<td>34.27 </td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td>2</td>
<td>15.31</td>
<td>61.39 </td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td>5</td>
<td>502.61</td>
<td>1472.56 </td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td>1</td>
<td>5.1</td>
<td>9.95 </td>
</tr>
</tbody>
</table>
</div>
<div id="infobox" class="margin-left">
<h3>Last 5 Reviews</h3>
<table>
<thead>
<tr>
<th>Reviewer</th>
<th>Product</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">Jennifer Kyrnin</a></td>
<td><a href="#">Apple iPhone 3G 8GB</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Mark Kyrnin</a></td>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Virgílio Cezar</a></td>
<td><a href="#">Fuji FinePix S5800</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Todd Simonides</a></td>
<td><a href="#">Canon PIXMA MP140</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
<tr>
<td><a href="#">Carol Elihu</a></td>
<td><a href="#">Prenosnik HP 530 1,6GHz</a></td>
<td><a href="#"><img src="img/icons/page_white_link.png" /></a><a href="#"><img src="img/icons/page_white_edit.png" /></a><a href="#"><img src="img/icons/page_white_delete.png" /></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="sidebar">
<ul>
<li><h3><a href="#" class="house">Dashboard</a></h3>
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
</ul>
</li>
<li><h3><a href="#" class="folder_table">Orders</a></h3>
<ul>
<li><a href="#" class="addorder">New order</a></li>
<li><a href="#" class="shipping">Shipments</a></li>
<li><a href="#" class="invoices">Invoices</a></li>
</ul>
</li>
<li><h3><a href="#" class="manage">Manage</a></h3>
<ul>
<li><a href="#" class="manage_page">Pages</a></li>
<li><a href="#" class="cart">Products</a></li>
<li><a href="#" class="folder">Product categories</a></li>
<li><a href="#" class="promotions">Promotions</a></li>
</ul>
</li>
<li><h3><a href="#" class="user">Players</a></h3>
<ul>
<li><a href="#" class="useradd">Add user</a></li>
<li><a href="#" class="group">Groups</a></li>
<li><a href="#" class="search">Find&nbsp; player</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="footer">
<div id="credits">
Powered by <a href="http://my-aac.org" target="_blank">MyAAC</a>, template by <a href="http://www.bloganje.com">Bloganje</a>
</div>
<div id="styleswitcher">
<ul>
<li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
<li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
<li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
<li><a href="javascript: document.cookie='theme=5'; window.location.reload();" title="Mix" id="defswitch">m</a></li>
</ul>
</div><br />
</div>
</div>
</body>
</html>

View File

@ -1,309 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Users - Admin Template</title>
<link rel="stylesheet" type="text/css" href="css/theme.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script>
var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
<h2>My eCommerce Admin area</h2>
<div id="topmenu">
<ul>
<li><a href="index.html">Dashboard</a></li>
<li><a href="#">Orders</a></li>
<li class="current"><a href="#">Users</a></li>
<li><a href="#">Manage</a></li>
<li><a href="#">CMS</a></li>
<li><a href="#">Statistics</a></li>
<li><a href="#">Settings</a></li>
</ul>
</div>
</div>
<div id="top-panel">
<div id="panel">
<ul>
<li><a href="#adduser" class="useradd">Add user</a></li>
<li><a href="#" class="group">User groups</a></li>
<li><a href="#" class="search">Find user</a></li>
<li><a href="#" class="online">Users online</a></li>
</ul>
</div>
</div>
<div id="wrapper">
<div id="content">
<div id="box">
<h3>Users</h3>
<table width="100%">
<thead>
<tr>
<th width="40px"><a href="#">ID<img src="img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>
<th><a href="#">Full Name</a></th>
<th><a href="#">Email</a></th>
<th width="70px"><a href="#">Group</a></th>
<th width="50px"><a href="#">ZIP</a></th>
<th width="90px"><a href="#">Registered</a></th>
<th width="60px"><a href="#">Action</a></th>
</tr>
</thead>
<tbody>
<tr>
<td class="a-center">232</td>
<td><a href="#">Jennifer Hodes</a></td>
<td>jennifer.hodes@gmail.com</td>
<td>General</td>
<td>1000</td>
<td>July 2, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">231</td>
<td><a href="#">Mark Kyrnin</a></td>
<td>mark.kyrnin@hotmail.com</td>
<td>Affiliate</td>
<td>8310</td>
<td>June 17, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">230</td>
<td><a href="#">Virgílio Cezar</a></td>
<td>virgilio@somecompany.cz</td>
<td>General</td>
<td>6200</td>
<td>June 31, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">229</td>
<td><a href="#">Todd Simonides</a></td>
<td>todd.simonides@gmail.com</td>
<td>Wholesale</td>
<td>2010</td>
<td>June 5, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">228</td>
<td><a href="#">Carol Elihu</a></td>
<td>carol@herbusiness.com</td>
<td>General</td>
<td>3120</td>
<td>May 23, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">232</td>
<td><a href="#">Jennifer Hodes</a></td>
<td>jennifer.hodes@gmail.com</td>
<td>General</td>
<td>1000</td>
<td>July 2, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">231</td>
<td><a href="#">Mark Kyrnin</a></td>
<td>mark.kyrnin@hotmail.com</td>
<td>Affiliate</td>
<td>8310</td>
<td>June 17, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">230</td>
<td><a href="#">Virgílio Cezar</a></td>
<td>virgilio@somecompany.cz</td>
<td>General</td>
<td>6200</td>
<td>June 31, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">229</td>
<td><a href="#">Todd Simonides</a></td>
<td>todd.simonides@gmail.com</td>
<td>Wholesale</td>
<td>2010</td>
<td>June 5, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
<tr>
<td class="a-center">228</td>
<td><a href="#">Carol Elihu</a></td>
<td>carol@herbusiness.com</td>
<td>General</td>
<td>3120</td>
<td>May 23, 2008</td>
<td><a href="#"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a><a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a><a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
</tr>
</tbody>
</table>
<div id="pager">
Page <a href="#"><img src="img/icons/arrow_left.gif" width="16" height="16" /></a>
<input size="1" value="1" type="text" name="page" id="page" />
<a href="#"><img src="img/icons/arrow_right.gif" width="16" height="16" /></a>of 42
pages | View <select name="view">
<option>10</option>
<option>20</option>
<option>50</option>
<option>100</option>
</select>
per page | Total <strong>420</strong> records found
</div>
</div>
<br />
<div id="box">
<h3 id="adduser">Add user</h3>
<form id="form" action="..." method="post">
<fieldset id="personal">
<legend>PERSONAL INFORMATION</legend>
<label for="lastname">Last name : </label>
<input name="lastname" id="lastname" type="text" tabindex="1" />
<br />
<label for="firstname">First name : </label>
<input name="firstname" id="firstname" type="text"
tabindex="2" />
<br />
<label for="email">Email : </label>
<input name="email" id="email" type="text"
tabindex="2" />
<br />
<p>Send auto generated password
<input name="generatepass" id="yes" type="checkbox"
value="yes" tabindex="35" /></p>
<label for="pass">Password : </label>
<input name="pass" id="pass" type="password"
tabindex="2" />
<br />
<label for="pass-2">Password : </label>
<input name="pass-2" id="pass-2" type="password"
tabindex="2" />
<br />
</fieldset>
<fieldset id="address">
<legend>Address</legend>
<label for="street">Street address : </label>
<input name="street" id="street" type="text"
tabindex="1" />
<br />
<label for="city">City : </label>
<input name="city" id="city" type="text"
tabindex="2" />
<br />
<label for="country">Country : </label>
<input name="country" id="country" type="text"
tabindex="1" />
<br />
<label for="state">State/Province : </label>
<input name="state" id="state" type="text"
tabindex="2" />
<br />
<label for="zip">Zip/Postal Code : </label>
<input name="zip" id="zip" type="text"
tabindex="2" />
<br />
<label for="tel">Telephone : </label>
<input name="tel" id="tel" type="text"
tabindex="2" />
</fieldset>
<fieldset id="opt">
<legend>OPTIONS</legend>
<label for="choice">Group : </label>
<select name="choice">
<option selected="selected" label="none" value="none">
General
</option>
<optgroup label="Group 1">
<option label="cg1a" value="val_1a">Selection group 1a
</option>
<option label="cg1b" value="val_1b">Selection group 1b
</option>
<option label="cg1c" value="val_1c">Selection group 1c
</option>
</optgroup>
<optgroup label="Group 2">
<option label="cg2a" value="val_2a">Selection group 2a
</option>
<option label="cg2b" value="val_2a">Selection group 2b
</option>
</optgroup>
<optgroup label="Group 3">
<option label="cg3a" value="val_3a">Selection group 3a
</option>
<option label="cg3a" value="val_3a">Selection group 3b
</option>
</optgroup>
</select>
</fieldset>
<div align="center">
<input id="button1" type="submit" value="Send" />
<input id="button2" type="reset" />
</div>
</form>
</div>
</div>
<div id="sidebar">
<ul>
<li><h3><a href="#" class="house">Dashboard</a></h3>
<ul>
<li><a href="#" class="report">Sales Report</a></li>
<li><a href="#" class="report_seo">SEO Report</a></li>
<li><a href="#" class="search">Search</a></li>
</ul>
</li>
<li><h3><a href="#" class="folder_table">Orders</a></h3>
<ul>
<li><a href="#" class="addorder">New order</a></li>
<li><a href="#" class="shipping">Shipments</a></li>
<li><a href="#" class="invoices">Invoices</a></li>
</ul>
</li>
<li><h3><a href="#" class="manage">Manage</a></h3>
<ul>
<li><a href="#" class="manage_page">Pages</a></li>
<li><a href="#" class="cart">Products</a></li>
<li><a href="#" class="folder">Product categories</a></li>
<li><a href="#" class="promotions">Promotions</a></li>
</ul>
</li>
<li><h3><a href="#" class="user">Users</a></h3>
<ul>
<li><a href="#" class="useradd">Add user</a></li>
<li><a href="#" class="group">User groups</a></li>
<li><a href="#" class="search">Find user</a></li>
<li><a href="#" class="online">Users online</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="footer">
<div id="credits">
Template by <a href="http://www.bloganje.com">Bloganje</a>
</div>
<div id="styleswitcher">
<ul>
<li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
<li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
<li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
<li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
</ul>
</div><br />
</div>
</div>
</body>
</html>

View File

@ -22,7 +22,7 @@ function version_check($name, $ok, $info = '', $warning = false)
$failed = false;
// start validating
version_check($locale['step_requirements_php_version'], (PHP_VERSION_ID >= 50000), PHP_VERSION);
version_check($locale['step_requirements_php_version'], (PHP_VERSION_ID >= 50102), PHP_VERSION);
foreach(array('config.local.php', 'images/guilds', 'images/houses', 'images/screenshots') as $value)
{
$perms = (int) substr(decoct(fileperms(BASE . $value)), 2);

1
system/cache/twig/.htaccess vendored Normal file
View File

@ -0,0 +1 @@
deny from all

View File

@ -26,6 +26,15 @@ if($config['gzip_output'] && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !
require_once(SYSTEM . 'libs/cache.php');
$cache = Cache::getInstance($config['cache_engine'], $config['cache_prefix']);
// twig
require_once LIBS . 'twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem(SYSTEM . 'templates');
$twig = new Twig_Environment($loader, array(
'cache' => CACHE . 'twig/',
));
// trim values we receive
if(isset($_POST))
{

17
system/libs/twig/Autoloader.php Normal file → Executable file
View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Twig.
*
@ -7,6 +8,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Autoloads Twig classes.
*
@ -16,12 +18,18 @@ class Twig_Autoloader
{
/**
* Registers Twig_Autoloader as an SPL autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function register()
public static function register($prepend = false)
{
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(new self, 'autoload'));
if (PHP_VERSION_ID < 50300) {
spl_autoload_register(array(__CLASS__, 'autoload'));
} else {
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
}
}
/**
* Handles autoloading of classes.
*
@ -32,8 +40,9 @@ class Twig_Autoloader
if (0 !== strpos($class, 'Twig')) {
return;
}
if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
require $file;
}
}
}
}

View File

@ -0,0 +1,62 @@
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
{
/**
* {@inheritdoc}
*/
final public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
{
if (!$node instanceof Twig_Node) {
throw new LogicException('Twig_BaseNodeVisitor only supports Twig_Node instances.');
}
return $this->doEnterNode($node, $env);
}
/**
* {@inheritdoc}
*/
final public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
{
if (!$node instanceof Twig_Node) {
throw new LogicException('Twig_BaseNodeVisitor only supports Twig_Node instances.');
}
return $this->doLeaveNode($node, $env);
}
/**
* Called before child nodes are visited.
*
* @param Twig_Node $node The node to visit
* @param Twig_Environment $env The Twig environment instance
*
* @return Twig_Node The modified node
*/
abstract protected function doEnterNode(Twig_Node $node, Twig_Environment $env);
/**
* Called after child nodes are visited.
*
* @param Twig_Node $node The node to visit
* @param Twig_Environment $env The Twig environment instance
*
* @return Twig_Node|false The modified node or false if the node must be removed
*/
abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env);
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Cache;
class_exists('Twig_CacheInterface');
if (\false) {
interface CacheInterface extends \Twig_CacheInterface
{
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Cache;
class_exists('Twig_Cache_Filesystem');
if (\false) {
class FilesystemCache extends \Twig_Cache_Filesystem
{
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Cache;
class_exists('Twig_Cache_Null');
if (\false) {
class NullCache extends \Twig_Cache_Null
{
}
}

View File

@ -1,11 +1,278 @@
<?php
namespace Twig;
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class_exists('Twig_Compiler');
/**
* Compiles a node to PHP code.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Compiler implements Twig_CompilerInterface
{
protected $lastLine;
protected $source;
protected $indentation;
protected $env;
protected $debugInfo;
protected $sourceOffset;
protected $sourceLine;
protected $filename;
if (\false) {
class Compiler extends \Twig_Compiler
/**
* Constructor.
*
* @param Twig_Environment $env The twig environment instance
*/
public function __construct(Twig_Environment $env)
{
$this->env = $env;
$this->debugInfo = array();
}
public function getFilename()
{
return $this->filename;
}
/**
* Returns the environment instance related to this compiler.
*
* @return Twig_Environment The environment instance
*/
public function getEnvironment()
{
return $this->env;
}
/**
* Gets the current PHP code after compilation.
*
* @return string The PHP code
*/
public function getSource()
{
return $this->source;
}
/**
* Compiles a node.
*
* @param Twig_NodeInterface $node The node to compile
* @param int $indentation The current indentation
*
* @return Twig_Compiler The current compiler instance
*/
public function compile(Twig_NodeInterface $node, $indentation = 0)
{
$this->lastLine = null;
$this->source = '';
$this->debugInfo = array();
$this->sourceOffset = 0;
// source code starts at 1 (as we then increment it when we encounter new lines)
$this->sourceLine = 1;
$this->indentation = $indentation;
if ($node instanceof Twig_Node_Module) {
$this->filename = $node->getAttribute('filename');
}
$node->compile($this);
return $this;
}
public function subcompile(Twig_NodeInterface $node, $raw = true)
{
if (false === $raw) {
$this->addIndentation();
}
$node->compile($this);
return $this;
}
/**
* Adds a raw string to the compiled code.
*
* @param string $string The string
*
* @return Twig_Compiler The current compiler instance
*/
public function raw($string)
{
$this->source .= $string;
return $this;
}
/**
* Writes a string to the compiled code by adding indentation.
*
* @return Twig_Compiler The current compiler instance
*/
public function write()
{
$strings = func_get_args();
foreach ($strings as $string) {
$this->addIndentation();
$this->source .= $string;
}
return $this;
}
/**
* Appends an indentation to the current PHP code after compilation.
*
* @return Twig_Compiler The current compiler instance
*/
public function addIndentation()
{
$this->source .= str_repeat(' ', $this->indentation * 4);
return $this;
}
/**
* Adds a quoted string to the compiled code.
*
* @param string $value The string
*
* @return Twig_Compiler The current compiler instance
*/
public function string($value)
{
$this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\"));
return $this;
}
/**
* Returns a PHP representation of a given value.
*
* @param mixed $value The value to convert
*
* @return Twig_Compiler The current compiler instance
*/
public function repr($value)
{
if (is_int($value) || is_float($value)) {
if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
setlocale(LC_NUMERIC, 'C');
}
$this->raw($value);
if (false !== $locale) {
setlocale(LC_NUMERIC, $locale);
}
} elseif (null === $value) {
$this->raw('null');
} elseif (is_bool($value)) {
$this->raw($value ? 'true' : 'false');
} elseif (is_array($value)) {
$this->raw('array(');
$first = true;
foreach ($value as $key => $v) {
if (!$first) {
$this->raw(', ');
}
$first = false;
$this->repr($key);
$this->raw(' => ');
$this->repr($v);
}
$this->raw(')');
} else {
$this->string($value);
}
return $this;
}
/**
* Adds debugging information.
*
* @param Twig_NodeInterface $node The related twig node
*
* @return Twig_Compiler The current compiler instance
*/
public function addDebugInfo(Twig_NodeInterface $node)
{
if ($node->getLine() != $this->lastLine) {
$this->write(sprintf("// line %d\n", $node->getLine()));
// when mbstring.func_overload is set to 2
// mb_substr_count() replaces substr_count()
// but they have different signatures!
if (((int) ini_get('mbstring.func_overload')) & 2) {
// this is much slower than the "right" version
$this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
} else {
$this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset);
}
$this->sourceOffset = strlen($this->source);
$this->debugInfo[$this->sourceLine] = $node->getLine();
$this->lastLine = $node->getLine();
}
return $this;
}
public function getDebugInfo()
{
ksort($this->debugInfo);
return $this->debugInfo;
}
/**
* Indents the generated code.
*
* @param int $step The number of indentation to add
*
* @return Twig_Compiler The current compiler instance
*/
public function indent($step = 1)
{
$this->indentation += $step;
return $this;
}
/**
* Outdents the generated code.
*
* @param int $step The number of indentation to remove
*
* @return Twig_Compiler The current compiler instance
*
* @throws LogicException When trying to outdent too much so the indentation would become negative
*/
public function outdent($step = 1)
{
// can't outdent by more steps than the current indentation level
if ($this->indentation < $step) {
throw new LogicException('Unable to call outdent() as the indentation would become negative');
}
$this->indentation -= $step;
return $this;
}
public function getVarName()
{
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Interface implemented by compiler classes.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since 1.12 (to be removed in 3.0)
*/
interface Twig_CompilerInterface
{
/**
* Compiles a node.
*
* @param Twig_NodeInterface $node The node to compile
*
* @return Twig_CompilerInterface The current compiler instance
*/
public function compile(Twig_NodeInterface $node);
/**
* Gets the current PHP code after compilation.
*
* @return string The PHP code
*/
public function getSource();
}

File diff suppressed because it is too large Load Diff

250
system/libs/twig/Error.php Executable file
View File

@ -0,0 +1,250 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Twig base exception.
*
* This exception class and its children must only be used when
* an error occurs during the loading of a template, when a syntax error
* is detected in a template, or when rendering a template. Other
* errors must use regular PHP exception classes (like when the template
* cache directory is not writable for instance).
*
* To help debugging template issues, this class tracks the original template
* name and line where the error occurred.
*
* Whenever possible, you must set these information (original template name
* and line number) yourself by passing them to the constructor. If some or all
* these information are not available from where you throw the exception, then
* this class will guess them automatically (when the line number is set to -1
* and/or the filename is set to null). As this is a costly operation, this
* can be disabled by passing false for both the filename and the line number
* when creating a new instance of this class.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Error extends Exception
{
protected $lineno;
protected $filename;
protected $rawMessage;
protected $previous;
/**
* Constructor.
*
* Set both the line number and the filename to false to
* disable automatic guessing of the original template name
* and line number.
*
* Set the line number to -1 to enable its automatic guessing.
* Set the filename to null to enable its automatic guessing.
*
* By default, automatic guessing is enabled.
*
* @param string $message The error message
* @param int $lineno The template line where the error occurred
* @param string $filename The template file name where the error occurred
* @param Exception $previous The previous exception
*/
public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null)
{
if (PHP_VERSION_ID < 50300) {
$this->previous = $previous;
parent::__construct('');
} else {
parent::__construct('', 0, $previous);
}
$this->lineno = $lineno;
$this->filename = $filename;
if (-1 === $this->lineno || null === $this->filename) {
$this->guessTemplateInfo();
}
$this->rawMessage = $message;
$this->updateRepr();
}
/**
* Gets the raw message.
*
* @return string The raw message
*/
public function getRawMessage()
{
return $this->rawMessage;
}
/**
* Gets the filename where the error occurred.
*
* @return string The filename
*/
public function getTemplateFile()
{
return $this->filename;
}
/**
* Sets the filename where the error occurred.
*
* @param string $filename The filename
*/
public function setTemplateFile($filename)
{
$this->filename = $filename;
$this->updateRepr();
}
/**
* Gets the template line where the error occurred.
*
* @return int The template line
*/
public function getTemplateLine()
{
return $this->lineno;
}
/**
* Sets the template line where the error occurred.
*
* @param int $lineno The template line
*/
public function setTemplateLine($lineno)
{
$this->lineno = $lineno;
$this->updateRepr();
}
public function guess()
{
$this->guessTemplateInfo();
$this->updateRepr();
}
/**
* For PHP < 5.3.0, provides access to the getPrevious() method.
*
* @param string $method The method name
* @param array $arguments The parameters to be passed to the method
*
* @return Exception The previous exception or null
*
* @throws BadMethodCallException
*/
public function __call($method, $arguments)
{
if ('getprevious' == strtolower($method)) {
return $this->previous;
}
throw new BadMethodCallException(sprintf('Method "Twig_Error::%s()" does not exist.', $method));
}
protected function updateRepr()
{
$this->message = $this->rawMessage;
$dot = false;
if ('.' === substr($this->message, -1)) {
$this->message = substr($this->message, 0, -1);
$dot = true;
}
if ($this->filename) {
if (is_string($this->filename) || (is_object($this->filename) && method_exists($this->filename, '__toString'))) {
$filename = sprintf('"%s"', $this->filename);
} else {
$filename = json_encode($this->filename);
}
$this->message .= sprintf(' in %s', $filename);
}
if ($this->lineno && $this->lineno >= 0) {
$this->message .= sprintf(' at line %d', $this->lineno);
}
if ($dot) {
$this->message .= '.';
}
}
protected function guessTemplateInfo()
{
$template = null;
$templateClass = null;
if (PHP_VERSION_ID >= 50306) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
} else {
$backtrace = debug_backtrace();
}
foreach ($backtrace as $trace) {
if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) {
$currentClass = get_class($trace['object']);
$isEmbedContainer = 0 === strpos($templateClass, $currentClass);
if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) {
$template = $trace['object'];
$templateClass = get_class($trace['object']);
}
}
}
// update template filename
if (null !== $template && null === $this->filename) {
$this->filename = $template->getTemplateName();
}
if (null === $template || $this->lineno > -1) {
return;
}
$r = new ReflectionObject($template);
$file = $r->getFileName();
// hhvm has a bug where eval'ed files comes out as the current directory
if (is_dir($file)) {
$file = '';
}
$exceptions = array($e = $this);
while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) {
$exceptions[] = $e;
}
while ($e = array_pop($exceptions)) {
$traces = $e->getTrace();
array_unshift($traces, array('file' => $e->getFile(), 'line' => $e->getLine()));
while ($trace = array_shift($traces)) {
if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
continue;
}
foreach ($template->getDebugInfo() as $codeLine => $templateLine) {
if ($codeLine <= $trace['line']) {
// update template line
$this->lineno = $templateLine;
return;
}
}
}
}
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Error;
class_exists('Twig_Error');
if (\false) {
class Error extends \Twig_Error
{
}
}

View File

@ -0,0 +1,31 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2010 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Exception thrown when an error occurs during template loading.
*
* Automatic template information guessing is always turned off as
* if a template cannot be loaded, there is nothing to guess.
* However, when a template is loaded from another one, then, we need
* to find the current context and this is automatically done by
* Twig_Template::displayWithErrorHandling().
*
* This strategy makes Twig_Environment::resolveTemplate() much faster.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Error_Loader extends Twig_Error
{
public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null)
{
parent::__construct($message, false, false, $previous);
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Error;
class_exists('Twig_Error_Loader');
if (\false) {
class LoaderError extends \Twig_Error_Loader
{
}
}

View File

@ -0,0 +1,20 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Exception thrown when an error occurs at runtime.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Error_Runtime extends Twig_Error
{
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Error;
class_exists('Twig_Error_Runtime');
if (\false) {
class RuntimeError extends \Twig_Error_Runtime
{
}
}

View File

@ -0,0 +1,20 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Exception thrown when a syntax error occurs during lexing or parsing of a template.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Error_Syntax extends Twig_Error
{
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Error;
class_exists('Twig_Error_Syntax');
if (\false) {
class SyntaxError extends \Twig_Error_Syntax
{
}
}

View File

@ -0,0 +1,29 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Adds an exists() method for loaders.
*
* @author Florin Patan <florinpatan@gmail.com>
*
* @deprecated since 1.12 (to be removed in 3.0)
*/
interface Twig_ExistsLoaderInterface
{
/**
* Check if we have the source code of a template, given its name.
*
* @param string $name The name of the template to check if we can load
*
* @return bool If the template source code is handled by this loader or not
*/
public function exists($name);
}

View File

@ -1,11 +1,625 @@
<?php
namespace Twig;
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class_exists('Twig_ExpressionParser');
/**
* Parses expressions.
*
* This parser implements a "Precedence climbing" algorithm.
*
* @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
* @see http://en.wikipedia.org/wiki/Operator-precedence_parser
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_ExpressionParser
{
const OPERATOR_LEFT = 1;
const OPERATOR_RIGHT = 2;
if (\false) {
class ExpressionParser extends \Twig_ExpressionParser
protected $parser;
protected $unaryOperators;
protected $binaryOperators;
public function __construct(Twig_Parser $parser, array $unaryOperators, array $binaryOperators)
{
$this->parser = $parser;
$this->unaryOperators = $unaryOperators;
$this->binaryOperators = $binaryOperators;
}
public function parseExpression($precedence = 0)
{
$expr = $this->getPrimary();
$token = $this->parser->getCurrentToken();
while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) {
$op = $this->binaryOperators[$token->getValue()];
$this->parser->getStream()->next();
if (isset($op['callable'])) {
$expr = call_user_func($op['callable'], $this->parser, $expr);
} else {
$expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']);
$class = $op['class'];
$expr = new $class($expr, $expr1, $token->getLine());
}
$token = $this->parser->getCurrentToken();
}
if (0 === $precedence) {
return $this->parseConditionalExpression($expr);
}
return $expr;
}
protected function getPrimary()
{
$token = $this->parser->getCurrentToken();
if ($this->isUnary($token)) {
$operator = $this->unaryOperators[$token->getValue()];
$this->parser->getStream()->next();
$expr = $this->parseExpression($operator['precedence']);
$class = $operator['class'];
return $this->parsePostfixExpression(new $class($expr, $token->getLine()));
} elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
$this->parser->getStream()->next();
$expr = $this->parseExpression();
$this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed');
return $this->parsePostfixExpression($expr);
}
return $this->parsePrimaryExpression();
}
protected function parseConditionalExpression($expr)
{
while ($this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, '?')) {
if (!$this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, ':')) {
$expr2 = $this->parseExpression();
if ($this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, ':')) {
$expr3 = $this->parseExpression();
} else {
$expr3 = new Twig_Node_Expression_Constant('', $this->parser->getCurrentToken()->getLine());
}
} else {
$expr2 = $expr;
$expr3 = $this->parseExpression();
}
$expr = new Twig_Node_Expression_Conditional($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine());
}
return $expr;
}
protected function isUnary(Twig_Token $token)
{
return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]);
}
protected function isBinary(Twig_Token $token)
{
return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]);
}
public function parsePrimaryExpression()
{
$token = $this->parser->getCurrentToken();
switch ($token->getType()) {
case Twig_Token::NAME_TYPE:
$this->parser->getStream()->next();
switch ($token->getValue()) {
case 'true':
case 'TRUE':
$node = new Twig_Node_Expression_Constant(true, $token->getLine());
break;
case 'false':
case 'FALSE':
$node = new Twig_Node_Expression_Constant(false, $token->getLine());
break;
case 'none':
case 'NONE':
case 'null':
case 'NULL':
$node = new Twig_Node_Expression_Constant(null, $token->getLine());
break;
default:
if ('(' === $this->parser->getCurrentToken()->getValue()) {
$node = $this->getFunctionNode($token->getValue(), $token->getLine());
} else {
$node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine());
}
}
break;
case Twig_Token::NUMBER_TYPE:
$this->parser->getStream()->next();
$node = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
break;
case Twig_Token::STRING_TYPE:
case Twig_Token::INTERPOLATION_START_TYPE:
$node = $this->parseStringExpression();
break;
case Twig_Token::OPERATOR_TYPE:
if (preg_match(Twig_Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue()) {
// in this context, string operators are variable names
$this->parser->getStream()->next();
$node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine());
break;
} elseif (isset($this->unaryOperators[$token->getValue()])) {
$class = $this->unaryOperators[$token->getValue()]['class'];
$ref = new ReflectionClass($class);
$negClass = 'Twig_Node_Expression_Unary_Neg';
$posClass = 'Twig_Node_Expression_Unary_Pos';
if (!(in_array($ref->getName(), array($negClass, $posClass)) || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass))) {
throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename());
}
$this->parser->getStream()->next();
$expr = $this->parsePrimaryExpression();
$node = new $class($expr, $token->getLine());
break;
}
default:
if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) {
$node = $this->parseArrayExpression();
} elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
$node = $this->parseHashExpression();
} else {
throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getFilename());
}
}
return $this->parsePostfixExpression($node);
}
public function parseStringExpression()
{
$stream = $this->parser->getStream();
$nodes = array();
// a string cannot be followed by another string in a single expression
$nextCanBeString = true;
while (true) {
if ($nextCanBeString && $token = $stream->nextIf(Twig_Token::STRING_TYPE)) {
$nodes[] = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
$nextCanBeString = false;
} elseif ($stream->nextIf(Twig_Token::INTERPOLATION_START_TYPE)) {
$nodes[] = $this->parseExpression();
$stream->expect(Twig_Token::INTERPOLATION_END_TYPE);
$nextCanBeString = true;
} else {
break;
}
}
$expr = array_shift($nodes);
foreach ($nodes as $node) {
$expr = new Twig_Node_Expression_Binary_Concat($expr, $node, $node->getLine());
}
return $expr;
}
public function parseArrayExpression()
{
$stream = $this->parser->getStream();
$stream->expect(Twig_Token::PUNCTUATION_TYPE, '[', 'An array element was expected');
$node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine());
$first = true;
while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
if (!$first) {
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma');
// trailing ,?
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
break;
}
}
$first = false;
$node->addElement($this->parseExpression());
}
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed');
return $node;
}
public function parseHashExpression()
{
$stream = $this->parser->getStream();
$stream->expect(Twig_Token::PUNCTUATION_TYPE, '{', 'A hash element was expected');
$node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine());
$first = true;
while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) {
if (!$first) {
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma');
// trailing ,?
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) {
break;
}
}
$first = false;
// a hash key can be:
//
// * a number -- 12
// * a string -- 'a'
// * a name, which is equivalent to a string -- a
// * an expression, which must be enclosed in parentheses -- (1 + 2)
if (($token = $stream->nextIf(Twig_Token::STRING_TYPE)) || ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) || $token = $stream->nextIf(Twig_Token::NUMBER_TYPE)) {
$key = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
} elseif ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
$key = $this->parseExpression();
} else {
$current = $stream->getCurrent();
throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $this->parser->getFilename());
}
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
$value = $this->parseExpression();
$node->addElement($value, $key);
}
$stream->expect(Twig_Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed');
return $node;
}
public function parsePostfixExpression($node)
{
while (true) {
$token = $this->parser->getCurrentToken();
if ($token->getType() == Twig_Token::PUNCTUATION_TYPE) {
if ('.' == $token->getValue() || '[' == $token->getValue()) {
$node = $this->parseSubscriptExpression($node);
} elseif ('|' == $token->getValue()) {
$node = $this->parseFilterExpression($node);
} else {
break;
}
} else {
break;
}
}
return $node;
}
public function getFunctionNode($name, $line)
{
switch ($name) {
case 'parent':
$this->parseArguments();
if (!count($this->parser->getBlockStack())) {
throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line, $this->parser->getFilename());
}
if (!$this->parser->getParent() && !$this->parser->hasTraits()) {
throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden', $line, $this->parser->getFilename());
}
return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line);
case 'block':
return new Twig_Node_Expression_BlockReference($this->parseArguments()->getNode(0), false, $line);
case 'attribute':
$args = $this->parseArguments();
if (count($args) < 2) {
throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename());
}
return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line);
default:
if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) {
$arguments = new Twig_Node_Expression_Array(array(), $line);
foreach ($this->parseArguments() as $n) {
$arguments->addElement($n);
}
$node = new Twig_Node_Expression_MethodCall($alias['node'], $alias['name'], $arguments, $line);
$node->setAttribute('safe', true);
return $node;
}
$args = $this->parseArguments(true);
$class = $this->getFunctionNodeClass($name, $line);
return new $class($name, $args, $line);
}
}
public function parseSubscriptExpression($node)
{
$stream = $this->parser->getStream();
$token = $stream->next();
$lineno = $token->getLine();
$arguments = new Twig_Node_Expression_Array(array(), $lineno);
$type = Twig_Template::ANY_CALL;
if ($token->getValue() == '.') {
$token = $stream->next();
if (
$token->getType() == Twig_Token::NAME_TYPE
||
$token->getType() == Twig_Token::NUMBER_TYPE
||
($token->getType() == Twig_Token::OPERATOR_TYPE && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue()))
) {
$arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
$type = Twig_TemplateInterface::METHOD_CALL;
foreach ($this->parseArguments() as $n) {
$arguments->addElement($n);
}
}
} else {
throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename());
}
if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
if (!$arg instanceof Twig_Node_Expression_Constant) {
throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s")', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename());
}
$name = $arg->getAttribute('value');
if ($this->parser->isReservedMacroName($name)) {
throw new Twig_Error_Syntax(sprintf('"%s" cannot be called as macro as it is a reserved keyword', $name), $token->getLine(), $this->parser->getFilename());
}
$node = new Twig_Node_Expression_MethodCall($node, 'get'.$name, $arguments, $lineno);
$node->setAttribute('safe', true);
return $node;
}
} else {
$type = Twig_Template::ARRAY_CALL;
// slice?
$slice = false;
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) {
$slice = true;
$arg = new Twig_Node_Expression_Constant(0, $token->getLine());
} else {
$arg = $this->parseExpression();
}
if ($stream->nextIf(Twig_Token::PUNCTUATION_TYPE, ':')) {
$slice = true;
}
if ($slice) {
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
$length = new Twig_Node_Expression_Constant(null, $token->getLine());
} else {
$length = $this->parseExpression();
}
$class = $this->getFilterNodeClass('slice', $token->getLine());
$arguments = new Twig_Node(array($arg, $length));
$filter = new $class($node, new Twig_Node_Expression_Constant('slice', $token->getLine()), $arguments, $token->getLine());
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ']');
return $filter;
}
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ']');
}
return new Twig_Node_Expression_GetAttr($node, $arg, $arguments, $type, $lineno);
}
public function parseFilterExpression($node)
{
$this->parser->getStream()->next();
return $this->parseFilterExpressionRaw($node);
}
public function parseFilterExpressionRaw($node, $tag = null)
{
while (true) {
$token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE);
$name = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
$arguments = new Twig_Node();
} else {
$arguments = $this->parseArguments(true);
}
$class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine());
$node = new $class($node, $name, $arguments, $token->getLine(), $tag);
if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '|')) {
break;
}
$this->parser->getStream()->next();
}
return $node;
}
/**
* Parses arguments.
*
* @param bool $namedArguments Whether to allow named arguments or not
* @param bool $definition Whether we are parsing arguments for a function definition
*
* @return Twig_Node
*
* @throws Twig_Error_Syntax
*/
public function parseArguments($namedArguments = false, $definition = false)
{
$args = array();
$stream = $this->parser->getStream();
$stream->expect(Twig_Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis');
while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ')')) {
if (!empty($args)) {
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma');
}
if ($definition) {
$token = $stream->expect(Twig_Token::NAME_TYPE, null, 'An argument must be a name');
$value = new Twig_Node_Expression_Name($token->getValue(), $this->parser->getCurrentToken()->getLine());
} else {
$value = $this->parseExpression();
}
$name = null;
if ($namedArguments && $token = $stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) {
if (!$value instanceof Twig_Node_Expression_Name) {
throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given', get_class($value)), $token->getLine(), $this->parser->getFilename());
}
$name = $value->getAttribute('name');
if ($definition) {
$value = $this->parsePrimaryExpression();
if (!$this->checkConstantExpression($value)) {
throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $this->parser->getFilename());
}
} else {
$value = $this->parseExpression();
}
}
if ($definition) {
if (null === $name) {
$name = $value->getAttribute('name');
$value = new Twig_Node_Expression_Constant(null, $this->parser->getCurrentToken()->getLine());
}
$args[$name] = $value;
} else {
if (null === $name) {
$args[] = $value;
} else {
$args[$name] = $value;
}
}
}
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis');
return new Twig_Node($args);
}
public function parseAssignmentExpression()
{
$targets = array();
while (true) {
$token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
if (in_array($token->getValue(), array('true', 'false', 'none'))) {
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename());
}
$targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine());
if (!$this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) {
break;
}
}
return new Twig_Node($targets);
}
public function parseMultitargetExpression()
{
$targets = array();
while (true) {
$targets[] = $this->parseExpression();
if (!$this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) {
break;
}
}
return new Twig_Node($targets);
}
protected function getFunctionNodeClass($name, $line)
{
$env = $this->parser->getEnvironment();
if (false === $function = $env->getFunction($name)) {
$message = sprintf('The function "%s" does not exist', $name);
if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFunctions()))) {
$message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
}
throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
}
if ($function instanceof Twig_SimpleFunction) {
return $function->getNodeClass();
}
return $function instanceof Twig_Function_Node ? $function->getClass() : 'Twig_Node_Expression_Function';
}
protected function getFilterNodeClass($name, $line)
{
$env = $this->parser->getEnvironment();
if (false === $filter = $env->getFilter($name)) {
$message = sprintf('The filter "%s" does not exist', $name);
if ($alternatives = $env->computeAlternatives($name, array_keys($env->getFilters()))) {
$message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
}
throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
}
if ($filter instanceof Twig_SimpleFilter) {
return $filter->getNodeClass();
}
return $filter instanceof Twig_Filter_Node ? $filter->getClass() : 'Twig_Node_Expression_Filter';
}
// checks that the node only contains "constant" elements
protected function checkConstantExpression(Twig_NodeInterface $node)
{
if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array
|| $node instanceof Twig_Node_Expression_Unary_Neg || $node instanceof Twig_Node_Expression_Unary_Pos
)) {
return false;
}
foreach ($node as $n) {
if (!$this->checkConstantExpression($n)) {
return false;
}
}
return true;
}
}

93
system/libs/twig/Extension.php Executable file
View File

@ -0,0 +1,93 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
abstract class Twig_Extension implements Twig_ExtensionInterface
{
/**
* Initializes the runtime environment.
*
* This is where you can load some file that contains filter functions for instance.
*
* @param Twig_Environment $environment The current Twig_Environment instance
*/
public function initRuntime(Twig_Environment $environment)
{
}
/**
* Returns the token parser instances to add to the existing list.
*
* @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
*/
public function getTokenParsers()
{
return array();
}
/**
* Returns the node visitor instances to add to the existing list.
*
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
*/
public function getNodeVisitors()
{
return array();
}
/**
* Returns a list of filters to add to the existing list.
*
* @return array An array of filters
*/
public function getFilters()
{
return array();
}
/**
* Returns a list of tests to add to the existing list.
*
* @return array An array of tests
*/
public function getTests()
{
return array();
}
/**
* Returns a list of functions to add to the existing list.
*
* @return array An array of functions
*/
public function getFunctions()
{
return array();
}
/**
* Returns a list of operators to add to the existing list.
*
* @return array An array of operators
*/
public function getOperators()
{
return array();
}
/**
* Returns a list of global variables to add to the existing list.
*
* @return array An array of global variables
*/
public function getGlobals()
{
return array();
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Extension;
class_exists('Twig_Extension');
if (\false) {
class AbstractExtension extends \Twig_Extension
{
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Extension;
class_exists('Twig_Extension_Core');
if (\false) {
class CoreExtension extends \Twig_Extension_Core
{
}
}

View File

@ -0,0 +1,71 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2011 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class Twig_Extension_Debug extends Twig_Extension
{
/**
* Returns a list of global functions to add to the existing list.
*
* @return array An array of global functions
*/
public function getFunctions()
{
// dump is safe if var_dump is overridden by xdebug
$isDumpOutputHtmlSafe = extension_loaded('xdebug')
// false means that it was not set (and the default is on) or it explicitly enabled
&& (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump'))
// false means that it was not set (and the default is on) or it explicitly enabled
// xdebug.overload_var_dump produces HTML only when html_errors is also enabled
&& (false === ini_get('html_errors') || ini_get('html_errors'))
|| 'cli' === php_sapi_name()
;
return array(
new Twig_SimpleFunction('dump', 'twig_var_dump', array('is_safe' => $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)),
);
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'debug';
}
}
function twig_var_dump(Twig_Environment $env, $context)
{
if (!$env->isDebug()) {
return;
}
ob_start();
$count = func_num_args();
if (2 === $count) {
$vars = array();
foreach ($context as $key => $value) {
if (!$value instanceof Twig_Template) {
$vars[$key] = $value;
}
}
var_dump($vars);
} else {
for ($i = 2; $i < $count; ++$i) {
var_dump(func_get_arg($i));
}
}
return ob_get_clean();
}

View File

@ -1,11 +0,0 @@
<?php
namespace Twig\Extension;
class_exists('Twig_Extension_Debug');
if (\false) {
class DebugExtension extends \Twig_Extension_Debug
{
}
}

View File

@ -0,0 +1,113 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class Twig_Extension_Escaper extends Twig_Extension
{
protected $defaultStrategy;
public function __construct($defaultStrategy = 'html')
{
$this->setDefaultStrategy($defaultStrategy);
}
/**
* Returns the token parser instances to add to the existing list.
*
* @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
*/
public function getTokenParsers()
{
return array(new Twig_TokenParser_AutoEscape());
}
/**
* Returns the node visitor instances to add to the existing list.
*
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
*/
public function getNodeVisitors()
{
return array(new Twig_NodeVisitor_Escaper());
}
/**
* Returns a list of filters to add to the existing list.
*
* @return array An array of filters
*/
public function getFilters()
{
return array(
new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))),
);
}
/**
* Sets the default strategy to use when not defined by the user.
*
* The strategy can be a valid PHP callback that takes the template
* "filename" as an argument and returns the strategy to use.
*
* @param mixed $defaultStrategy An escaping strategy
*/
public function setDefaultStrategy($defaultStrategy)
{
// for BC
if (true === $defaultStrategy) {
$defaultStrategy = 'html';
}
if ('filename' === $defaultStrategy) {
$defaultStrategy = array('Twig_FileExtensionEscapingStrategy', 'guess');
}
$this->defaultStrategy = $defaultStrategy;
}
/**
* Gets the default strategy to use when not defined by the user.
*
* @param string $filename The template "filename"
*
* @return string The default strategy to use for the template
*/
public function getDefaultStrategy($filename)
{
// disable string callables to avoid calling a function named html or js,
// or any other upcoming escaping strategy
if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) {
return call_user_func($this->defaultStrategy, $filename);
}
return $this->defaultStrategy;
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'escaper';
}
}
/**
* Marks a variable as being safe.
*
* @param string $string A PHP variable
*
* @return string
*/
function twig_raw_filter($string)
{
return $string;
}

Some files were not shown because too many files have changed in this diff Show More