Dotclear


Ignore:
File:
1 edited

Legend:

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

    r3080 r3086  
    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'])) { 
    198                $notifications = $_SESSION['notifications']; 
    199202               foreach ($_SESSION['notifications'] as $notification) { 
    200203                    $res .= self::getNotification($notification); 
     
    366369          echo $breadcrumb; 
    367370 
    368           if ($core->error->flag()) { 
    369                echo 
    370                '<div class="error" role="alert"><strong>'.__('Errors:').'</strong>'. 
    371                $core->error->toHTML(). 
    372                '</div>'; 
    373           } 
     371          // Display notices and errors 
     372          echo self::notices(); 
    374373     } 
    375374 
     
    545544     } 
    546545 
    547      public static function cssLoad($src, $media='screen') 
     546     public static function cssLoad($src,$media='screen',$v='') 
    548547     { 
    549548          $escaped_src = html::escapeHTML($src); 
    550549          if (!isset(self::$loaded_css[$escaped_src])) { 
    551550               self::$loaded_css[$escaped_src] = true; 
    552                $escaped_src = self::appendVersion($escaped_src); 
     551               $escaped_src = self::appendVersion($escaped_src,$v); 
    553552 
    554553               return '<link rel="stylesheet" href="'.$escaped_src.'" type="text/css" media="'.$media.'" />'."\n"; 
     
    556555     } 
    557556 
    558      public static function jsLoad($src) 
     557     public static function jsLoad($src,$v='') 
    559558     { 
    560559          $escaped_src = html::escapeHTML($src); 
    561560          if (!isset(self::$loaded_js[$escaped_src])) { 
    562561               self::$loaded_js[$escaped_src] = true; 
    563                $escaped_src = self::appendVersion($escaped_src); 
     562               $escaped_src = self::appendVersion($escaped_src,$v); 
    564563               return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; 
    565564          } 
    566565     } 
    567566 
    568      private static function appendVersion($src) 
    569      { 
    570           if (strpos($src,'?')===false) { 
    571                $src .= '?v='; 
    572           } else { 
    573                $src .= '&v='; 
    574           } 
    575  
     567     private static function appendVersion($src,$v='') 
     568     { 
     569          $src .= (strpos($src,'?') === false ? '?' : '&').'v='; 
    576570          if (defined('DC_DEV') && DC_DEV === true) { 
    577571               $src .= md5(uniqid()); 
    578572          } else { 
    579                $src .= DC_VERSION; 
    580           } 
    581  
     573               $src .= ($v === '' ? DC_VERSION : $v); 
     574          } 
    582575          return $src; 
    583576     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map