From b3cdbfe88a3f9077c60f1631c9ca32d1c528f605 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 29 Apr 2012 14:39:41 +0000 Subject: [PATCH] functions.inc.php: - _flash_string(): also accept an array of messages, not only a string - comment updates for _flash_info() and flash_error() to reflect this change git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1378 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 511083a6..9005c924 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -113,7 +113,7 @@ function authentication_is_user() { /** * Add an error message for display on the next page that is rendered. - * @param String message to show. + * @param String/Array message(s) to show. * * Stores string in session. Flushed through header template. * @see _flash_string() @@ -124,8 +124,8 @@ function flash_error($string) { /** * Used to display an info message on successful update. - * @param String $string - * Stores data in sessio. + * @param String/Array message(s) to show. + * Stores data in session. * @see _flash_string() */ function flash_info($string) { @@ -135,6 +135,13 @@ function flash_info($string) { * 'Private' method used for flash_info() and flash_error(). */ function _flash_string($type, $string) { + if (is_array($string)) { + foreach ($string as $singlestring) { + _flash_string($type, $singlestring); + return; + } + } + if(!isset($_SESSION['flash'])) { $_SESSION['flash'] = array(); }