FastTemplate compatibility.

Kyrian (List) <[email protected]> Wed, 28 Jan 2004 13:46:50 +0000
Newsgroups gmane.comp.horde.giapeto
Organization oRe
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--Multipart=_Wed__28_Jan_2004_13_46_50_+0000_3uSB/cNBkppy9BLf
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

> Message: 1
> Date: Mon, 13 Oct 2003 00:03:06 -0400
> From: Chuck Hagenbuch <[email protected]>
> Subject: Re: [giapeto] Re: giapeto Digest, Vol 19, Issue 1
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="ISO-8859-1"
> 
> Quoting Kyrian <[email protected]>:
> 
> > Although,  it would be a pretty killer feature to have a
> > "fasttemplate compatibility mode" incorporated (which could default
> > to off, and be set/disabled with a class function), as that
> > potentially could easily bring a hell of a lot more of a userbase to
> > Giapeto ;-)
> 
> You should just have to modify getTag() and getTags() in
> Horde_Template, and should be able to make this mode settable via a
> setOption() call easily.
> 
I've attached a (trivial) patch that should allow a
"compat_fasttemplate" option to be set, in order to have basic
template compatibility, and it also implements a define() method a-la
FastTemplate.

By "basic" I mean that straight tags are compatible. FastTemplate has
this odd "dynamic block" feature, which is sort of sub-templates, which
it won't cover, but never mind, it's a start :)

It "seems to work"(tm) for my client, so do with it what you will.

Although I suppose for more full compatibility, we'd need to have a set
of mirror functions for all the FastTemplate ones, as per this google
cache thing (the only way you can get the FastTemplate docs!)

http://216.239.59.104/search?q=cache:AuvAhDRrHNQJ:www.thewebmasters.net/php/FastTemplate.phtml+class.FastTemplate+php&hl=en&ie=UTF-8

However there are some namespace and other code clashes which look like
they will render this impossible, although just having a compatibility
mode for the template style, and the "define()" method of FastTemplate
will enable most of its functionality in Giapeto/Horde_Template, or at
least enable easier migration.

K.

-- 
Kev Green, aka Kyrian. E: kyrian&#64;ore.org WWW: http://kyrian.ore.org/
  ISP/Perl/PHP/Linux/Security Contractor, via http://www.orenet.co.uk/

--Multipart=_Wed__28_Jan_2004_13_46_50_+0000_3uSB/cNBkppy9BLf
Content-Type: application/octet-stream;
	name="giapeto-compat-fasttemplate.patch"
Content-Disposition: attachment; filename="giapeto-compat-fasttemplate.patch"
Content-Transfer-Encoding: base64

LS0tIC91c3IvbG9jYWwvbGliL1BFQVIvSG9yZGUvVGVtcGxhdGUucGhwCTIwMDQtMDEtMjggMTI6
Mzc6NDEuMDAwMDAwMDAwICswMDAwCisrKyAvdXNyL2xvY2FsL2xpYi9QRUFSL0hvcmRlL1RlbXBs
YXRlLnBocC5uZXcJMjAwNC0wMS0yOCAxMjozNzoxMS4wMDAwMDAwMDAgKzAwMDAKQEAgLTE4Myw4
ICsxODMsMTMgQEAKICAgICAgKi8KICAgICBmdW5jdGlvbiBnZXRUYWdzKCR0YWcsICRkaXJlY3Rp
dmUpCiAgICAgewotCXJldHVybiBhcnJheSgnYicgPT4gJzwnIC4gJGRpcmVjdGl2ZSAuICc6JyAu
ICR0YWcgLiAnPicsCi0JCSdlJyA9PiAnPC8nIC4gJGRpcmVjdGl2ZSAuICc6JyAuICR0YWcgLiAn
PicpOworICAgICAgICBpZiAoJHRoaXMtPmdldE9wdGlvbignY29tcGF0X2Zhc3R0ZW1wbGF0ZScp
ICYmICFzdHJjbXAoJGRpcmVjdGl2ZSwidGFnIikpIHsKKyAgICAgICAgICAgIHJldHVybiBhcnJh
eSgnYicgPT4gJ3snIC4gJHRhZywKKyAgICAgICAgICAgICAgICAgICAgICdlJyA9PiAnfScpOwor
ICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGFycmF5KCdiJyA9PiAnPCcgLiAk
ZGlyZWN0aXZlIC4gJzonIC4gJHRhZyAuICc+JywKKyAgICAgICAgICAgICAgICAgICAgICdlJyA9
PiAnPC8nIC4gJGRpcmVjdGl2ZSAuICc6JyAuICR0YWcgLiAnPicpOworICAgICAgICB9CiAgICAg
fQogCiAgICAgLyoqCkBAIC0xOTYsNyArMjAxLDExIEBACiAgICAgICovCiAgICAgZnVuY3Rpb24g
Z2V0VGFnKCR0YWcpCiAgICAgewotCXJldHVybiAnPHRhZzonIC4gJHRhZyAuICcgLz4nOworICAg
ICAgICBpZiAoJHRoaXMtPmdldE9wdGlvbignY29tcGF0X2Zhc3R0ZW1wbGF0ZScpKSB7CisgICAg
ICAgICAgICByZXR1cm4gJ3snIC4gJHRhZyAuICd9JzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAg
ICAgICAgIHJldHVybiAnPHRhZzonIC4gJHRhZyAuICcgLz4nOworICAgICAgICB9CiAgICAgfQog
CiAgICAgLyoqCg==

--Multipart=_Wed__28_Jan_2004_13_46_50_+0000_3uSB/cNBkppy9BLf
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
giapeto mailing list - Join the hunt: http://horde.org/bounties/#giapeto
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]

--Multipart=_Wed__28_Jan_2004_13_46_50_+0000_3uSB/cNBkppy9BLf--