Nathan Guse
8d11a147f5
[feature/twig] Use Twig mask for IF statements instead of our own tokenparser
...
PHPBB3-11598
2013-07-05 14:10:57 -05:00
Nathan Guse
0ffbdc80d1
[feature/twig] context_recursive_loop_builder isn't used anymore, removing it
...
PHPBB3-11598
2013-07-05 13:15:10 -05:00
Nathan Guse
c5c34ff831
[feature/twig] Add check for defined IN_PHPBB in all new Twig related files
...
PHPBB3-11598
2013-07-05 13:10:35 -05:00
Nathan Guse
99ddbe1adc
[feature/twig] Can't use typehint here, causes tests to fail
...
PHPBB3-11598
2013-07-05 12:55:32 -05:00
Nathan Guse
81f0715b8e
[feature/twig] Clarify comment
...
PHPBB3-11598
2013-07-05 10:05:20 -05:00
Nathan Guse
2674740573
[feature/twig] Spacing
...
PHPBB3-11598
2013-07-05 10:03:48 -05:00
Nathan Guse
576d8d7072
[feature/twig] Docs/typehinting for Twig extension
...
PHPBB3-11598
2013-07-05 09:56:25 -05:00
Nathaniel Guse
fdbdd8bfd9
[feature/twig] Fix a regular expression
...
PHPBB3-11598
2013-07-04 13:22:41 -05:00
Nathaniel Guse
864465761f
[feature/twig] Fix debug code
...
PHPBB3-11598
2013-07-04 13:19:03 -05:00
Nathaniel Guse
5f03321fac
[feature/twig] Support using Twig filters on {VAR}, add masks for Twig tags
...
Now we can do {L_TITLE|upper}, {SITENAME|lower}, etc
We can also use all the Twig tags in our own syntax. E.g. <!-- BLOCK foo -->
= {% block foo %]. All tags are the same as the Twig tag names, but are
in uppercase.
PHPBB3-11598
2013-07-04 12:44:12 -05:00
Nathaniel Guse
84e0943c7b
[feature/twig] Indentation and comments
...
PHPBB3-11598
2013-07-04 10:22:12 -05:00
Nathaniel Guse
36f25ea09b
[feature/twig] Change style->set_style to accept a list of base directories
...
set_style now accepts an array containing a list of paths, e.g. array(
'ext/foo/bar/styles', 'styles'). Default: array('styles')
Using this option allows us to set the style based on the user's preferred
style (including the full tree), but use one or more base directories to
add the paths from.
The main use for this ability is so that extensions can call set_style,
including their path and the phpBB styles path (or any others) and have
their template files loaded from those directories (in the order given).
PHPBB3-11598
2013-07-04 10:12:09 -05:00
Nathaniel Guse
9652483ef4
[feature/twig] Fix begin loop var regex
...
PHPBB3-11598
2013-07-02 14:24:48 -05:00
Nathaniel Guse
57c2d99e65
[feature/twig] Fix indentation
...
PHPBB3-11598
2013-07-02 12:34:16 -05:00
Nathaniel Guse
f102f609f5
[feature/twig] Remove getCacheFilename function I was working on
...
This can be addressed later if we decide we want to have more nicely named
cache files. It does not need to be addressed now
PHPBB3-11598
2013-07-02 12:23:42 -05:00
Nathaniel Guse
985a233a78
[feature/twig] Remove reference to cachepath, it is not used publicly anymore
...
PHPBB3-11598
2013-07-02 12:22:42 -05:00
Nathaniel Guse
f39edcea3f
[feature/twig] Check the template context for language vars
...
We output some language vars to the context (e.g. L_TITLE in the ACP). These
do not exist in user->lang, so we must check the context vars first, if not
in context, we output the result of user->lang.
PHPBB3-11598
2013-07-02 12:17:56 -05:00
Nathaniel Guse
709b3e9803
[feature/twig] Fix BBCode parser
...
PHPBB3-11598
2013-07-02 11:29:32 -05:00
Nathaniel Guse
02a8150bb6
[feature/twig] INCLUDEPHP behavior now supports local relative paths
...
As a last resort, now we use the Twig Loader to find the correct file to
include to (most specific file first, then parent styles). Also allows
using @namespace convention. This is ONLY done if the specified path is not
an absolute path AND the file does not exist relative to the phpBB root path.
PHPBB3-11598
2013-07-02 11:08:52 -05:00
Nathaniel Guse
59d13d0535
[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
2013-07-02 11:07:12 -05:00
Nathaniel Guse
156d5c671f
[feature/twig] INCLUDEJS now uses the definition class
...
This had to be done because, like DEFINE, setting variables to $context
only affected the local file and any children, not parent templates.
PHPBB3-11598
2013-07-02 10:13:16 -05:00
Nathaniel Guse
883b0a9f8c
[feature/twig] Update phpbb_template interface
...
Return $this wherever possible
PHPBB3-11598
2013-07-01 21:44:00 -05:00
Nathaniel Guse
3b9cb7faa7
[feature/twig] Fix call for previous change to var name case
...
PHPBB3-11598
2013-07-01 21:29:15 -05:00
Nathaniel Guse
f902523956
[feature/twig] Comments
...
PHPBB3-11598
2013-07-01 21:24:27 -05:00
Nathaniel Guse
3dc40ad844
[feature/twig] Use correct case for variable name
...
PHPBB3-11598
2013-07-01 21:22:50 -05:00
Nathaniel Guse
e0f5e23032
[feature/twig] Fixed tabs in environment.php
...
PHPBB3-11598
2013-07-01 21:21:37 -05:00
Nathaniel Guse
8f303b376b
[feature/twig] Don't forget to set the context when rendering!
...
PHPBB3-11598
2013-07-01 21:16:36 -05:00
Nathaniel Guse
1c7e077fea
[feature/twig] Remove get_lang function (it's not used anywhere)
...
PHPBB3-11598
2013-07-01 21:11:24 -05:00
Nathaniel Guse
46d6899b46
[feature/twig] Do not assign var by reference
...
PHPBB3-11598
2013-07-01 20:41:36 -05:00
Nathaniel Guse
943728d3ef
[feature/twig] Fix length replace in lexer
...
PHPBB3-11598
2013-07-01 14:58:20 -05:00
Nathaniel Guse
1a58d188aa
[feature/twig] Prevent errors from empty user->style
...
PHPBB3-11598
2013-07-01 14:42:05 -05:00
Nathaniel Guse
d7cff78443
[feature/twig] Use adm_relative_path to build admin namespace
...
PHPBB3-11598
2013-07-01 13:39:51 -05:00
Nathaniel Guse
793ee3f8d9
[feature/twig] Remove debug code, set debug/auto reload correctly
...
PHPBB3-11598
2013-07-01 13:32:43 -05:00
Nathaniel Guse
bdc05b7dc8
[feature/twig] Remove resource locator dependency from template
...
PHPBB3-11598
2013-07-01 13:28:08 -05:00
Nathaniel Guse
341bae40eb
[feature/twig] Remove the twig loader class that I started (don't use it)
...
PHPBB3-11598
2013-07-01 12:58:31 -05:00
Nathaniel Guse
6c30441ad4
[feature/twig] Changing INCLUDEJS behavior slightly
...
Automatically parsing inline variables the same way it is done for
INCLUDE, INCLUDEPHP
PHPBB3-11598
2013-07-01 12:26:01 -05:00
Nathaniel Guse
e9bbeeb1a4
[feature/twig] Fix includephp node
...
PHPBB3-11598
2013-07-01 12:23:25 -05:00
Nathaniel Guse
ddaccaf63e
[feature/twig] A bit of cleanup in twig.php
...
PHPBB3-11598
2013-07-01 11:52:03 -05:00
Nathaniel Guse
42e3a4bfb9
[feature/twig] Add addslashes filter (to use on LA_ instead of escape)
...
To match previous parser behavior
PHPBB3-11598
2013-07-01 10:17:58 -05:00
Nathaniel Guse
8d3fd1fcdd
[feature/twig] Remove the get_rootref and get_tpldata functions prev added
...
These are not really necessary
PHPBB3-11598
2013-07-01 09:38:51 -05:00
Nathaniel Guse
9749405129
[feature/twig] Transform {L_, {LA_ to use the lang() function
...
PHPBB3-11598
2013-07-01 09:32:21 -05:00
Nathaniel Guse
658d1b6afe
[feature/twig] Fixing include node
...
PHPBB3-11598
2013-07-01 09:20:46 -05:00
Nathaniel Guse
ecdc73a81a
[feature/twig] Fixing define node
...
PHPBB3-11598
2013-07-01 09:19:54 -05:00
Nathaniel Guse
2c55671767
[feature/twig] Fixing div by replacement
...
PHPBB3-11598
2013-07-01 09:19:30 -05:00
Nathaniel Guse
c49d27329d
[feature/twig] Adding ! operator
...
PHPBB3-11598
2013-07-01 09:18:58 -05:00
Nathaniel Guse
82aa4edeab
[feature/twig] Adding some operators to the extension
...
PHPBB3-11598
2013-06-29 19:22:01 -05:00
Nathaniel Guse
f18cbd50f0
[feature/twig] Fixing more stuff for DEFINE/INCLUDE
...
PHPBB3-11598
2013-06-29 19:19:18 -05:00
Nathaniel Guse
64963b5962
[feature/twig] Fixing DEFINE statements
...
PHPBB3-11598
2013-06-29 11:07:10 -05:00
Nathaniel Guse
abb7901edb
[feature/twig] New Twig filter, subset
...
This filter grabs a subset of a loop for output (according to past
functionality).
PHPBB3-11598
2013-06-28 15:40:30 -05:00
Nathaniel Guse
09ed0dd7bc
[feature/twig] Replace BEGIN with Twig for using Lexer
...
No longer using the begin tokenparser/node as it did not allow proper
handling of <!-- BEGIN !foo, <!-- BEGIN foo(0,2). Now the lexer will
use regular expressions to handle that correctly and replace it with Twig's
for token
Also fixing <!-- IF .foo as I discovered it evaluates to if sizeof(foo)
PHPBB3-11598
2013-06-26 12:30:59 -05:00