phpgroupware-developers
[Top][All Lists]
Advanced

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

[Phpgroupware-developers] msgbox function and template blocks


From: Dan Kuykendall (Seek3r)
Subject: [Phpgroupware-developers] msgbox function and template blocks
Date: Fri, 24 May 2002 12:02:09 -0700

I have added a msgbox function to the common class and it is loaded in
the phpgw_header function.

basicly if you set some messages in the
$GLOBALS['phpgw_info']['flags']['msgbox_data'] array
a msgbox will be displayed to the user right below the navbar and before
the app has a chance to sneak anything above it.

So an app developer can display the msgbox with info they need to return
to the user like this:

$GLOBALS['phpgw_info']['flags']['msgbox_data']['Please enter a first
name']=False;

As long as they do this before the header is generated, it will appear
as desired.

=False indicated that it was an error msg, but you can also set =True
and that will indicate a positive result, something like this:

$GLOBALS['phpgw_info']['flags']['msgbox_data']['Record Saved']=True;

A positive message will generally have a green checkmark or something
like that, depending on the template set. A negative message will have a
red X or something like that.

You can also stack messages up. This is the primary benefit of the way
its designed.

$GLOBALS['phpgw_info']['flags']['msgbox_data']['Please enter a first
name']=False;
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Please enter a last
name']=False;
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Something good had to
come of this']=True;

This will generate a msgbox with all three rows properly indicated.

The template blocks for this are going to be in the common.tpl for each
template set. only the default template set has one so far and the
msgbox is pretty basic and ugly, but as each template set starts
supporting the common.tpl the msgbox will pretty up a great deal.

Oh!
App developers can also use the msgbox function directly if they want.
It will return the msgbox, so you can then output it however works for
you.

Seek3r



reply via email to

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