1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 04:42:04 +02:00

[ticket/13508] Switch back to current include format

PHPBB3-13508
This commit is contained in:
Marc Alexander 2021-10-17 13:20:22 +02:00
parent 97034e0776
commit 056fb494b1
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
5 changed files with 20 additions and 76 deletions

View File

@ -60,9 +60,7 @@ class extension extends \Twig\Extension\AbstractExtension
return array(
new \phpbb\template\twig\tokenparser\defineparser,
new \phpbb\template\twig\tokenparser\includeparser,
new \phpbb\template\twig\tokenparser\include_js,
new \phpbb\template\twig\tokenparser\includejs,
new \phpbb\template\twig\tokenparser\include_css,
new \phpbb\template\twig\tokenparser\includecss,
new \phpbb\template\twig\tokenparser\event($this->environment),
new \phpbb\template\twig\tokenparser\includephp($this->environment),

View File

@ -1,27 +0,0 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
class include_css extends includecss
{
/**
* Gets the tag name associated with this token parser.
*
* @return string The tag name
*/
public function getTag(): string
{
return 'include_css';
}
}

View File

@ -1,27 +0,0 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\template\twig\tokenparser;
class include_js extends includejs
{
/**
* Gets the tag name associated with this token parser.
*
* @return string The tag name
*/
public function getTag(): string
{
return 'include_js';
}
}

View File

@ -1,10 +1,10 @@
{% if TEST === 1 %}
{% include_css('child_only.css') %}
{% INCLUDECSS('child_only.css') %}
{% elseif TEST === 2 %}
{% include_css('parent_only.css') %}
{% INCLUDECSS('parent_only.css') %}
{% elseif TEST === 3 %}
{% include_css('@include_css/test.css') %}
{% INCLUDECSS('@include_css/test.css') %}
{% elseif TEST === 4 %}
{% include_css('@include_css/child_only.css') %}
{% INCLUDECSS('@include_css/child_only.css') %}
{% endif %}
{$STYLESHEETS}

View File

@ -1,36 +1,36 @@
{% if TEST === 1 %}
{% include_js('parent_and_child.js') %}
{% INCLUDEJS('parent_and_child.js') %}
{% elseif TEST === 2 %}
{% include_js('parent_and_child.js?assets_version=0') %}
{% INCLUDEJS('parent_and_child.js?assets_version=0') %}
{% elseif TEST === 3 %}
{% include_js('parent_and_child.js?test=1&assets_version=0') %}
{% INCLUDEJS('parent_and_child.js?test=1&assets_version=0') %}
{% elseif TEST === 4 %}
{% include_js('parent_and_child.js?test=1&amp;assets_version=0') %}
{% INCLUDEJS('parent_and_child.js?test=1&amp;assets_version=0') %}
{% elseif TEST === 6 %}
{% include_js(PARENT) %}
{% INCLUDEJS(PARENT) %}
{% elseif TEST === 7 %}
{% set test_var = 'child_only.js' %}
{% include_js(test_var) %}
{% INCLUDEJS(test_var) %}
{% elseif TEST === 8 %}
{% include_js('subdir/' ~ PARENT) %}
{% INCLUDEJS('subdir/' ~ PARENT) %}
{% elseif TEST === 9 %}
{% include_js(SUBDIR ~ '/subsubdir/' ~ PARENT) %}
{% INCLUDEJS(SUBDIR ~ '/subsubdir/' ~ PARENT) %}
{% elseif TEST === 10 %}
{% include_js(SUBDIR ~ '/parent_only.' ~ EXT) %}
{% INCLUDEJS(SUBDIR ~ '/parent_only.' ~ EXT) %}
{% elseif TEST === 11 %}
{% set test_var = 'child_only.js?test1=1&amp;test2=2#test3' %}
{% include_js(test_var) %}
{% INCLUDEJS(test_var) %}
{% elseif TEST === 12 %}
{% include_js('parent_only.js?test1=1&amp;test2=2#test3') %}
{% INCLUDEJS('parent_only.js?test1=1&amp;test2=2#test3') %}
{% elseif TEST === 14 %}
{% include_js('parent_only.js?test1=&quot;#test3') %}
{% INCLUDEJS('parent_only.js?test1=&quot;#test3') %}
{% elseif TEST === 15 %}
{% include_js('http://phpbb.com/b.js?c=d#f') %}
{% INCLUDEJS('http://phpbb.com/b.js?c=d#f') %}
{% elseif TEST === 16 %}
{% include_js('http://phpbb.com/b.js?c=d&assets_version=2#f') %}
{% INCLUDEJS('http://phpbb.com/b.js?c=d&assets_version=2#f') %}
{% elseif TEST === 17 %}
{% include_js('//phpbb.com/b.js') %}
{% INCLUDEJS('//phpbb.com/b.js') %}
{% elseif TEST === 18 %}
{% include_js('parent_and_child.js?test=1&test2=0') %}
{% INCLUDEJS('parent_and_child.js?test=1&test2=0') %}
{% endif %}
{$SCRIPTS}