From 59d13d0535ab3687725d36f2dbe2ee64de294df8 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Tue, 2 Jul 2013 11:02:55 -0500 Subject: [feature/twig] INCLUDEJS behavior now supports local relative paths This was done because T_TEMPLATE_PATH is not always correct for js files (e.g. the inheriting style does not include these). Now we use the Twig Loader to find the correct file to link to (most specific file first, then parent styles). Also allows using @namespace convention PHPBB3-11598 --- phpBB/includes/template/twig/node/includejs.php | 12 ++++++++++-- phpBB/styles/prosilver/template/memberlist_search.html | 2 +- phpBB/styles/prosilver/template/overall_footer.html | 6 +++--- phpBB/styles/prosilver/template/posting_buttons.html | 2 +- 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 +- 9 files changed, 20 insertions(+), 12 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/template/twig/node/includejs.php b/phpBB/includes/template/twig/node/includejs.php index bba5d4ef91..91b24e8068 100644 --- a/phpBB/includes/template/twig/node/includejs.php +++ b/phpBB/includes/template/twig/node/includejs.php @@ -31,9 +31,17 @@ class phpbb_template_twig_node_includejs extends Twig_Node $config = $this->environment->get_phpbb_config(); $compiler - ->write("\$context['definition']->append('SCRIPTS', '');\n") + ->raw(";\n") + ->write("if (!file_exists(\$js_file)) {\n") + ->indent() + ->write("\$js_file = \$this->getEnvironment()->getLoader()->getCacheKey(\$js_file);\n") + ->outdent() + ->write("}\n") + ->write("\$context['definition']->append('SCRIPTS', '\n');\n") ; } } diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index 6d2d87a278..4f029627fc 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) // ]]> - +

{L_FIND_USERNAME}

diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index dcb8058ee1..5c88209ad8 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -53,9 +53,9 @@ - - - + + + {$SCRIPTS} diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 164e887f75..8a153a5ee8 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -52,7 +52,7 @@ // ]]> - + - + diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html index 9b68f81557..0f27719f86 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 13b8b8c6b7..b8e7e29481 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 885d46ef0b..60a816d00a 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -48,6 +48,6 @@ - + -- cgit v1.2.1