Revisions for framework/Template/Template.php

Location: [ Horde ] / framework / Template / Template.php View: Logs | Branches | Statistics
Search Revisions:
Show diffs between and
Show Differences shows diffs to the previous revision. If you select a revision by clicking its row, Show Differences will show the differences to the selected row.
Show Branch:
  Revision Date Author Log Message
1.38.10.14 FRAMEWORK_3 (+90 -2 lines) 04/16/2008 03:04 PM Chuck Hagenbuch chuck

MFH 1.75

Tags: HORDE_3_3, HORDE_3_3_RC1, HORDE_3_2_2, HORDE_3_2_1, HORDE_3_2, HORDE_3_2_RC4

1.75 (+90 -2 lines) 04/16/2008 03:02 PM Chuck Hagenbuch chuck

Restore case-loop feature (cloop) for BC

1.38.10.13 FRAMEWORK_3 (+2 -2 lines) 01/02/2008 06:30 AM Jan Schneider jan

Happy New Year

Tags: HORDE_3_2_RC3, HORDE_3_2_RC2

1.74 (+2 -2 lines) 01/02/2008 06:12 AM Jan Schneider jan

Happy New Year

1.38.10.12 FRAMEWORK_3 (+31 -254 lines) 12/20/2007 08:49 AM Jan Schneider jan

Merge from HEAD.

1.38.10.11 FRAMEWORK_3 (+2 -2 lines) 01/02/2007 08:54 AM Jan Schneider jan

Happy New Year

Tags: HORDE_3_1_9, HORDE_3_1_8, HORDE_3_1_7, HORDE_3_1_6, HORDE_3_1_5, HORDE_3_1_4, HORDE_3_1_4_RC1

1.73 (+2 -2 lines) 01/02/2007 07:47 AM Jan Schneider jan

Happy New Year

Tags: BEFORE_MERGE_3_2, HORDE_3_2_RC1, HORDE_3_2_ALPHA

1.72 (+2 -2 lines) 01/01/2007 07:40 PM Jan Schneider jan

Assign copyright to The Horde Project for those copyright holders that already agreed to it.

1.71 (+240 -266 lines) 12/18/2006 03:34 PM Chuck Hagenbuch chuck

Restore previous Horde_Template class until Horde 4.0.

1.70 (+2 -2 lines) 12/15/2006 03:50 PM Michael M Slusarz slusarz

ack! again!

1.69 (+5 -4 lines) 12/15/2006 03:49 PM Michael M Slusarz slusarz

Fix divider output.  Add divider test.

1.68 (+2 -2 lines) 12/15/2006 02:33 PM Michael M Slusarz slusarz

whoops - keep debug code on for now.

1.67 (+11 -17 lines) 12/15/2006 02:31 PM Michael M Slusarz slusarz

Remove nested tags test for now.  Convert to am more complete associative
array test instead.  Horde_Template:: now passes all tests.

1.66 (+271 -240 lines) 12/15/2006 01:43 AM Michael M Slusarz slusarz

After heavily testing for several days, all templates I can find in Horde
applications are working.  So go ahead and commit the new Template code.
Drastically reduces template display time (approx 4x - 7x), with additional
improvements once we turn on caching code (which is currently disabled).
Refactor some tests to account for some tiny differences in new output (mostly
dealing with whitespace output, which makes no difference when it comes to
actual display, and also with the fact we no longer output empty tags to HTML -
they are silently discarded instead).  Only one test is currently failing - the
nested tags - but nested tags don't seem to currently be used anywhere in
Horde at the present.

1.65 (+12 -17 lines) 12/11/2006 06:09 PM Chuck Hagenbuch chuck

Revert revision 1.64. This broke the ability to pass an iterator in to
the template, and using iterators (which let us only fetch and loop
through data _once_, ever) should be a much more significant memory
savings than foreach vs. each. If this really made a large difference,
I can move it into a PHP 5 version for now, but I'd like some evidence
of that first.

1.64 (+17 -12 lines) 12/08/2006 07:15 PM Michael M Slusarz slusarz

Use each() to access array loops in the hopes of lowering memory usage.

1.63 (+9 -1 lines) 10/08/2006 12:28 AM Chuck Hagenbuch chuck

Add some notes on design and dev philosophy

1.62 (+6 -123 lines) 10/08/2006 12:13 AM Chuck Hagenbuch chuck

- block parsing has been split to Giapeto
- remove resetVars option

1.61 (+2 -22 lines) 10/07/2006 06:54 PM Chuck Hagenbuch chuck

remove unused resetVars() function

1.60 (+3 -95 lines) 10/07/2006 06:52 PM Chuck Hagenbuch chuck

remove cloops feature

1.59 (+15 -17 lines) 09/13/2006 06:41 PM Chuck Hagenbuch chuck

Remove numeric array key constraint (Request #4413).

1.38.10.10 FRAMEWORK_3 (+9 -9 lines) 06/12/2006 11:54 PM Chuck Hagenbuch chuck

MFH:
1.58      +9 -9      framework/Template/Template.php
1.586     +12 -11    framework/Horde/Horde.php

Tags: HORDE_3_1_3, HORDE_3_1_2

1.58 (+9 -9 lines) 06/12/2006 11:46 PM Chuck Hagenbuch chuck

Allow objects where we allow arrays. This way we can pass an
Iteratable object into a template without having to loop through it
twice.

1.57 (+2 -2 lines) 05/11/2006 04:27 PM Chuck Hagenbuch chuck

- don't silence file* calls when they really shouldn't fail (ie,
failing is a programmatic error, not a user/runtime error)

- rework factories to only include class files when the class doesn't
already exist (always allow a custom class to be included _before_ the
factory is called).

1.38.10.9 FRAMEWORK_3 (+2 -2 lines) 04/25/2006 06:34 PM Jan Schneider jan

MFH: 1.56

1.56 (+2 -2 lines) 04/25/2006 06:32 PM Jan Schneider jan

Strict check if _getStatement() returns false, it might return an empty string
which evaluates to false.

Bug: 3828

1.38.10.8 FRAMEWORK_3 (+2 -2 lines) 01/22/2006 02:12 PM Michael M Slusarz slusarz

MFH 1.55

Tags: HORDE_3_1_1, HORDE_3_1, HORDE_3_1_RC3, HORDE_3_1_RC2

1.55 (+2 -2 lines) 01/22/2006 01:36 PM Michael M Slusarz slusarz

avoid undefined index errors

1.38.10.7 FRAMEWORK_3 (+10 -2 lines) 01/12/2006 02:29 AM Michael M Slusarz slusarz

MFH 1.54

1.54 (+10 -2 lines) 01/12/2006 02:25 AM Michael M Slusarz slusarz

This should allow if statements in nested loops deeper than 1 level.

1.38.10.6 FRAMEWORK_3 (+2 -2 lines) 01/01/2006 04:28 PM Jan Schneider jan

Happy new year

Tags: HORDE_3_1_RC1

1.53 (+2 -2 lines) 01/01/2006 04:10 PM Jan Schneider jan

Happy new year\!

1.38.10.5 FRAMEWORK_3 (+195 -31 lines) 10/18/2005 07:01 AM Jan Schneider jan

Merged from HEAD.

1.38.10.4 FRAMEWORK_3 (+2 -2 lines) 08/24/2005 10:04 AM Matt Selsky selsky

MFH: Use double-quotes.

Tags: HORDE_3_0_12, HORDE_3_0_11, HORDE_3_0_10, HORDE_3_0_9, HORDE_3_0_8, HORDE_3_0_7, HORDE_3_0_6, HORDE_3_0_6_RC1

1.52 (+2 -2 lines) 08/24/2005 09:23 AM Matt Selsky selsky

Use double-quotes.

Tags: BEFORE_MERGE_3_1

1.51 (+19 -9 lines) 07/24/2005 05:21 PM Chuck Hagenbuch chuck

Allow calling listBlocks() when using a non-file template.

1.38.10.3 FRAMEWORK_3 (+15 -8 lines) 06/23/2005 04:07 PM Matt Selsky selsky

MFH: Clean up phpdoc.

Tags: HORDE_3_0_5, HORDE_3_0_5_RC2, HORDE_3_0_5_RC1

1.50 (+20 -10 lines) 06/23/2005 03:54 PM Matt Selsky selsky

Clean up phpdoc.

1.38.10.2 FRAMEWORK_3 (+1 -2 lines) 04/21/2005 07:26 AM Matt Selsky selsky

Remove @version.

1.49 (+2 -3 lines) 03/22/2005 05:15 PM Chuck Hagenbuch chuck

apparently I never committed this... idea was to avoid setting
$this->_templateFile if the load failed. This should do that and also
work.

1.48 (+3 -2 lines) 03/21/2005 02:21 AM Michael M Slusarz slusarz

Don't know if this is the right fix or not, but without this line all templates
are horribly broken.

1.47 (+52 -35 lines) 03/20/2005 08:57 PM Chuck Hagenbuch chuck

phpdoc, @access tags, use file_get_contents()

1.46 (+19 -22 lines) 03/20/2005 08:40 PM Chuck Hagenbuch chuck

- get rid of @version
- phpdoc tweaks
- _getSource() -> _getTemplate()

1.45 (+8 -8 lines) 03/20/2005 08:17 PM eraserhd

* Template::getCSSApps() -> listBlocks()

1.44 (+45 -25 lines) 03/20/2005 07:52 PM eraserhd

* Avoid loading template source more than once.

1.43 (+5 -3 lines) 03/20/2005 07:30 PM eraserhd

* Add 'blocks' template option and don't process blocks by default.

1.42 (+4 -4 lines) 03/20/2005 10:18 AM mdjukic

<b>/<i> to <strong>/<em>, and remove bold tags when already in header, clean up some bad html parsing

1.41 (+37 -2 lines) 03/19/2005 02:35 PM eraserhd

* Mechanism to retrieve list of block applications from template.
* In Giapeto, bring in CSS for blocks in template.

1.40 (+83 -4 lines) 03/19/2005 02:13 PM eraserhd

* Allow Horde templates to include application blocks.

1.39 (+1 -1 lines) 01/03/2005 08:09 AM Jan Schneider jan

Happy New Year

1.38.10.1 FRAMEWORK_3 (+3 -3 lines) 01/03/2005 07:19 AM Jan Schneider jan

Happy New Year

Tags: HORDE_3_0_4, HORDE_3_0_4_RC2, HORDE_3_0_4_RC1, HORDE_3_0_3, HORDE_3_0_3_RC1, HORDE_3_0_2, HORDE_3_0_1

1.38 (+3 -2 lines) 08/26/2004 06:52 AM Jan Schneider jan

Require PEAR.php.

Tags: FRAMEWORK_3, HORDE_3_0, HORDE_3_0_RC3

1.37 (+13 -10 lines) 08/06/2004 10:13 AM Jan Schneider jan

Inside loops replace <tag:loopvar /> with the loop's keys.

1.36 (+18 -0 lines) 07/11/2004 01:08 PM Jan Schneider jan

Add get().

1.35 (+9 -8 lines) 07/09/2004 06:38 PM Jan Schneider jan

Doc fixes.

1.34 (+102 -102 lines) 06/17/2004 05:29 PM Jan Schneider jan

Prefix private methods with underscores and put public methods first.

1.33 (+30 -30 lines) 06/17/2004 01:02 PM Jan Schneider jan

doc fixes.

1.32 (+6 -6 lines) 06/09/2004 07:05 PM Jan Schneider jan

We used String:: methods here to avoid inifinite loops, but instead they seem
to cause them. Regular string functions should be save here because we only
extract tags that are ascii anyway, so we shouldn't have problems with
string boundaries inside multibyte characters. That's the theory.

Bug: 189

1.31 (+5 -3 lines) 02/12/2004 04:01 PM Chuck Hagenbuch chuck

Make sure $i isn't undefined here.

Tags: HORDE_3_0_ALPHA

1.30 (+3 -3 lines) 01/22/2004 05:44 PM Jan Schneider jan

spacing

1.29 (+3 -3 lines) 01/01/2004 10:14 AM Jan Schneider jan

Happy new year everyone.

1.28 (+19 -4 lines) 11/11/2003 06:26 PM Chuck Hagenbuch chuck

Add loop dividers to Horde_Template, and use them to make some sets of links
a bit nicer and more useable in Agora.

1.27 (+3 -3 lines) 11/06/2003 04:03 PM Chuck Hagenbuch chuck

get some test files, and rearrange a few things. What package some of these classes
fall under is entirely debatable; I just want to get everything into a structure that can be worked with.

1.26 (+3 -3 lines) 10/24/2003 02:52 PM Chuck Hagenbuch chuck

package name

1.25 (+16 -18 lines) 09/14/2003 12:43 AM Chuck Hagenbuch chuck

From Nuno Loureiro <nuno@co.sapo.pt>:

- elses were not working in arrays
- this is kind of hard do explain, but it was only parsing ifs in arrays
once, so the first array element ruled for the whole loop. It's probably
easier to look to the code to understand..

1.24 (+11 -22 lines) 09/12/2003 11:54 AM Chuck Hagenbuch chuck

Take out explicit casting - we already store the variable in either $this->_arrays
or $this->_scalars, and PHP's reference counting means that if we don't modify
it, assigning it to $this->_ifs as well won't use any more memory at all.

1.23 (+4 -3 lines) 09/12/2003 11:52 AM Chuck Hagenbuch chuck

style was still wrong here.

1.22 (+42 -6 lines) 09/11/2003 10:55 PM Chuck Hagenbuch chuck

allow array if conditions (Nuno Loureiro <nuno@co.sapo.pt>)

1.21 (+12 -6 lines) 07/05/2003 03:19 AM mikec

Replace all tags in a single call to str_replace.

1.20 (+3 -3 lines) 06/08/2003 12:26 PM mdjukic

typo

1.19 (+3 -3 lines) 05/26/2003 02:35 PM mdjukic

better error message

1.18 (+54 -2 lines) 05/15/2003 04:57 PM Chuck Hagenbuch chuck

[cjh] Horde_Template:: is now capable of translating text inside
<gettext></gettext> tags.

Submitted by: Nuno Loureiro <nuno@co.sapo.pt>

1.17 (+4 -4 lines) 01/23/2003 01:34 PM Chuck Hagenbuch chuck

return a better error when we can't open a template

1.16 (+7 -7 lines) 01/20/2003 11:42 PM Chuck Hagenbuch chuck

- Use String::length() and String::pos() to avoid potential infinite loops.
- Store $_ifs as straight booleans for clarity.

1.15 (+5 -5 lines) 01/16/2003 07:35 PM Jan Schneider jan

Use String::substr()

1.14 (+3 -3 lines) 01/02/2003 09:32 PM Jan Schneider jan

Bump year.

1.13 (+4 -4 lines) 12/21/2002 04:20 AM mikec

Put the while in the correct place fixing the parse error.

1.12 (+9 -8 lines) 12/19/2002 08:56 PM Chuck Hagenbuch chuck

Put this back, my bad. It is now a slightly documented kludge. :)

1.11 (+2 -3 lines) 12/13/2002 11:19 PM Chuck Hagenbuch chuck

reverting this. this is a kludge; we shouldn't be doing things with
side effects like this. if no loops are set, we don't process loops.

1.10 (+5 -4 lines) 12/13/2002 11:12 PM mikec

Make sure the loop runs at least once so array values in <tag>s get parse if there are no loops in the template.

1.9 (+64 -58 lines) 12/04/2002 12:41 PM Chuck Hagenbuch chuck

Loop variables can now be re-used in different contexts - you don't
have to make each use of a loop be exactly identical to others in the
same template.

1.8 (+5 -4 lines) 12/04/2002 10:42 AM Chuck Hagenbuch chuck

fix bug with not finding loops at the very start (first character) of
a file. classic strpos error checking problem.

1.7 (+5 -6 lines) 11/20/2002 10:07 AM Chuck Hagenbuch chuck

Minor style bits.

1.6 (+10 -7 lines) 11/20/2002 07:20 AM mikec

Change the way ifs are stored so that you can use an array as a conditional. Allows things like this:

$template = &new Horde_Template();
$template->set('search_results', $search_results, true);
echo $template->parse('
    <if:search_results>
        <loop:search_results>
            <tag:search_results />
        </loop:search_results>
    <else:search_results>
        No Records Found
    </else:search_results>
    </if:search_results>
');

1.5 (+3 -3 lines) 11/20/2002 04:49 AM mikec

Better way of removing the else block.

1.4 (+16 -31 lines) 11/20/2002 04:44 AM mikec

Remove Not If's from last commit. Implement else statements in the form:
<if:conditional>
  Output this if true
<else:conditional>
Output this if false
</else:conditional>
</if:conditional>

1.3 (+29 -2 lines) 11/19/2002 01:46 AM mikec

Add suport for not ifs. You can now do this:
<if:!conditional>
  Stuff to output if conditional isn't true.
</if:!conditional>

1.2 (+3 -3 lines) 11/18/2002 05:41 AM mikec

Change the basepath to ''.

1.1 11/17/2002 09:50 PM Chuck Hagenbuch chuck

Add a simple template engine, derived from bTemplate, for Horde
applications to use.