phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] displaying items - backgroud color


From: Dave Hall
Subject: Re: [Phpgroupware-developers] displaying items - backgroud color
Date: Tue, 19 Aug 2003 11:41:54 +0000 (GMT)

Hey Pascal,

Time for me to whinge about a couple of my pet peeves:

HTML mail - rrrrrr - please set this (and all other phpgw lists) to
plain text only ... HTML mail really annoys me.

Patches should be submitted to our patch manager on savannah -
https://savannah.gnu.org/patch/?group=phpgroupware

Your contribution to the project is valued, but proper submissions will
increase the likelyhood of them being properly appreciated :)

Cheers

Dave
Content-Type: multipart/alternative;
        boundary="------------000907020503020407060608"


--------------000907020503020407060608
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Chris Weiss wrote:

>Pascal Vilarem (address@hidden) wrote:
>  
>
>>Hi, all
>>
>>This is my first writing to this list...
>>
>>I currenty need to display a list of items with a background color that
>>shows the status of
>>the item ("ok"... "not ok"... "late"... "corrected"... and things like
>>that).
>>
>>Is there a "classic" way to do that in phpGW ? the alternate_row_color
>>of the "netxtmatchs" class seems only
>>to allow to swich between two colors... and i need something a little
>>bit more "flexible"...
>>
>>    
>>
>
>not really, just set the color in td tags or use css and set the style 
>according to
>your status.
>  
>
I'd prefer to use the templates and theme...

what about the following idea ?

in nextmatchs class : change alternate_row_color and 
template_alternate_row_color :
---------------------------------------------------------------------------------------------------------------

/*********************************************************************************************/
        function alternate_row_color($tr_color = '', $rowstatus='')
        {

            global $tr_color;                        /* useless now but 
important to avoid changing existing calls to the method */
            global $row_light;
            global $row_status;

            if ( !$rowlight )
            {
                $rowlight = $row_light;
            }

            if ( $rowstatus )
            {
                $rowstatus.='_';
            }
            elseif ( $row_status != '')
            {
                $rowstatus=$row_status.'_';
            }

            if ( $rowlight == 'row_on' )
            {
                $rowlight = 'row_off';
            }
            else
            {
                $rowlight = 'row_on';
            }

            $row_light=$rowlight;

            $tr_color = 
$GLOBALS['phpgw_info']['theme'][$rowstatus.$rowlight];

            return $tr_color;
        }

        function template_alternate_row_color(&$tpl, $rowstatus='')
        {
            if ( $rowstatus )
            {
                global $row_status;
                $row_status = $rowstatus;
            }

            $tpl->set_var('tr_color',$this->alternate_row_color());
        }
/*********************************************************************************************/

in theme files add lines like this :
--------------------------------------------

    $phpgw_info['theme']['status1_row_on']      = '#color1light';
    $phpgw_info['theme']['status1_row_off']     = '#color1dark';

and in ui class :
--------------------

write $tr_color = $this->nextmatchs->alternate_row_color($tr_color, 
$status );
instead of $tr_color = $this->nextmatchs->alternate_row_color($tr_color);


and $this->nextmatchs->template_alternate_row_color(&$this->t, $status);
instead of $this->nextmatchs->template_alternate_row_color(&$this->t);

the result :
--------------

nothing is gonna change is status isn't given...
and if it is given, the background color is set up accordingly...
the highlighting of the background is now independant of the color itself

Nota : i should check that the right line exists in theme file...

good idea ? or stupid one ? plz feel right to give comments.


--------------000907020503020407060608
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Chris Weiss wrote:<br>
<blockquote type="cite"
 cite="address@hidden">
  <pre wrap="">Pascal Vilarem (<a class="moz-txt-link-abbreviated" 
href="mailto:address@hidden";>address@hidden</a>) wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi, all

This is my first writing to this list...

I currenty need to display a list of items with a background color that
shows the status of
the item ("ok"... "not ok"... "late"... "corrected"... and things like
that).

Is there a "classic" way to do that in phpGW ? the alternate_row_color
of the "netxtmatchs" class seems only
to allow to swich between two colors... and i need something a little
bit more "flexible"...

    </pre>
  </blockquote>
  <pre wrap=""><!---->
not really, just set the color in td tags or use css and set the style 
according to
your status.
  </pre>
</blockquote>
I'd prefer to use the templates and theme...<br>
<br>
what about the following idea ?<br>
<br>
in nextmatchs class : change alternate_row_color and
template_alternate_row_color :<br>
---------------------------------------------------------------------------------------------------------------<br>
<br>
/*********************************************************************************************/<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function alternate_row_color($tr_color = 
'', $rowstatus='')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; global 
$tr_color;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 /* useless now but
important to avoid changing existing calls to the method */<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; global $row_light;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; global $row_status;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( !$rowlight )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$rowlight = $row_light;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( $rowstatus )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$rowstatus.='_';<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; elseif ( $row_status 
!= '')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$rowstatus=$row_status.'_';<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( $rowlight == 
'row_on' )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$rowlight = 'row_off';<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$rowlight = 'row_on';<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$row_light=$rowlight;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $tr_color =
$GLOBALS['phpgw_info']['theme'][$rowstatus.$rowlight];<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $tr_color;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function 
template_alternate_row_color(&amp;$tpl, $rowstatus='')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( $rowstatus )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
global $row_status;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
$row_status = $rowstatus;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
$tpl-&gt;set_var('tr_color',$this-&gt;alternate_row_color());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
/*********************************************************************************************/<br>
<br>
in theme files add lines like this :<br>
--------------------------------------------<br>
<br>
&nbsp;&nbsp;&nbsp; 
$phpgw_info['theme']['status1_row_on']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
'#color1light';<br>
&nbsp;&nbsp;&nbsp; 
$phpgw_info['theme']['status1_row_off']&nbsp;&nbsp;&nbsp;&nbsp; = 
'#color1dark';<br>
<br>
and in ui class :<br>
--------------------<br>
<br>
write $tr_color =
$this-&gt;nextmatchs-&gt;alternate_row_color($tr_color, $status );<br>
instead of $tr_color =
$this-&gt;nextmatchs-&gt;alternate_row_color($tr_color);<br>
<br>
<br>
and
$this-&gt;nextmatchs-&gt;template_alternate_row_color(&amp;$this-&gt;t,
$status);<br>
instead of
$this-&gt;nextmatchs-&gt;template_alternate_row_color(&amp;$this-&gt;t);<br>
<br>
the result :<br>
--------------<br>
<br>
nothing is gonna change is status isn't given...<br>
and if it is given, the background color is set up accordingly...<br>
the highlighting of the background is now independant of the color
itself<br>
<br>
Nota : i should check that the right line exists in theme file...<br>
<br>
good idea ? or stupid one ? plz feel right to give comments.<br>
<br>
</body>
</html>

--------------000907020503020407060608--
_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/phpgroupware-developers

Attachment: dave.hall.vcf
Description: Card for <dave.hall@mbox.com.au>


reply via email to

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