[geeklog-cvs] geeklog: Allow overwriting the block title for COM_showMessageText

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Oct 5 10:54:19 EDT 2008


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/740473084c93
changeset: 6428:740473084c93
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Oct 05 16:54:06 2008 +0200
description:
Allow overwriting the block title for COM_showMessageText

diffstat:

1 file changed, 6 insertions(+), 2 deletions(-)
public_html/lib-common.php |    8 ++++++--

diffs (28 lines):

diff -r 69001156092c -r 740473084c93 public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Oct 05 16:46:26 2008 +0200
+++ b/public_html/lib-common.php	Sun Oct 05 16:54:06 2008 +0200
@@ -4466,18 +4466,22 @@
 * Displays a message text in a "System Message" block
 *
 * @param    string  $message    Message text; may contain HTML
+* @param    string  $title      (optional) alternative block title
 * @return   string              HTML block with message
 *
 */
-function COM_showMessageText($message)
+function COM_showMessageText($message, $title = '')
 {
     global $_CONF, $MESSAGE, $_IMAGE_TYPE;
 
     $retval = '';
 
     if (!empty($message)) {
+        if (empty($title)) {
+            $title = $MESSAGE[40];
+        }
         $timestamp = strftime($_CONF['daytime']);
-        $retval .= COM_startBlock($MESSAGE[40] . ' - ' . $timestamp, '',
+        $retval .= COM_startBlock($title . ' - ' . $timestamp, '',
                                   COM_getBlockTemplate('_msg_block', 'header'))
                 . '<p class="sysmessage"><img src="' . $_CONF['layout_url']
                 . '/images/sysmessage.' . $_IMAGE_TYPE . '" alt="" ' . XHTML



More information about the geeklog-cvs mailing list