[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/notification/type/ -> disapprove_post.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\notification\type;
  15  
  16  /**
  17  * Post disapproved notifications class
  18  * This class handles notifications for posts when they are disapproved (for authors)
  19  */
  20  
  21  class disapprove_post extends \phpbb\notification\type\approve_post
  22  {
  23      /**
  24      * Get notification type name
  25      *
  26      * @return string
  27      */
  28  	public function get_type()
  29      {
  30          return 'notification.type.disapprove_post';
  31      }
  32  
  33      /**
  34      * Get the CSS style class of the notification
  35      *
  36      * @return string
  37      */
  38  	public function get_style_class()
  39      {
  40          return 'notification-disapproved';
  41      }
  42  
  43      /**
  44      * Language key used to output the text
  45      *
  46      * @var string
  47      */
  48      protected $language_key = 'NOTIFICATION_POST_DISAPPROVED';
  49  
  50      /**
  51      * Inherit notification read status from post.
  52      *
  53      * @var bool
  54      */
  55      protected $inherit_read_status = false;
  56  
  57      /**
  58      * Notification option data (for outputting to the user)
  59      *
  60      * @var bool|array False if the service should use it's default data
  61      *                     Array of data (including keys 'id', 'lang', and 'group')
  62      */
  63      static public $notification_option = array(
  64          'id'    => 'moderation_queue',
  65          'lang'    => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
  66          'group'    => 'NOTIFICATION_GROUP_POSTING',
  67      );
  68  
  69      /**
  70      * Get the HTML formatted title of this notification
  71      *
  72      * @return string
  73      */
  74  	public function get_title()
  75      {
  76          return $this->language->lang($this->language_key);
  77      }
  78  
  79      /**
  80      * Get the HTML formatted reference of the notification
  81      *
  82      * @return string
  83      */
  84  	public function get_reference()
  85      {
  86          return $this->language->lang(
  87              'NOTIFICATION_REFERENCE',
  88              censor_text($this->get_data('topic_title'))
  89          );
  90      }
  91  
  92      /**
  93      * Get the reason for the disapproval notification
  94      *
  95      * @return string
  96      */
  97  	public function get_reason()
  98      {
  99          return $this->language->lang(
 100              'NOTIFICATION_REASON',
 101              $this->get_data('disapprove_reason')
 102          );
 103      }
 104  
 105      /**
 106      * Get the url to this item
 107      *
 108      * @return string URL
 109      */
 110  	public function get_url()
 111      {
 112          return '';
 113      }
 114  
 115      /**
 116      * Get email template variables
 117      *
 118      * @return array
 119      */
 120  	public function get_email_template_variables()
 121      {
 122          return array_merge(parent::get_email_template_variables(), array(
 123              'REASON'    => htmlspecialchars_decode($this->get_data('disapprove_reason')),
 124          ));
 125      }
 126  
 127      /**
 128      * {@inheritdoc}
 129      */
 130  	public function create_insert_array($post, $pre_create_data = array())
 131      {
 132          $this->set_data('disapprove_reason', $post['disapprove_reason']);
 133  
 134          parent::create_insert_array($post, $pre_create_data);
 135  
 136          $this->notification_time = time();
 137      }
 138  
 139      /**
 140      * {@inheritdoc}
 141      */
 142  	public function get_insert_array()
 143      {
 144          $data = parent::get_insert_array();
 145          $data['notification_time'] = $this->notification_time;
 146  
 147          return $data;
 148      }
 149  
 150      /**
 151      * Get email template
 152      *
 153      * @return string|bool
 154      */
 155  	public function get_email_template()
 156      {
 157          return 'post_disapproved';
 158      }
 159  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1