15 $hash = spl_object_hash($node);
16 if (isset($this->data[$hash])) {
17 foreach ($this->data[$hash] as $bucket) {
18 if ($bucket[
'key'] === $node) {
19 return $bucket[
'value'];
27 $hash = spl_object_hash($node);
28 if (isset($this->data[$hash])) {
29 foreach ($this->data[$hash] as &$bucket) {
30 if ($bucket[
'key'] === $node) {
31 $bucket[
'value'] = $safe;
37 $this->data[$hash][] = array(
52 $this->
setSafe($node, array(
'all'));
55 $this->
setSafe($node, array(
'all'));
58 $this->
setSafe($node, array(
'all'));
65 $name = $node->getNode(
'filter')->getAttribute(
'value');
66 $args = $node->getNode(
'arguments');
67 if (
false !== $filter = $env->
getFilter($name)) {
68 $safe = $filter->getSafe($args);
70 $safe = $this->
intersectSafe($this->
getSafe($node->getNode(
'node')), $filter->getPreservesSafety());
78 $name = $node->getAttribute(
'name');
79 $args = $node->getNode(
'arguments');
81 if (
false !== $function) {
82 $this->
setSafe($node, $function->getSafe($args));
87 if ($node->getAttribute(
'safe')) {
88 $this->
setSafe($node, array(
'all'));
93 $name = $node->getNode(
'node')->getAttribute(
'name');
95 if (
'_self' == $name || in_array($name, $this->safeVars)) {
96 $this->
setSafe($node, array(
'all'));
101 $this->
setSafe($node, array());
109 if (null === $a || null === $b) {
113 if (in_array(
'all', $a)) {
117 if (in_array(
'all', $b)) {
121 return array_intersect($a, $b);
leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
Called after child nodes are visited.
getSafe(Twig_NodeInterface $node)
getFunction($name)
Get a function by name.
getFilter($name)
Get a filter by name.
enterNode(Twig_NodeInterface $node, Twig_Environment $env)
Called before child nodes are visited.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
getPriority()
{Returns the priority for this visitor.Priority should be between -10 and 10 (0 is the default)...
intersectSafe(array $a=null, array $b=null)
Represents a parent node.
setSafe(Twig_NodeInterface $node, array $safe)
Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
Represents a node in the AST.
Stores the Twig configuration.
Represents a block call node.