X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder.inc.php;h=715d2d541747d72533d5604f4c35ddac051cfd09;hb=e5539fd7d9aa7dae6151ec0636c8efdf65ee1c47;hp=a28d8393f0b3b845184b5d586ec2e5106ba1cb05;hpb=4b0cb388b3b573048f35d1050c9c459c3090b16c;p=platal.git diff --git a/include/reminder.inc.php b/include/reminder.inc.php index a28d839..715d2d5 100644 --- a/include/reminder.inc.php +++ b/include/reminder.inc.php @@ -1,6 +1,6 @@ 0 ? time() + $next_ask * 24 * 60 * 60 : null)); } @@ -101,13 +101,25 @@ abstract class Reminder // 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) + { + pl_content_headers("text/html"); + $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'); + pl_content_headers("text/html"); $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. @@ -136,14 +148,17 @@ abstract class Reminder return 'ajax/reminder/' . $this->name; } + // Returns the url for the information page. + public function info() { return ''; } + // Static status update methods ------------------------------------------- - // Marks the candidate reminder as having been accepted for user |user_id|. + // Marks the candidate reminder as having been accepted for user |uid|. // It is intended to be used when a reminder box has been bypassed, and when // it should behave as if the user had clicked on 'yes'. - protected static function MarkCandidateAsAccepted($user_id, $candidate) + protected static function MarkCandidateAsAccepted($uid, $candidate) { - Reminder::UpdateStatus($user_id, $candidate['type_id'], + Reminder::UpdateStatus($uid, $candidate['type_id'], 'yes', $candidate['remind_delay_yes']); }