phpgroupware-developers
[Top][All Lists]
Advanced

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

[Phpgroupware-developers] Templates class, CSS support and print view su


From: Dan Kuykendall (Seek3r)
Subject: [Phpgroupware-developers] Templates class, CSS support and print view support
Date: Thu, 23 May 2002 20:46:43 -0700

I am making several changes to the development code to cover some
features and technologies that its time we start supporting. This is
fairly important stuff. I am looking forward to comments and suggestions
so that these things are all implemented in the best possible way.

Common template blocks:
The templates class now loads up a file called common.tpl from the
phpgwapi's template set right off the bat. The idea is that we will put
in place a bunch of commonly used blocks that can be used in many apps
and give the overall app a more consistant look and feel. These blocks
can very easily be used like those from any other file that gets added.
Just do a normal set_block, for example
$GLOBALS['phpgw']->template->set_block('common','optionlist');

I will be building up the one I put in the default template class over
the next day or two and will shortly have defined what blocks we will
support in here.

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.

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;';

** notice how it makes use of the exsisting link, alink, vlink color
choices for backwards compatibility

and produce something like this:

<STYLE type="text/css">
  A { text-decoration:none; }
  A:link{ text-decoration:none; color: blue ; }
  A:visted{ text-decoration:none; color: red ; }
  A:active{ text-decoration:none; color: green ; }
  .navbar{ font-family: Verdana; font-size: 8pt; color:#000000; }
</STYLE>

The idea will be that each .theme file will have this array defined with
some required entries.
Then the template sets in the api and in the app can have a file which
will be able to define more. There is code in the templates class which
will take this array and put the css result into its phpgw_css var. So
if a template set wants to use CSS, then it will just need to put
{phpgw_css} somewhere in between <HEAD></HEAD>
I am reading thru a bunch of CSS documentation to figure out what our
require list of entries will be. Suggestions are welcome

These steps are just a start of some of the changes I want to make to
improve our interface so that we can more readily impress the world with
what we have done, since too many dont realize how awesome this prog is
because they only look skin deep.

*** PLEASE let me know what you think. This is all in early development
and I will need feedback to know how to get this all implemented the
best possible way. ***

Seek3r



reply via email to

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