cvs: pear /HTML_Template_Flexy Flexy.php /HTML_Template_Flexy/Flexy/Compiler Standard.php /HTML_Template_Flexy/tests test.php
/HTML_Template_Flexy/tests/results1 plugin_modifiers.html.en.php plugin_modifiers.html.gettext.serial /HTML_Template_Flexy/tests/templates
plugin_modifiers.html
| From: | Alan Knowles | Date: | Sat, 12 Jun 2004 07:06:44 +0000 |
| Subject: | cvs: pear /HTML_Template_Flexy Flexy.php /HTML_Template_Flexy/Flexy/Compiler Standard.php /HTML_Template_Flexy/tests test.php /HTML_Template_Flexy/tests/results1 plugin_modifiers.html.en.php plugin_modifiers.html.gettext.serial /HTML_Template_Flexy/tests/templates plugin_modifiers.html |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20547@lists.php.net to get a copy of this message | ||
alan_k Sat Jun 12 03:06:44 2004 EDT
Added files:
/pear/HTML_Template_Flexy/tests/results1
plugin_modifiers.html.en.php
plugin_modifiers.html.gettext.serial
/pear/HTML_Template_Flexy/tests/templates plugin_modifiers.html
Modified files:
/pear/HTML_Template_Flexy Flexy.php
/pear/HTML_Template_Flexy/Flexy/Compiler Standard.php
/pear/HTML_Template_Flexy/tests test.php
Log:
unknown modifiers call plugins
http://cvs.php.net/diff.php/pear/HTML_Template_Flexy/Flexy.php?r1=1.87&r2=1.88&ty=u
Index: pear/HTML_Template_Flexy/Flexy.php
diff -u pear/HTML_Template_Flexy/Flexy.php:1.87 pear/HTML_Template_Flexy/Flexy.php:1.88
--- pear/HTML_Template_Flexy/Flexy.php:1.87 Fri Jun 4 02:24:25 2004
+++ pear/HTML_Template_Flexy/Flexy.php Sat Jun 12 03:06:43 2004
@@ -62,7 +62,7 @@
*
*
*
-* @version $Id: Flexy.php,v 1.87 2004/06/04 06:24:25 alan_k Exp $
+* @version $Id: Flexy.php,v 1.88 2004/06/12 07:06:43 alan_k Exp $
*/
class HTML_Template_Flexy
{
@@ -473,7 +473,7 @@
// how to display them...
$this->elements[$k] = $this->mergeElement($this->elements[$k] ,$v);
}
-
+ //echo '<PRE>'; print_r(array($elements,$this->elements));
// we use PHP's error handler to hide errors in the template.
@@ -566,7 +566,7 @@
if (!$this->options['debug']) {
return;
}
- } else if (!$GLOBALS['_HTML_TEMPLATE_FLEXY']['debug']) {
+ } else if (!@$GLOBALS['_HTML_TEMPLATE_FLEXY']['debug']) {
return;
}
echo "<PRE><B>FLEXY DEBUG:</B> $string</PRE>";
@@ -671,7 +671,7 @@
function raiseError($message, $type = null, $fatal = HTML_TEMPLATE_FLEXY_ERROR_RETURN )
{
- $this->debug("<B>HTML_Template_Flexy::raiseError</B>$message");
+
HTML_Template_Flexy::debug("<B>HTML_Template_Flexy::raiseError</B>$message");
require_once 'PEAR.php';
if (is_a($this,'HTML_Template_Flexy') && ($fatal ==
HTML_TEMPLATE_FLEXY_ERROR_DIE)) {
// rewrite DIE!
http://cvs.php.net/diff.php/pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php?r1=1.33&r2=1.34&ty=u
Index: pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php
diff -u pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php:1.33
pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php:1.34
--- pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php:1.33 Wed Jun 2 00:04:28 2004
+++ pear/HTML_Template_Flexy/Flexy/Compiler/Standard.php Sat Jun 12 03:06:43 2004
@@ -16,7 +16,7 @@
// | Authors: Alan Knowles <alan@akbkhome.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Standard.php,v 1.33 2004/06/02 04:04:28 alan_k Exp $
+// $Id: Standard.php,v 1.34 2004/06/12 07:06:43 alan_k Exp $
//
// Base Compiler Class
// Standard 'Original Flavour' Flexy compiler
@@ -442,7 +442,8 @@
$prefix = 'echo ';
$suffix = '';
- $modifier = $element->modifier . ' ';
+ $modifier = strlen(trim($element->modifier)) ? $element->modifier : ' ';
+
switch ($modifier{0}) {
case 'h':
break;
@@ -466,10 +467,16 @@
// add language ?
$suffix = '))';
break;
- default:
+ case ' ':
$prefix = 'echo htmlspecialchars(';
// add language ?
$suffix = ')';
+ break;
+ default:
+ $prefix = 'echo $this->plugin("'.trim($element->modifier)
.'",';
+ $suffix = ')';
+
+
}
return array($prefix,$suffix);
http://cvs.php.net/diff.php/pear/HTML_Template_Flexy/tests/test.php?r1=1.3&r2=1.4&ty=u
Index: pear/HTML_Template_Flexy/tests/test.php
diff -u pear/HTML_Template_Flexy/tests/test.php:1.3 pear/HTML_Template_Flexy/tests/test.php:1.4
--- pear/HTML_Template_Flexy/tests/test.php:1.3 Wed May 5 05:37:08 2004
+++ pear/HTML_Template_Flexy/tests/test.php Sat Jun 12 03:06:43 2004
@@ -38,7 +38,7 @@
'templateDir' => dirname(__FILE__) .'/templates', // where
are your templates
'forceCompile' => true, // only suggested for debugging
- 'fatalError' => PEAR_ERROR_RETURN, // only suggested for debugging
+ 'fatalError' => HTML_TEMPLATE_FLEXY_ERROR_RETURN, // only suggested for
debugging
'url_rewrite' => 'images/:/myproject/images/',
);
http://cvs.php.net/co.php/pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.en.php?r=1.1&p=1
Index: pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.en.php
+++ pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.en.php
<H1>Testing Plugin Modifiers</H1>
<?php echo $this->plugin("formatdate",$t->abcd);?>
<?php echo $this->plugin("formatnumber",$t->abcd);?>
http://cvs.php.net/co.php/pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.gettext.serial?r=1.1&p=1
Index: pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.gettext.serial
+++ pear/HTML_Template_Flexy/tests/results1/plugin_modifiers.html.gettext.serial
a:1:{i:0;s:24:"Testing Plugin Modifiers";}
http://cvs.php.net/co.php/pear/HTML_Template_Flexy/tests/templates/plugin_modifiers.html?r=1.1&p=1
Index: pear/HTML_Template_Flexy/tests/templates/plugin_modifiers.html
+++ pear/HTML_Template_Flexy/tests/templates/plugin_modifiers.html
<H1>Testing Plugin Modifiers</H1>
{abcd:formatdate}
{abcd:formatnumber}