Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

disapprove_topic.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 2.97 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\notification\type;
015   
016  /**
017  * Topic disapproved notifications class
018  * This class handles notifications for topics when they are disapproved (for authors)
019  */
020   
021  class disapprove_topic extends \phpbb\notification\type\approve_topic
022  {
023      /**
024      * Get notification type name
025      *
026      * @return string
027      */
028      public function get_type()
029      {
030          return 'notification.type.disapprove_topic';
031      }
032   
033      /**
034      * Get the CSS style class of the notification
035      *
036      * @return string
037      */
038      public function get_style_class()
039      {
040          return 'notification-disapproved';
041      }
042   
043      /**
044      * Language key used to output the text
045      *
046      * @var string
047      */
048      protected $language_key = 'NOTIFICATION_TOPIC_DISAPPROVED';
049   
050      /**
051      * Inherit notification read status from topic.
052      *
053      * @var bool
054      */
055      protected $inherit_read_status = false;
056   
057      /**
058      * Notification option data (for outputting to the user)
059      *
060      * @var bool|array False if the service should use it's default data
061      *                     Array of data (including keys 'id', 'lang', and 'group')
062      */
063      static public $notification_option = array(
064          'id'    => 'moderation_queue',
065          'lang'    => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
066          'group'    => 'NOTIFICATION_GROUP_POSTING',
067      );
068   
069      /**
070      * Get the HTML formatted title of this notification
071      *
072      * @return string
073      */
074      public function get_title()
075      {
076          return $this->language->lang($this->language_key);
077      }
078   
079      /**
080      * Get the HTML formatted reference of the notification
081      *
082      * @return string
083      */
084      public function get_reference()
085      {
086          return $this->language->lang(
087              'NOTIFICATION_REFERENCE',
088              censor_text($this->get_data('topic_title'))
089          );
090      }
091   
092      /**
093      * Get the reason for the disapproval notification
094      *
095      * @return string
096      */
097      public function get_reason()
098      {
099          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'            => html_entity_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
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 'topic_disapproved';
158      }
159  }
160