Changeset 1381


Ignore:
Timestamp:
Jun 22, 2006, 11:34:23 PM (18 years ago)
Author:
nikrou
Message:

fix bug 375: html bug; warnings are displayed outside from the html tree.
svn merge -r1379:1380 from trunk into branch 1.6

Location:
branches/branch-1_6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_6/include/common.inc.php

    r1371 r1381  
    112112$user = array();
    113113$lang = array();
    114 
     114$warnings = array();
    115115
    116116@include(PHPWG_ROOT_PATH .'include/mysql.inc.php');
     
    148148  if (count(array_diff($existing, $applied)) > 0)
    149149  {
    150     ob_start();// buffer output so that cookies work
    151 
    152     echo
    153       '<p>'
    154       .'Some database upgrades are missing, '
    155       .'<a href="'.PHPWG_ROOT_PATH.'upgrade_feed.php">upgrade now</a>'
    156       .'</p>'
    157       ;
     150    $warnings[] = 'Some database upgrades are missing, '
     151      .'<a href="'.PHPWG_ROOT_PATH.'upgrade_feed.php">upgrade now</a>';
    158152  }
    159153}
     
    177171if ($conf['gallery_locked'])
    178172{
    179   ob_start(); // make sure we can send cookies
    180   echo
    181     '<div style="text-align:center;">'
    182     .$lang['gallery_locked_message'];
    183   echo '<a href="'.PHPWG_ROOT_PATH.'identification.php">.</a>';
    184   echo '</div>';
     173  $warnings[] = $lang['gallery_locked_message']
     174    . '<a href="'.PHPWG_ROOT_PATH.'identification.php">.</a>';
    185175
    186176  if ( basename($_SERVER["PHP_SELF"]) != 'identification.php'
     
    219209if (is_adviser())
    220210{
    221   ob_start();// buffer output so that cookies work
    222   echo '
    223   <div class="titrePage">
    224     <h2>
    225       <div style="text-align:center;">'.$lang['adviser_mode_enabled'].'
    226       </div>
    227     </h2>
    228   </div>
    229   ';
     211  $warnings[] = $lang['adviser_mode_enabled'];
    230212}
    231213
    232214// template instance
    233215$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']);
     216
     217if (count($warnings) > 0)
     218{
     219  $template->assign_block_vars('warnings',array());
     220  foreach ($warnings as $warning)
     221  {
     222    $template->assign_block_vars('warnings.warning', array('WARNING'=>$warning));
     223  }
     224}
    234225?>
  • branches/branch-1_6/template/yoga/header.tpl

    r1368 r1381  
    3333
    3434<div id="theHeader">{PAGE_BANNER}</div>
     35<!-- BEGIN warnings -->
     36<div class="infos">
     37  <ul>
     38    <!-- BEGIN warning -->
     39    <li>{warnings.warning.WARNING}</li>
     40    <!-- END warning -->
     41  </ul>
     42</div>
     43<!-- END warnings -->
Note: See TracChangeset for help on using the changeset viewer.