Пример #1
0
 /**
  * Prepare to output the notification to the template
  *
  * @return array Template variables
  */
 public function prepare_for_display()
 {
     $mark_hash = generate_link_hash('mark_notification_read');
     if ($this->get_url()) {
         $u_mark_read = append_sid($this->src_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&hash=' . $mark_hash);
     } else {
         $redirect = ($this->user->page['page_dir'] ? $this->user->page['page_dir'] . '/' : '') . $this->user->page['page_name'] . ($this->user->page['query_string'] ? '?' . $this->user->page['query_string'] : '');
         $u_mark_read = append_sid($this->src_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&hash=' . $mark_hash . '&redirect=' . urlencode($redirect));
     }
     return array('NOTIFICATION_ID' => $this->notification_id, 'STYLING' => $this->get_style_class(), 'AVATAR' => $this->get_avatar(), 'FORMATTED_TITLE' => $this->get_title(), 'REFERENCE' => $this->get_reference(), 'FORUM' => $this->get_forum(), 'REASON' => $this->get_reason(), 'URL' => $this->get_url(), 'TIME' => $this->user->format_date($this->notification_time), 'UNREAD' => !$this->notification_read, 'U_MARK_READ' => !$this->notification_read ? $u_mark_read : '');
 }