Cool, thanks for claiming this so we don't have people stepping on each others toes. Would you mind showing a little bit of what you planned on changing? It would be nice to have agreement that this was the direction we wanted to go before a big patch was submitted.
Chris
From: Stefan Pflüger stefan@homepage4us.de Date: 2004/12/22 Wed PM 01:05:06 EST To: wine-devel@winehq.org CC: appdb@winehq.org Subject: AppDB TODO update: Templates
Hello,
the last update added
+# incorporate templates into appdb to simplify code, Jeremy says we can +borrow from lostwages(winehq.org/cvsweb/lostwages) for this
to the TODO file.
At the moment, I'm trying to use AppDB for another project and I already planned on implementing templates. If nobody else wants to do the job, I'll go ahead and send you a patch as soon as I'm finished.
Stefan Pflüger
Basically, I'll implement a class that is able to read a template file and that can assign content to special tags in there.
The index.php would create an object of this class using a "main template" that includes all parts of the page that are static (header, footer, the main html tables). Depending on a GET variable, the index.php calls a function whose returned data will be used as the main content, it would be for example index.php?action=browseapps to get to the "Browse Apps" page.
The content of the sidebar, the banner ad etc. would also be created by a function like it's already done (see banner_display() in include/banner.php), but instead of just echo-ing this somewhere in the right place, it would also be fed into the template engine that again replaces the corresponding tags in the main template. Those functions might also use the template class to implement their own sub-templates.
In the end, the template class object in index.php should have the complete output ready for sending it to the user.
Hopefully, my short explanation was good enough to illustrate the concept.
Stefan
PS.: What's the correct list/address to send mails concerning this discussion to? I'm sending them to the wine-devel list atm, CCing to Chris Morgan and appdb@winehq.org...