Dotclear

Changeset 2199:a11a22af9561


Ignore:
Timestamp:
10/02/13 11:49:47 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Revamp notices in order to be used by plugins, ie, not using dcPage::open() in their index.php
Now plugins should echo dcPage::notices(); after displaying breadcrumb

File:
1 edited

Legend:

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

    r2191 r2199  
    176176          } 
    177177 
     178          // Display notices 
     179          echo self::notices(); 
     180     } 
     181 
     182     public static function notices() 
     183     { 
     184          // return notices if any 
     185          $res = ''; 
    178186          if (isset($_SESSION['notifications'])) { 
    179187               $types = array("success" => "success", "warning" => "warning-msg", "error" => "error"); 
     
    182190                    if (isset($notifications[$type])) { 
    183191                         foreach ($notifications[$type] as $n) { 
    184                               echo self::getNotification($n,$class); 
     192                              $res .= self::getNotification($n,$class); 
    185193                         } 
    186194                    } 
     
    188196               unset($_SESSION['notifications']); 
    189197          } 
    190      } 
    191  
    192      public static function AddNotice($type,$message) 
     198          return $res; 
     199     } 
     200 
     201     public static function addNotice($type,$message) 
    193202     { 
    194203          $notification = isset($_SESSION['notifications']) ? $_SESSION['notifications'] : array(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map