Dotclear

Changeset 3076:18ac5d848685


Ignore:
Timestamp:
08/16/15 12:40:43 (9 years ago)
Author:
Gvx <gvx@…>
Branch:
default
Message:

Fix the position of the error panel in the plugins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r3074 r3076  
    177177          } 
    178178 
    179           // Display breadcrumb (if given) before any error message 
     179          // Display breadcrumb (if given) before any error messages 
    180180          echo $breadcrumb; 
    181181 
    182           if ($core->error->flag()) { 
    183                echo 
    184                '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
     182          // Display notices and errors 
     183          echo self::notices(); 
     184     } 
     185 
     186     public static function notices() 
     187     { 
     188          global $core; 
     189          static $error_displayed = false; 
     190          $res = ''; 
     191 
     192          // return error messages if any 
     193          if ($core->error->flag() && !$error_displayed) { 
     194               $res .= '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
    185195               $core->error->toHTML(). 
    186196               '</div>'; 
    187           } 
    188  
    189           // Display notices 
    190           echo self::notices(); 
    191      } 
    192  
    193      public static function notices() 
    194      { 
     197               $error_displayed = true; 
     198          } 
     199 
    195200          // return notices if any 
    196           $res = ''; 
    197201          if (isset($_SESSION['notifications'])) { 
    198202               foreach ($_SESSION['notifications'] as $notification) { 
     
    365369          echo $breadcrumb; 
    366370 
    367           if ($core->error->flag()) { 
    368                echo 
    369                '<div class="error" role="alert"><strong>'.__('Errors:').'</strong>'. 
    370                $core->error->toHTML(). 
    371                '</div>'; 
    372           } 
     371          // Display notices and errors 
     372          echo self::notices(); 
    373373     } 
    374374 
Note: See TracChangeset for help on using the changeset viewer.

Sites map