// method below).
abstract public function HandleAction($action);
+ // Displays a reduced version of the reminder and notifies that the action
+ // has been taken into account.
+ public function NotifiesAction(&$page)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $page->changeTpl('reminder/notification.tpl', NO_SKIN);
+ $page->assign('previous_reminder', $this->title());
+ }
+
// Displays the reminder as a standalone html snippet. It should be used
// when the reminder is the only output of a page.
- public function DisplayStandalone(&$page)
+ public function DisplayStandalone(&$page, $previous_reminder = null)
{
header('Content-Type: text/html; charset=utf-8');
$page->changeTpl('reminder/base.tpl', NO_SKIN);
$this->Prepare($page);
+ if ($previous_reminder) {
+ $page->assign('previous_reminder', $previous_reminder);
+ }
}
// Prepares the display by assigning template variables.
// displayed.
$reminder->HandleAction($action);
+ $previous_reminder = $reminder->title();
+
if (($new_reminder = Reminder::GetCandidateReminder($user))) {
- $new_reminder->DisplayStandalone($page);
+ $new_reminder->DisplayStandalone($page, $previous_reminder);
} else {
- exit;
+ $reminder->NotifiesAction($page);
}
}
}
{**************************************************************************}
<div id="reminder">
+ {if $previous_reminder}
+ {include file="reminder/notification.tpl" previous_reminder=$previous_reminder}
+ {/if}
+
<fieldset class="warnings">
<legend>
{if $reminder->warning()}{icon name=error}{else}{icon name=information}{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<div id="reminder">
+ <fieldset class="success">
+ <legend>
+ {icon name=information} {$previous_reminder}
+ </legend>
+ Ta demande a bien été prise en compte.
+ </fieldset>
+</div>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}