aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-07-01 12:26:01 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-07-01 12:26:01 -0500
commit6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0 (patch)
tree5a8fa3f36e722c4c350640cef3e74a1f920b47f9
parente9bbeeb1a4c7d1c4b1d35848ff58f31af4483d07 (diff)
downloadforums-6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0.tar
forums-6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0.tar.gz
forums-6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0.tar.bz2
forums-6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0.tar.xz
forums-6c30441ad4a20fe4f154d5a859b9df0f28cbc8e0.zip
[feature/twig] Changing INCLUDEJS behavior slightly
Automatically parsing inline variables the same way it is done for INCLUDE, INCLUDEPHP PHPBB3-11598
-rw-r--r--phpBB/includes/template/twig/lexer.php1
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html2
-rw-r--r--phpBB/styles/prosilver/template/timezone_option.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options.html2
-rw-r--r--phpBB/styles/subsilver2/template/timezone_option.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_manage.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_avatar.html2
-rw-r--r--tests/template/templates/includejs.html12
10 files changed, 15 insertions, 14 deletions
diff --git a/phpBB/includes/template/twig/lexer.php b/phpBB/includes/template/twig/lexer.php
index 131cf654ef..d9cc6f60ce 100644
--- a/phpBB/includes/template/twig/lexer.php
+++ b/phpBB/includes/template/twig/lexer.php
@@ -44,6 +44,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer
'DEFINE.+=',
'INCLUDE',
'INCLUDEPHP',
+ 'INCLUDEJS',
), $code);
// Fix our BEGIN statements
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 97769b6155..6d2d87a278 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -38,7 +38,7 @@ function insert_single(user)
// ]]>
</script>
<!-- ENDIF -->
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/forum_fn.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/forum_fn.js -->
<h2 class="solo">{L_FIND_USERNAME}</h2>
<form method="post" action="{S_MODE_ACTION}" id="search_memberlist">
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 01fc3f83da..5422cc7c10 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -55,7 +55,7 @@
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js?assets_version={T_ASSETS_VERSION}"></script>
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/ajax.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/ajax.js -->
{SCRIPTS}
<!-- EVENT overall_footer_after -->
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index b3e2b85492..164e887f75 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -52,7 +52,7 @@
// ]]>
</script>
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/editor.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/editor.js -->
<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html
index 95b30dbcd1..ebcf51a906 100644
--- a/phpBB/styles/prosilver/template/timezone_option.html
+++ b/phpBB/styles/prosilver/template/timezone_option.html
@@ -15,6 +15,6 @@
{S_TZ_OPTIONS}
</select>
- <!-- INCLUDEJS T_TEMPLATE_PATH ~ '/timezone.js' -->
+ <!-- INCLUDEJS {T_TEMPLATE_PATH}/timezone.js -->
</dd>
</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html
index 4f4aef3ff9..02c7868afb 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html
@@ -47,4 +47,4 @@
</div>
</div>
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/avatars.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/avatars.js -->
diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html
index d71166f517..9b68f81557 100644
--- a/phpBB/styles/subsilver2/template/timezone_option.html
+++ b/phpBB/styles/subsilver2/template/timezone_option.html
@@ -15,6 +15,6 @@
{S_TZ_OPTIONS}
</select>
- <!-- INCLUDEJS T_TEMPLATE_PATH ~ '/timezone.js' -->
+ <!-- INCLUDEJS {T_TEMPLATE_PATH}/timezone.js -->
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
index 5595d19b9e..13b8b8c6b7 100644
--- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html
+++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
@@ -95,7 +95,7 @@
</tr>
</table>
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/avatars.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/avatars.js -->
<!-- ELSEIF S_LIST -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
index 58ef499c41..885d46ef0b 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
@@ -48,6 +48,6 @@
</tr>
</table>
-<!-- INCLUDEJS T_TEMPLATE_PATH ~ '/avatars.js' -->
+<!-- INCLUDEJS {T_TEMPLATE_PATH}/avatars.js -->
<!-- INCLUDE ucp_footer.html -->
diff --git a/tests/template/templates/includejs.html b/tests/template/templates/includejs.html
index eca6e90637..ef73700eeb 100644
--- a/tests/template/templates/includejs.html
+++ b/tests/template/templates/includejs.html
@@ -1,8 +1,8 @@
-<!-- INCLUDEJS 'parent_and_child.js' -->
-<!-- INCLUDEJS PARENT -->
+<!-- INCLUDEJS parent_and_child.js -->
+<!-- INCLUDEJS {PARENT} -->
<!-- DEFINE $TEST = 'child_only.js' -->
-<!-- INCLUDEJS TEST -->
-<!-- INCLUDEJS 'subdir/' ~ PARENT -->
-<!-- INCLUDEJS SUBDIR ~ '/subsubdir/' ~ PARENT -->
-<!-- INCLUDEJS SUBDIR ~ '/parent_only.' ~ EXT -->
+<!-- INCLUDEJS {$TEST} -->
+<!-- INCLUDEJS subdir/{PARENT} -->
+<!-- INCLUDEJS {SUBDIR}/subsubdir/{PARENT} -->
+<!-- INCLUDEJS {SUBDIR}/parent_only.{EXT} -->
{SCRIPTS}