[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.common.inc.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.common.inc.php |
Date: |
Mon, 09 Oct 2006 13:24:04 +0000 |
CVSROOT: /sources/phpgwapi
Module name: phpgwapi
Changes by: Sigurd Nes <sigurdne> 06/10/09 13:24:04
Modified files:
inc : class.common.inc.php
Log message:
Prepare data for use with the function msgbox
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.common.inc.php?cvsroot=phpgwapi&r1=1.247&r2=1.248
Patches:
Index: class.common.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/class.common.inc.php,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -b -r1.247 -r1.248
--- class.common.inc.php 2 Oct 2006 09:27:04 -0000 1.247
+++ class.common.inc.php 9 Oct 2006 13:24:04 -0000 1.248
@@ -8,7 +8,7 @@
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage utilities
- * @version $Id: class.common.inc.php,v 1.247 2006/10/02 09:27:04
skwashd Exp $
+ * @version $Id: class.common.inc.php,v 1.248 2006/10/09 13:24:04
sigurdne Exp $
*/
/**
@@ -1828,5 +1828,39 @@
return $data;
}
}
+
+ /**
+ * Prepare data for use with the function msgbox
+ * makes it easier and more consistant to generate message boxes
+ *
+ * @param array $data
+ * @returns array for use with msgbox
+ */
+
+ function msgbox_data($receipt)
+ {
+ $msgbox_data_error=array();
+ if (isSet($receipt['error']) AND
is_array($receipt['error']))
+ {
+ foreach($receipt['error'] as $errors)
+ {
+ $msgbox_data_error +=
array($errors['msg']=> False);
+ }
+ }
+
+ $msgbox_data_message=array();
+
+ if (isSet($receipt['message']) AND
is_array($receipt['message']))
+ {
+ foreach($receipt['message'] as $messages)
+ {
+ $msgbox_data_message +=
array($messages['msg']=> True);
+ }
+ }
+
+ $msgbox_data = $msgbox_data_error +
$msgbox_data_message;
+
+ return $msgbox_data;
+ }
}
?>