From 1a0819bdc40fd6b40b556ba1739ae71214719b43 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 24 Jun 2013 13:32:31 -0500 Subject: [PATCH] [feature/twig] Changing INCLUDEJS behavior Was: Now: Reasons for this: 1. INCLUDEJS is 3.1-dev only 2. INCLUDEJS has odd behavior to begin with (arbitrary setting root path to styles/name/ directory) 3. INCLUDEJS could not include files from outside directories or anywhere else 4. It was easier to change INCLUDEJS behavior to something more flexible and useful than hack around it to make it work as it was with Twig. PHPBB3-11598 --- phpBB/includes/template/twig/lexer.php | 6 +++--- phpBB/includes/template/twig/node/includejs.php | 5 +++-- phpBB/styles/prosilver/template/memberlist_search.html | 2 +- phpBB/styles/prosilver/template/overall_footer.html | 2 +- phpBB/styles/prosilver/template/posting_buttons.html | 4 ++-- phpBB/styles/prosilver/template/timezone_option.html | 2 +- phpBB/styles/prosilver/template/ucp_avatar_options.html | 2 +- phpBB/styles/subsilver2/template/timezone_option.html | 2 +- phpBB/styles/subsilver2/template/ucp_groups_manage.html | 2 +- phpBB/styles/subsilver2/template/ucp_profile_avatar.html | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/phpBB/includes/template/twig/lexer.php b/phpBB/includes/template/twig/lexer.php index ea161bf730..b2828c9e25 100644 --- a/phpBB/includes/template/twig/lexer.php +++ b/phpBB/includes/template/twig/lexer.php @@ -32,15 +32,15 @@ class phpbb_template_twig_lexer extends Twig_Lexer 'UNDEFINE', 'ENDDEFINE', /*'INCLUDE', - 'INCLUDEPHP', - 'INCLUDEJS',*/ + 'INCLUDEPHP',*/ + 'INCLUDEJS', 'PHP', 'ENDPHP', 'EVENT', ); // Replace with {% include 'blah.html' %} - $code = preg_replace('##', "{% INCLUDE$1 '$2' %}", $code); + $code = preg_replace('##', "{% INCLUDE$1 '$2' %}", $code); // This strips the $ inside of a tag directly after the token, which was used in #', '', $code); diff --git a/phpBB/includes/template/twig/node/includejs.php b/phpBB/includes/template/twig/node/includejs.php index 6fe8e155b7..881636a326 100644 --- a/phpBB/includes/template/twig/node/includejs.php +++ b/phpBB/includes/template/twig/node/includejs.php @@ -24,8 +24,9 @@ class phpbb_template_twig_node_includejs extends Twig_Node $compiler->addDebugInfo($this); $compiler - ->write("\$context['SCRIPTS'] .= ' - +

{L_FIND_USERNAME}

diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index ba0412ddd3..01fc3f83da 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -55,7 +55,7 @@ - + {SCRIPTS} diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index fadbc9b3ca..b3e2b85492 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -39,7 +39,7 @@ { dE('colour_palette'); e = document.getElementById('colour_palette'); - + if (e.style.display == 'block') { document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}'; @@ -52,7 +52,7 @@ // ]]> - + - + diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html index 26ba2388c9..d71166f517 100644 --- a/phpBB/styles/subsilver2/template/timezone_option.html +++ b/phpBB/styles/subsilver2/template/timezone_option.html @@ -15,6 +15,6 @@ {S_TZ_OPTIONS} - + diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html index 8064e1e6e9..5595d19b9e 100644 --- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html +++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html @@ -95,7 +95,7 @@ - + diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html index 697cceabb9..58ef499c41 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -48,6 +48,6 @@ - +