allow user to override theme directory

oliver soell - June 13, 2006 - 23:41
Project:PHPTemplate
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I am using 4.7.0, and writing a module which heavily uses phptemplate by overriding theme calls. I would like to be able to modify the variables array and change the 'directory' but I can't, since in phptemplate.engine's _phptemplate_default() there are path_to_theme() calls all over the place. I added another clause to have it use $variables['directory'] and all works the way I'd like it, but it'd be nice if this was "allowed" by default.

Looking at the code, this is the same situation in 4.7.2. Is this not allowed for a particular reason?

Is the default for $vars['directory'] not path_to_theme() already?

Anyway, here is a patch against 4.7.2 to illustrate the problem - I left the spacing so as to change the fewest lines..
-o

AttachmentSize
phptemplate.engine_13.patch541 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.