Redo the entire template library. I've been meaning to use perl
"object" and this was a good opportunity to see if they are useful and easy enough to use. Yep they are; the code is much cleaner with many fewer utility functions to get at stuff. I recommend this approach from now on. The problem is the php side, which ends up duplicating some stuff, but in the old style. This is not so bad for the template code since I have made it a point not to do anything but display functions in php; all modifications are handled in the backend.
Showing with 1712 additions and 1867 deletions