mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15538] Readding macros and requested changes
PHPBB3-15538
This commit is contained in:
@@ -23,7 +23,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \phpbb\user $user User object
|
||||
* @param \phpbb\user $user User object
|
||||
*/
|
||||
public function __construct(\phpbb\user $user)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Returns the name of this extension.
|
||||
*
|
||||
* @return string The extension name
|
||||
* @return string The extension name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return \Twig\TwigFilter[]
|
||||
* @return \Twig\TwigFilter[] Array of twig filters
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
@@ -55,7 +55,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return \Twig\TwigFunction[]
|
||||
* @return \Twig\TwigFunction[] Array of twig functions
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
@@ -77,7 +77,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
$web_path = $board_url ? generate_board_url() . '/' : $environment->get_web_root_path();
|
||||
$style_path = $this->user->style['style_path'];
|
||||
|
||||
return "{$web_path}styles/{$style_path}/template/icons/png/{$icon}.png";
|
||||
return "{$web_path}styles/{$style_path}/theme/icons/png/{$icon}.png";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class implode extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Returns the name of this extension.
|
||||
*
|
||||
* @return string The extension name
|
||||
* @return string The extension name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -28,7 +28,7 @@ class implode extends \Twig\Extension\AbstractExtension
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return \Twig\TwigFunction[]
|
||||
* @return \Twig\TwigFunction[] Array of twig functions
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
@@ -47,8 +47,8 @@ class implode extends \Twig\Extension\AbstractExtension
|
||||
* Implode_attributes('checked', {'data-ajax': 'true'})
|
||||
* Implode_attributes(['checked', {'data-ajax': 'true'}])
|
||||
*
|
||||
* @param mixed $arguments
|
||||
* @return string
|
||||
* @param mixed $arguments Attributes to implode
|
||||
* @return string The attributes string
|
||||
*/
|
||||
public function implode_attributes(...$arguments)
|
||||
{
|
||||
@@ -132,8 +132,8 @@ class implode extends \Twig\Extension\AbstractExtension
|
||||
* 'hidden-class': S_POST_HIDDEN,
|
||||
* }])
|
||||
*
|
||||
* @param mixed $arguments
|
||||
* @return string The classes string prepended with a space
|
||||
* @param mixed $arguments The classes to implode
|
||||
* @return string The classes string prepended with a space
|
||||
*/
|
||||
public function implode_classes(...$arguments)
|
||||
{
|
||||
|
@@ -23,7 +23,7 @@ class macro extends \Twig\Extension\AbstractExtension implements \Twig\Extension
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param environment $twig Twig environment object
|
||||
* @param environment $twig Twig environment object
|
||||
*/
|
||||
public function __construct(environment $twig)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ class macro extends \Twig\Extension\AbstractExtension implements \Twig\Extension
|
||||
/**
|
||||
* Returns the name of this extension.
|
||||
*
|
||||
* @return string The extension name
|
||||
* @return string The extension name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -43,22 +43,13 @@ class macro extends \Twig\Extension\AbstractExtension implements \Twig\Extension
|
||||
/**
|
||||
* Returns a list of global variables to add to the existing list.
|
||||
*
|
||||
* @return array An array of global variables
|
||||
* @throws \Twig\Error\Error
|
||||
* @return array An array of global variables
|
||||
*/
|
||||
public function getGlobals()
|
||||
{
|
||||
$macros = null;
|
||||
|
||||
try
|
||||
{
|
||||
$macros = $this->twig->loadTemplate('macros.html');
|
||||
}
|
||||
catch (\Twig\Error\Error $e)
|
||||
{
|
||||
}
|
||||
|
||||
return [
|
||||
'macros' => $macros,
|
||||
'macros' => $this->twig->loadTemplate('macros/macros.twig'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user