czaks
11 years ago
47 changed files with 876 additions and 206 deletions
@ -0,0 +1,60 @@ |
|||||
|
<?php |
||||
|
|
||||
|
/* |
||||
|
* This file is part of Twig. |
||||
|
* |
||||
|
* (c) 2012 Fabien Potencier |
||||
|
* |
||||
|
* For the full copyright and license information, please view the LICENSE |
||||
|
* file that was distributed with this source code. |
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Represents a macro call node. |
||||
|
* |
||||
|
* @author Martin Hasoň <martin.hason@gmail.com> |
||||
|
*/ |
||||
|
class Twig_Node_Expression_MacroCall extends Twig_Node_Expression |
||||
|
{ |
||||
|
public function __construct(Twig_Node_Expression $template, $name, Twig_Node_Expression_Array $arguments, $lineno) |
||||
|
{ |
||||
|
parent::__construct(array('template' => $template, 'arguments' => $arguments), array('name' => $name), $lineno); |
||||
|
} |
||||
|
|
||||
|
public function compile(Twig_Compiler $compiler) |
||||
|
{ |
||||
|
$namedNames = array(); |
||||
|
$namedCount = 0; |
||||
|
$positionalCount = 0; |
||||
|
foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { |
||||
|
$name = $pair['key']->getAttribute('value'); |
||||
|
if (!is_int($name)) { |
||||
|
$namedCount++; |
||||
|
$namedNames[$name] = 1; |
||||
|
} elseif ($namedCount > 0) { |
||||
|
throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for macro "%s".', $this->getAttribute('name')), $this->lineno); |
||||
|
} else { |
||||
|
$positionalCount++; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$compiler |
||||
|
->raw('$this->callMacro(') |
||||
|
->subcompile($this->getNode('template')) |
||||
|
->raw(', ')->repr($this->getAttribute('name')) |
||||
|
->raw(', ')->subcompile($this->getNode('arguments')) |
||||
|
; |
||||
|
|
||||
|
if ($namedCount > 0) { |
||||
|
$compiler |
||||
|
->raw(', ')->repr($namedNames) |
||||
|
->raw(', ')->repr($namedCount) |
||||
|
->raw(', ')->repr($positionalCount) |
||||
|
; |
||||
|
} |
||||
|
|
||||
|
$compiler |
||||
|
->raw(')') |
||||
|
; |
||||
|
} |
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
{% for ban in ban_appeals %} |
||||
|
|
||||
|
<form action="" method="post" style="margin: 10px 0"> |
||||
|
<input type="hidden" name="token" value="{{ token }}"> |
||||
|
<table style="margin: 5px 0"> |
||||
|
<tr> |
||||
|
<th>{% trans 'Status' %}</th> |
||||
|
<td> |
||||
|
{% if config.mod.view_banexpired and ban.expires != 0 and ban.expires < time() %} |
||||
|
{% trans 'Expired' %} |
||||
|
{% else %} |
||||
|
{% trans 'Active' %} |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
{% if mod|hasPermission(config.mod.show_ip, board.uri) %} |
||||
|
<tr> |
||||
|
<th>{% trans 'IP' %}</th> |
||||
|
<td>{{ ban.mask }}</td> |
||||
|
</tr> |
||||
|
{% endif %} |
||||
|
<tr> |
||||
|
<th>{% trans 'Reason' %}</th> |
||||
|
<td> |
||||
|
{% if ban.reason %} |
||||
|
{{ ban.reason }} |
||||
|
{% else %} |
||||
|
<em>{% trans 'no reason' %}</em> |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Board' %}</th> |
||||
|
<td> |
||||
|
{% if ban.board %} |
||||
|
{{ config.board_abbreviation|sprintf(ban.board) }} |
||||
|
{% else %} |
||||
|
<em>{% trans 'all boards' %}</em> |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Set' %}</th> |
||||
|
<td>{{ ban.created|date(config.post_date) }}</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Expires' %}</th> |
||||
|
<td> |
||||
|
{% if ban.expires %} |
||||
|
{{ ban.expires|date(config.post_date) }} |
||||
|
{% else %} |
||||
|
<em>{% trans 'never' %}</em> |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Seen' %}</th> |
||||
|
<td> |
||||
|
{% if ban.seen %} |
||||
|
{% trans 'Yes' %} |
||||
|
{% else %} |
||||
|
{% trans 'No' %} |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Staff' %}</th> |
||||
|
<td> |
||||
|
{% if ban.username %} |
||||
|
{{ ban.username|e }} |
||||
|
{% else %} |
||||
|
<em>{% trans 'deleted?' %}</em> |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
|
||||
|
<table style="margin: 10px 0"> |
||||
|
<tr> |
||||
|
<th>{% trans 'Appeal time' %}</th> |
||||
|
<td>{{ ban.time|date(config.post_date) }}</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th>{% trans 'Appeal reason' %}</th> |
||||
|
<td>{{ ban.message|e }}</td> |
||||
|
</tr> |
||||
|
{% if mod|hasPermission(config.mod.ban_appeals, board.uri) %} |
||||
|
<tr> |
||||
|
<th>{% trans 'Action' %}</th> |
||||
|
<td> |
||||
|
<input type="hidden" name="appeal_id" value="{{ ban.id }}"> |
||||
|
<input type="submit" name="unban" value="Unban"> |
||||
|
<input type="submit" name="deny" value="Deny appeal"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
{% endif %} |
||||
|
</table> |
||||
|
|
||||
|
{% if ban.post %} |
||||
|
<div style=""> |
||||
|
{{ ban.post.build(true) }} |
||||
|
</div> |
||||
|
{% endif %} |
||||
|
</form> |
||||
|
<hr> |
||||
|
|
||||
|
{% endfor %} |
@ -0,0 +1,18 @@ |
|||||
|
<table class="modlog"> |
||||
|
<tr> |
||||
|
<th class="minimal">Key</th> |
||||
|
<th class="minimal">Hits</th> |
||||
|
<th class="minimal">Created</th> |
||||
|
<th class="minimal">Expires</th> |
||||
|
<th class="minimal">Size</th> |
||||
|
</tr> |
||||
|
{% for var in cached_vars if (var.ctime is defined ? var.ctime : var.creation_time) + var.ttl > time() %} |
||||
|
<tr> |
||||
|
<td class="minimal">{{ var.key is defined ? var.key : var.info }}</td> |
||||
|
<td class="minimal">{{ var.nhits is defined ? var.nhits : var.num_hits }}</td> |
||||
|
<td class="minimal">{{ (var.ctime is defined ? var.ctime : var.creation_time)|ago }} ago</td> |
||||
|
<td class="minimal">{{ ((var.ctime is defined ? var.ctime : var.creation_time) + var.ttl)|until }} (ttl: {{ (time() + var.ttl)|until }})</td> |
||||
|
<td class="minimal">{{ var.mem_size }} bytes</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</table> |
Loading…
Reference in new issue