From 887bbb6ddbd43e13823879f582955957140a9f4c Mon Sep 17 00:00:00 2001 From: nikrou Date: Thu, 22 Jun 2006 21:34:23 +0000 Subject: fix bug 375: html bug; warnings are displayed outside from the html tree. svn merge -r1379:1380 from trunk into branch 1.6 git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1381 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/common.inc.php | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/common.inc.php b/include/common.inc.php index 2c9364d38..35b6dd187 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -111,7 +111,7 @@ $conf = array(); $page = array(); $user = array(); $lang = array(); - +$warnings = array(); @include(PHPWG_ROOT_PATH .'include/mysql.inc.php'); if (!defined('PHPWG_INSTALLED')) @@ -147,14 +147,8 @@ SELECT id // which upgrades need to be applied? if (count(array_diff($existing, $applied)) > 0) { - ob_start();// buffer output so that cookies work - - echo - '

' - .'Some database upgrades are missing, ' - .'upgrade now' - .'

' - ; + $warnings[] = 'Some database upgrades are missing, ' + .'upgrade now'; } } @@ -176,12 +170,8 @@ if (defined('IN_ADMIN') and IN_ADMIN) if ($conf['gallery_locked']) { - ob_start(); // make sure we can send cookies - echo - '
' - .$lang['gallery_locked_message']; - echo '.'; - echo '
'; + $warnings[] = $lang['gallery_locked_message'] + . '.'; if ( basename($_SERVER["PHP_SELF"]) != 'identification.php' and !is_admin() ) @@ -218,17 +208,18 @@ include( if (is_adviser()) { - ob_start();// buffer output so that cookies work - echo ' -
-

-
'.$lang['adviser_mode_enabled'].' -
-

-
- '; + $warnings[] = $lang['adviser_mode_enabled']; } // template instance $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']); + +if (count($warnings) > 0) +{ + $template->assign_block_vars('warnings',array()); + foreach ($warnings as $warning) + { + $template->assign_block_vars('warnings.warning', array('WARNING'=>$warning)); + } +} ?> -- cgit v1.2.3