Changeset 1380 for trunk


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

fix bug 375: html bug; warnings are displayed outside from the html tree.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r1377 r1380  
    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?>
  • trunk/template/yoga/header.tpl

    r1377 r1380  
    3131<body id="{BODY_ID}">
    3232<div id="the_page">
    33 
    3433{PAGE_BANNER}
     34<!-- BEGIN warnings -->
     35<div class="infos">
     36  <ul>
     37    <!-- BEGIN warning -->
     38    <li>{warnings.warning.WARNING}</li>
     39    <!-- END warning -->
     40  </ul>
     41</div>
     42<!-- END warnings -->
Note: See TracChangeset for help on using the changeset viewer.