phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Templates class, CSS support and print vie


From: Jason Wies
Subject: Re: [Phpgroupware-developers] Templates class, CSS support and print view support
Date: Thu, 23 May 2002 23:42:25 -0400
User-agent: Mutt/1.2.5i

On Thu, May 23, 2002 at 08:46:43PM -0700, Dan Kuykendall (Seek3r) wrote:
> Print view:
> We have two ways to support this. 
> 1) Have a template set named print which will be a printer friendly
> version. If a flag is set then the templates class will first check to
> see if there is a version of the given template file in the print set.
> If its not in the print template set, then it will do the normal check
> to see if its in the selected template set, and then the default.
> 
> 2) Have the flag in the templates class automaticly look for
> $filename.'_print.tpl', and fall back to $filename.'.tpl' if the print
> version doesnt exist. This will look for the print version in the
> selected template dir, then the print version in the defaults template
> dir, then the regular version in the selected template dir and finally
> the regular version in the default templates dir.
> 
> I have already implemented #2 as a test. #1 has the advantage of being
> one simple template set to support. #2 has the advantage of allowing
> each template set to have its own print view. If the chosen template set
> doesnt have it, then it will use the print version from the default
> template set.  So if Im really interested in making a kick but template
> set with really pretty print versions as well, then I would want #2. I
> have already implemented #2 and think its the best route to take, but I
> would like some feedback.

I think a good requirement for the print view is "don't require a print version 
for every template file".  Generic printer friendly pages are usually just the 
same HTML without the branding fluff around it, and wouldn't require any 
special treatment by the app.  Without any experimentation, I would suggest a 
combination of 1 and 2 above, so the checking sequence would be:

- selected $template -
1) app/templates/$template/$filename_print.tpl
2) app/templates/default/$filename_print.tpl

- print -
3) app/templates/default/$filename.tpl

I would NOT check app/templates/$template/$filename.tpl in print mode, because 
individual template files may depend on CSS, JavaScript, etc. that is defined 
in the template header, which in this case wouldn't be included.  The default 
template file, however, shouldn't have any special dependancies.

A hybrid approach like this should handle the 90% of pages that don't have any 
special printing requirements, while still giving the app control for those 
pages that need it.  This may have been what you intended with 1 above.

And just a random thought to add.  One of the properties of some printer 
friendly pages is that all entries in a list are displayed (all pages in a 
story, all names in a directory, etc.).  It might be a worthwhile experiment to 
modify the nextmatchs (sic) class when the print flag is set.

> Cascading Style Sheets (CSS) support:
> I am adding a way for template sets and apps to more easily and
> consistantly support CSS.
> I am doing this by adding a new sub array to the
> $GLOBALS['phpgw_info']['theme'] array called (what else but) css.
> 
> The array will look something like this:
> 
> $GLOBALS['phpgw_info']['theme']['a'] = 'text-decoration:none;';
> $GLOBALS['phpgw_info']['theme']['A:link'] = 'text-decoration:none;
> color: '.$GLOBALS['phpgw_info']['theme']['link'].';';
> 
> $GLOBALS['phpgw_info']['theme']['A:visted'] = 'text-decoration:none;
> color: '.$GLOBALS['phpgw_info']['theme']['vlink'].' ;';
> 
> $GLOBALS['phpgw_info']['theme']['A:active'] = 'text-decoration:none;
> color: '.$GLOBALS['phpgw_info']['theme']['alink'].' ;';
> 
> $GLOBALS['phpgw_info']['theme']['.navbar'] = 'font-family: Verdana;
> font-size: 8pt; color:#000000;';

These will be $GLOBALS['phpgw_info']['theme']['css']['foo'], right?

Jason Wies aka Zone



reply via email to

[Prev in Thread] Current Thread [Next in Thread]