Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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: 09.10.2024, 12:54 - Dateigröße: 3.09 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      public static $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->user->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->user->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->user->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      * Function for preparing the data for insertion in an SQL query
129      * (The service handles insertion)
130      *
131      * @param array $post Data from submit_post
132      * @param array $pre_create_data Data from pre_create_insert_array()
133      *
134      * @return array Array of data ready to be inserted into the database
135      */
136      public function create_insert_array($post, $pre_create_data = array())
137      {
138          $this->set_data('disapprove_reason', $post['disapprove_reason']);
139   
140          $data = parent::create_insert_array($post, $pre_create_data);
141   
142          $this->notification_time = $data['notification_time'] = time();
143   
144          return $data;
145      }
146   
147      /**
148      * Get email template
149      *
150      * @return string|bool
151      */
152      public function get_email_template()
153      {
154          return 'topic_disapproved';
155      }
156  }
157