Je complète :

Si le plugin ne prend pas en charge l'affichage des notices, via
dcPage::notices(), alors elles seront affichées par le dcPage::openPage()
et par conséquent au dessus du breadcrumb et pas au dessous comme il est
prévu.


2013/10/2 Franck Paul <[email protected]>

> Non m'sieur, l'index.php est appelé et intégré une fois "nettoyé" et le
> plugin a la charge d'afficher le breadcrumb et la suite (donc les notices)
>
>
> 2013/10/2 Bruno <[email protected]>
>
>> Hello,
>>
>> Je ne comprends pas ce commit : les plugins utilisent eux aussi de
>> dcPage::open(). Indirectement, certes, mais cela fonctionne quand même :)
>>
>> --
>> Bruno
>>
>>
>> 2013/10/2 <[email protected]>
>>
>> > **
>> >  Revision: 2199 (a11a22af9561} Branch: default Author: franck ** Date:
>> 2013-10-02
>> > 11:49 +0200 Details: Details:
>> > http://dev.dotclear.org/2.0/changeset/a11a22af9561<
>> http://dev.dotclear.org/2.0/changeset/a11a22af9561> Log
>> > 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
>> >
>> >
>> > diffstat:
>> >
>> >  inc/admin/lib.dc.page.php |  13 +++++++++++--
>> >  1 files changed, 11 insertions(+), 2 deletions(-)
>> >
>> > diffs (36 lines):
>> >
>> > diff -r e9f1e3b6a3ad -r a11a22af9561 inc/admin/lib.dc.page.php
>> > --- a/inc/admin/lib.dc.page.php Wed Oct 02 09:43:49 2013 +0200
>> > +++ b/inc/admin/lib.dc.page.php Wed Oct 02 11:49:47 2013 +0200
>> > @@ -175,21 +175,30 @@
>> >                         '</div>';
>> >                 }
>> >
>> > +               // Display notices
>> > +               echo self::notices();
>> > +       }
>> > +
>> > +       public static function notices()
>> > +       {
>> > +               // return notices if any
>> > +               $res = '';
>> >                 if (isset($_SESSION['notifications'])) {
>> >                         $types = array("success" => "success", "warning"
>> > => "warning-msg", "error" => "error");
>> >                         $notifications = $_SESSION['notifications'];
>> >                         foreach ($types as $type => $class) {
>> >                                 if (isset($notifications[$type])) {
>> >                                         foreach ($notifications[$type]
>> as
>> > $n) {
>> > -                                               echo
>> > self::getNotification($n,$class);
>> > +                                               $res .=
>> > self::getNotification($n,$class);
>> >                                         }
>> >                                 }
>> >                         }
>> >                         unset($_SESSION['notifications']);
>> >                 }
>> > +               return $res;
>> >         }
>> >
>> > -       public static function AddNotice($type,$message)
>> > +       public static function addNotice($type,$message)
>> >         {
>> >                 $notification = isset($_SESSION['notifications']) ?
>> > $_SESSION['notifications'] : array();
>> >                 $notification[$type][] = array('ts' => time(), 'text' =>
>> > $message);
>> > --
>> > Tracker mailing list - [email protected] -
>> > http://ml.dotclear.net/listinfo/tracker
>> >
>> --
>> Dev mailing list - [email protected] -
>> http://ml.dotclear.org/listinfo/dev
>>
>
>
>
> --
> Franck
>



-- 
Franck
-- 
Dev mailing list - [email protected] - http://ml.dotclear.org/listinfo/dev

Répondre à