init web ems all
This commit is contained in:
44
phpMyAdmin/libraries/classes/Twig/CharsetsExtension.php
Executable file
44
phpMyAdmin/libraries/classes/Twig/CharsetsExtension.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\CharsetsExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class CharsetsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class CharsetsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Charsets_getCollationDescr',
|
||||
'PhpMyAdmin\Charsets::getCollationDescr'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Charsets_getCharsetDropdownBox',
|
||||
'PhpMyAdmin\Charsets::getCharsetDropdownBox',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Charsets_getCollationDropdownBox',
|
||||
'PhpMyAdmin\Charsets::getCollationDropdownBox',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
phpMyAdmin/libraries/classes/Twig/CoreExtension.php
Executable file
35
phpMyAdmin/libraries/classes/Twig/CoreExtension.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\CoreExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class CoreExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class CoreExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Core_mimeDefaultFunction',
|
||||
'PhpMyAdmin\Core::mimeDefaultFunction',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
169
phpMyAdmin/libraries/classes/Twig/I18n/NodeTrans.php
Executable file
169
phpMyAdmin/libraries/classes/Twig/I18n/NodeTrans.php
Executable file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\I18n\NodeTrans class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig\I18n;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Extensions\Node\TransNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
|
||||
/**
|
||||
* Class NodeTrans
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
class NodeTrans extends TransNode
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* The nodes are automatically made available as properties ($this->node).
|
||||
* The attributes are automatically made available as array items ($this['name']).
|
||||
*
|
||||
* @param Node $body Body of node trans
|
||||
* @param Node $plural Node plural
|
||||
* @param AbstractExpression $count Node count
|
||||
* @param Node $context Node context
|
||||
* @param Node $notes Node notes
|
||||
* @param int $lineno The line number
|
||||
* @param string $tag The tag name associated with the Node
|
||||
*/
|
||||
public function __construct(
|
||||
Node $body,
|
||||
Node $plural = null,
|
||||
AbstractExpression $count = null,
|
||||
Node $context = null,
|
||||
Node $notes = null,
|
||||
$lineno,
|
||||
$tag = null
|
||||
) {
|
||||
$nodes = array('body' => $body);
|
||||
if (null !== $count) {
|
||||
$nodes['count'] = $count;
|
||||
}
|
||||
if (null !== $plural) {
|
||||
$nodes['plural'] = $plural;
|
||||
}
|
||||
if (null !== $context) {
|
||||
$nodes['context'] = $context;
|
||||
}
|
||||
if (null !== $notes) {
|
||||
$nodes['notes'] = $notes;
|
||||
}
|
||||
|
||||
Node::__construct($nodes, array(), $lineno, $tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the node to PHP.
|
||||
*
|
||||
* @param Compiler $compiler Node compiler
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
list($msg, $vars) = $this->compileString($this->getNode('body'));
|
||||
|
||||
if ($this->hasNode('plural')) {
|
||||
list($msg1, $vars1) = $this->compileString($this->getNode('plural'));
|
||||
|
||||
$vars = array_merge($vars, $vars1);
|
||||
}
|
||||
|
||||
$function = $this->getTransFunction(
|
||||
$this->hasNode('plural'),
|
||||
$this->hasNode('context')
|
||||
);
|
||||
|
||||
if ($this->hasNode('notes')) {
|
||||
$message = trim($this->getNode('notes')->getAttribute('data'));
|
||||
|
||||
// line breaks are not allowed cause we want a single line comment
|
||||
$message = str_replace(array("\n", "\r"), ' ', $message);
|
||||
$compiler->write("// l10n: {$message}\n");
|
||||
}
|
||||
|
||||
if ($vars) {
|
||||
$compiler
|
||||
->write('echo strtr(' . $function . '(')
|
||||
->subcompile($msg)
|
||||
;
|
||||
|
||||
if ($this->hasNode('plural')) {
|
||||
$compiler
|
||||
->raw(', ')
|
||||
->subcompile($msg1)
|
||||
->raw(', abs(')
|
||||
->subcompile($this->hasNode('count') ? $this->getNode('count') : null)
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
|
||||
$compiler->raw('), array(');
|
||||
|
||||
foreach ($vars as $var) {
|
||||
if ('count' === $var->getAttribute('name')) {
|
||||
$compiler
|
||||
->string('%count%')
|
||||
->raw(' => abs(')
|
||||
->subcompile($this->hasNode('count') ? $this->getNode('count') : null)
|
||||
->raw('), ')
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->string('%' . $var->getAttribute('name') . '%')
|
||||
->raw(' => ')
|
||||
->subcompile($var)
|
||||
->raw(', ')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
$compiler->raw("));\n");
|
||||
} else {
|
||||
$compiler->write('echo ' . $function . '(');
|
||||
|
||||
if ($this->hasNode('context')) {
|
||||
$context = trim($this->getNode('context')->getAttribute('data'));
|
||||
$compiler->write('"' . $context . '", ');
|
||||
}
|
||||
|
||||
$compiler->subcompile($msg);
|
||||
|
||||
if ($this->hasNode('plural')) {
|
||||
$compiler
|
||||
->raw(', ')
|
||||
->subcompile($msg1)
|
||||
->raw(', abs(')
|
||||
->subcompile($this->hasNode('count') ? $this->getNode('count') : null)
|
||||
->raw(')')
|
||||
;
|
||||
}
|
||||
|
||||
$compiler->raw(");\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $plural Return plural or singular function to use
|
||||
* @param bool $hasMsgContext It has message context?
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getTransFunction($plural, $hasMsgContext = false)
|
||||
{
|
||||
if ($hasMsgContext) {
|
||||
return $plural ? '_ngettext' : '_pgettext';
|
||||
}
|
||||
|
||||
return $plural ? '_ngettext' : '_gettext';
|
||||
}
|
||||
}
|
||||
81
phpMyAdmin/libraries/classes/Twig/I18n/TokenParserTrans.php
Executable file
81
phpMyAdmin/libraries/classes/Twig/I18n/TokenParserTrans.php
Executable file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\I18n\TokenParserTrans class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig\I18n;
|
||||
|
||||
use Twig\Extensions\TokenParser\TransTokenParser;
|
||||
use Twig\Token;
|
||||
|
||||
/**
|
||||
* Class TokenParserTrans
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
class TokenParserTrans extends TransTokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
*
|
||||
* @param Token $token Twig token to parse
|
||||
*
|
||||
* @return Twig_NodeInterface
|
||||
*
|
||||
* @throws \Twig\Error\SyntaxError
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
$lineno = $token->getLine();
|
||||
$stream = $this->parser->getStream();
|
||||
$count = null;
|
||||
$plural = null;
|
||||
$notes = null;
|
||||
$context = null;
|
||||
|
||||
if (!$stream->test(Token::BLOCK_END_TYPE)) {
|
||||
$body = $this->parser->getExpressionParser()->parseExpression();
|
||||
} else {
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$body = $this->parser->subparse(array($this, 'decideForFork'));
|
||||
$next = $stream->next()->getValue();
|
||||
|
||||
if ('plural' === $next) {
|
||||
$count = $this->parser->getExpressionParser()->parseExpression();
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$plural = $this->parser->subparse(array($this, 'decideForFork'));
|
||||
|
||||
if ('notes' === $stream->next()->getValue()) {
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$notes = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
}
|
||||
} elseif ('context' === $next) {
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$context = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
} elseif ('notes' === $next) {
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$notes = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
}
|
||||
}
|
||||
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
|
||||
$this->checkTransString($body, $lineno);
|
||||
|
||||
return new NodeTrans($body, $plural, $count, $context, $notes, $lineno, $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the current token for a type.
|
||||
*
|
||||
* @param Token $token Twig token to test
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function decideForFork(Token $token)
|
||||
{
|
||||
return $token->test(array('plural', 'context', 'notes', 'endtrans'));
|
||||
}
|
||||
}
|
||||
42
phpMyAdmin/libraries/classes/Twig/I18nExtension.php
Executable file
42
phpMyAdmin/libraries/classes/Twig/I18nExtension.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\I18nExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Twig\I18n\TokenParserTrans;
|
||||
use Twig\Extensions\I18nExtension as TwigI18nExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
/**
|
||||
* Class I18nExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class I18nExtension extends TwigI18nExtension
|
||||
{
|
||||
/**
|
||||
* Returns the token parser instances to add to the existing list.
|
||||
*
|
||||
* @return \Twig\TokenParser\TokenParserInterface[]
|
||||
*/
|
||||
public function getTokenParsers()
|
||||
{
|
||||
return array(new TokenParserTrans());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
new TwigFilter('trans', '_gettext'),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
phpMyAdmin/libraries/classes/Twig/IndexExtension.php
Executable file
35
phpMyAdmin/libraries/classes/Twig/IndexExtension.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\IndexExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class IndexExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class IndexExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Index_getHtmlForDisplayIndexes',
|
||||
'PhpMyAdmin\Index::getHtmlForDisplayIndexes',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
45
phpMyAdmin/libraries/classes/Twig/MessageExtension.php
Executable file
45
phpMyAdmin/libraries/classes/Twig/MessageExtension.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\MessageExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Message;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class MessageExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class MessageExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Message_notice',
|
||||
function ($string) {
|
||||
return Message::notice($string)->getDisplay();
|
||||
},
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Message_error',
|
||||
function ($string) {
|
||||
return Message::error($string)->getDisplay();
|
||||
},
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
phpMyAdmin/libraries/classes/Twig/PartitionExtension.php
Executable file
35
phpMyAdmin/libraries/classes/Twig/PartitionExtension.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\PartitionExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PartitionExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PartitionExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Partition_getPartitions',
|
||||
'PhpMyAdmin\Partition::getPartitions',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
39
phpMyAdmin/libraries/classes/Twig/PhpFunctionsExtension.php
Executable file
39
phpMyAdmin/libraries/classes/Twig/PhpFunctionsExtension.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\PhpFunctionsExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PhpFunctionsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PhpFunctionsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction('array_search', 'array_search'),
|
||||
new TwigFunction('bin2hex', 'bin2hex'),
|
||||
new TwigFunction('htmlentities', 'htmlentities'),
|
||||
new TwigFunction('md5', 'md5'),
|
||||
new TwigFunction('preg_quote', 'preg_quote'),
|
||||
new TwigFunction('preg_replace', 'preg_replace'),
|
||||
new TwigFunction('strpos', 'strpos'),
|
||||
new TwigFunction('strstr', 'strstr'),
|
||||
new TwigFunction('strtotime', 'strtotime'),
|
||||
);
|
||||
}
|
||||
}
|
||||
50
phpMyAdmin/libraries/classes/Twig/PluginsExtension.php
Executable file
50
phpMyAdmin/libraries/classes/Twig/PluginsExtension.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\PluginsExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PluginsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PluginsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Plugins_checkboxCheck',
|
||||
'PhpMyAdmin\Plugins::checkboxCheck',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Plugins_getChoice',
|
||||
'PhpMyAdmin\Plugins::getChoice',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Plugins_getDefault',
|
||||
'PhpMyAdmin\Plugins::getDefault',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Plugins_getOptions',
|
||||
'PhpMyAdmin\Plugins::getOptions',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
54
phpMyAdmin/libraries/classes/Twig/RelationExtension.php
Executable file
54
phpMyAdmin/libraries/classes/Twig/RelationExtension.php
Executable file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\RelationExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Relation;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class RelationExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class RelationExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
$relation = new Relation();
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Relation_foreignDropdown',
|
||||
[$relation, 'foreignDropdown'],
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Relation_getDisplayField',
|
||||
[$relation, 'getDisplayField'],
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Relation_getForeignData',
|
||||
[$relation, 'getForeignData']
|
||||
),
|
||||
new TwigFunction(
|
||||
'Relation_getTables',
|
||||
[$relation, 'getTables']
|
||||
),
|
||||
new TwigFunction(
|
||||
'Relation_searchColumnInForeigners',
|
||||
[$relation, 'searchColumnInForeigners']
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
45
phpMyAdmin/libraries/classes/Twig/SanitizeExtension.php
Executable file
45
phpMyAdmin/libraries/classes/Twig/SanitizeExtension.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\SanitizeExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class SanitizeExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class SanitizeExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Sanitize_escapeJsString',
|
||||
'PhpMyAdmin\Sanitize::escapeJsString',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Sanitize_jsFormat',
|
||||
'PhpMyAdmin\Sanitize::jsFormat',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Sanitize_sanitize',
|
||||
'PhpMyAdmin\Sanitize::sanitize',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
phpMyAdmin/libraries/classes/Twig/ServerPrivilegesExtension.php
Executable file
35
phpMyAdmin/libraries/classes/Twig/ServerPrivilegesExtension.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\ServerPrivilegesExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class ServerPrivilegesExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class ServerPrivilegesExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'ServerPrivileges_formatPrivilege',
|
||||
'PhpMyAdmin\Server\Privileges::formatPrivilege',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
phpMyAdmin/libraries/classes/Twig/StorageEngineExtension.php
Executable file
35
phpMyAdmin/libraries/classes/Twig/StorageEngineExtension.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\StorageEngineExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class StorageEngineExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class StorageEngineExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'StorageEngine_getHtmlSelect',
|
||||
'PhpMyAdmin\StorageEngine::getHtmlSelect',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
34
phpMyAdmin/libraries/classes/Twig/TableExtension.php
Executable file
34
phpMyAdmin/libraries/classes/Twig/TableExtension.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\TableExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class TableExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class TableExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Table_get',
|
||||
'PhpMyAdmin\Table::get'
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
34
phpMyAdmin/libraries/classes/Twig/TrackerExtension.php
Executable file
34
phpMyAdmin/libraries/classes/Twig/TrackerExtension.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\TrackerExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class TrackerExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class TrackerExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Tracker_getVersion',
|
||||
'PhpMyAdmin\Tracker::getVersion'
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
38
phpMyAdmin/libraries/classes/Twig/TransformationsExtension.php
Executable file
38
phpMyAdmin/libraries/classes/Twig/TransformationsExtension.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\TransformationsExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class TransformationsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class TransformationsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Transformations_getDescription',
|
||||
'PhpMyAdmin\Transformations::getDescription'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Transformations_getName',
|
||||
'PhpMyAdmin\Transformations::getName'
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
54
phpMyAdmin/libraries/classes/Twig/UrlExtension.php
Executable file
54
phpMyAdmin/libraries/classes/Twig/UrlExtension.php
Executable file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\UrlExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class UrlExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class UrlExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Url_getHiddenInputs',
|
||||
'PhpMyAdmin\Url::getHiddenInputs',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Url_getHiddenFields',
|
||||
'PhpMyAdmin\Url::getHiddenFields',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Url_getCommon',
|
||||
'PhpMyAdmin\Url::getCommon',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Url_getCommonRaw',
|
||||
'PhpMyAdmin\Url::getCommonRaw',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Url_link',
|
||||
'PhpMyAdmin\Core::linkURL'
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
189
phpMyAdmin/libraries/classes/Twig/UtilExtension.php
Executable file
189
phpMyAdmin/libraries/classes/Twig/UtilExtension.php
Executable file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* hold PhpMyAdmin\Twig\UtilExtension class
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class UtilExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class UtilExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new TwigFunction(
|
||||
'Util_backquote',
|
||||
'PhpMyAdmin\Util::backquote'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getBrowseUploadFileBlock',
|
||||
'PhpMyAdmin\Util::getBrowseUploadFileBlock',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_convertBitDefaultValue',
|
||||
'PhpMyAdmin\Util::convertBitDefaultValue'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_escapeMysqlWildcards',
|
||||
'PhpMyAdmin\Util::escapeMysqlWildcards'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_extractColumnSpec',
|
||||
'PhpMyAdmin\Util::extractColumnSpec'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_formatByteDown',
|
||||
'PhpMyAdmin\Util::formatByteDown'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_formatNumber',
|
||||
'PhpMyAdmin\Util::formatNumber'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_formatSql',
|
||||
'PhpMyAdmin\Util::formatSql',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getButtonOrImage',
|
||||
'PhpMyAdmin\Util::getButtonOrImage',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getClassForType',
|
||||
'PhpMyAdmin\Util::getClassForType',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getDivForSliderEffect',
|
||||
'PhpMyAdmin\Util::getDivForSliderEffect',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getDocuLink',
|
||||
'PhpMyAdmin\Util::getDocuLink',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getListNavigator',
|
||||
'PhpMyAdmin\Util::getListNavigator',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_showDocu',
|
||||
'PhpMyAdmin\Util::showDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getDropdown',
|
||||
'PhpMyAdmin\Util::getDropdown',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getFKCheckbox',
|
||||
'PhpMyAdmin\Util::getFKCheckbox',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getGISDatatypes',
|
||||
'PhpMyAdmin\Util::getGISDatatypes'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getGISFunctions',
|
||||
'PhpMyAdmin\Util::getGISFunctions'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getHtmlTab',
|
||||
'PhpMyAdmin\Util::getHtmlTab',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getIcon',
|
||||
'PhpMyAdmin\Util::getIcon',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getImage',
|
||||
'PhpMyAdmin\Util::getImage',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getRadioFields',
|
||||
'PhpMyAdmin\Util::getRadioFields',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getSelectUploadFileBlock',
|
||||
'PhpMyAdmin\Util::getSelectUploadFileBlock',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getScriptNameForOption',
|
||||
'PhpMyAdmin\Util::getScriptNameForOption',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getStartAndNumberOfRowsPanel',
|
||||
'PhpMyAdmin\Util::getStartAndNumberOfRowsPanel',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_getSupportedDatatypes',
|
||||
'PhpMyAdmin\Util::getSupportedDatatypes',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_isForeignKeySupported',
|
||||
'PhpMyAdmin\Util::isForeignKeySupported'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_linkOrButton',
|
||||
'PhpMyAdmin\Util::linkOrButton',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_localisedDate',
|
||||
'PhpMyAdmin\Util::localisedDate'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_showHint',
|
||||
'PhpMyAdmin\Util::showHint',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_showDocu',
|
||||
'PhpMyAdmin\Util::showDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_showIcons',
|
||||
'PhpMyAdmin\Util::showIcons'
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_showMySQLDocu',
|
||||
'PhpMyAdmin\Util::showMySQLDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new TwigFunction(
|
||||
'Util_sortableTableHeader',
|
||||
'PhpMyAdmin\Util::sortableTableHeader',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user