From: Marc G. K. <ma...@sq...> - 2006-02-22 16:33:22
|
On Wed, February 22, 2006 10:44 am, Paul Lesneiwski wrote: >> Hi Steve, >> On Monday, February 20, 2006, Steve wrote: >> >>> Update of /cvsroot/squirrelmail/squirrelmail/templates/default >>> In directory >>> sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23640/templates/default >>> >> >>> Added Files: >>> left_main.tpl left_main_advanced.tpl >> >> I'm a little baffled over the purpose of left_main.tpl, or even >> left_main_advanced.tpl. >> >> src/left_main.php has a check for advanced_tree being true/false. If >> it's true, it runs ListAdvancedBoxes. If it is false, it simply runs >> ListBoxes. Now if the admin has not set the $advanced_tree option, it >> defaults to false based on the code on line 268. The problem comes in >> the fact that ListBoxes simple does: >> >> function ListBoxes ($boxes, $j=0) { return ''; } >> >> >> This means that it is returning an empty string, then calls the >> template with no display. In the rare case that the advanced_tree might >> not be set, this is a "bad thing" (tm). Shouldn't it simply be a case >> of removing any reference to advanced_tree, and removing the duplicated >> template code? >> >> On further investigation... I just looked in left_main.tpl and saw it >> was building the mailtree view itself. Even more confused now as to why >> one template has to build the tree itself, and the other one doesn't... >> I'm in favour of dropping the duplication, or moving the >> code back into src/left_main.php. > > Not looking at the code aside from these new commits, but am of the > opinion that as much of the tree hierarchy should be built in the core or > in a "middle layer" as possible, minimizing PHP functions inside of the > tpl files, although in this case, they do appear to be strictly generating > display code based on values passed to the template. > > What bothered me was what appears to have been a straight push of the > hook at the bottom of that page from core to template. I will repeat again > that I don't think this hooks in the templates has been well thought out > and that this ruins this hook for any template engine that can't call PHP > functions itself. Did anyone test this with any plugins that use this > hook? > Quick command, I talked with Steve about left_main and he is in the middle of finishing the template. Not everything is done yet and I told him it's okey 1.5.2 CVS is sometimes broken because we just released a good devel version 1.5.1. In other words, 1.5.2 CVS is at this moment bleeding edge development. The tree hierarchy is partly build in core because the object structure is a direct result of the imap parsing we do. In the middle layer a transition takes place to hand over a workeable format of the tree to the template. Regarding the hook, i didn't look at it but we still need to figure out how to deal with hooks that involves the display layer. Probably the hook should be used in the future to render optional templates provided by the plugins in a certain area of our own templates. In this case the bottom of the mailbox tree. Sooner or later we need to force this kind of behaviour so plugins might break which is unavoidable. Marc. |