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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
report_post_closed.php
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 * Post report closed notifications class
018 * This class handles notifications for when reports are closed on posts (for the one who reported the post)
019 */
020
021 class report_post_closed extends \phpbb\notification\type\post
022 {
023 /**
024 * Get notification type name
025 *
026 * @return string
027 */
028 public function get_type()
029 {
030 return 'notification.type.report_post_closed';
031 }
032
033 /**
034 * Email template to use to send notifications
035 *
036 * @var string
037 */
038 public $email_template = '';
039
040 /**
041 * Language key used to output the text
042 *
043 * @var string
044 */
045 protected $language_key = 'NOTIFICATION_REPORT_CLOSED';
046
047 /**
048 * Inherit notification read status from post.
049 *
050 * @var bool
051 */
052 protected $inherit_read_status = false;
053
054 public function is_available()
055 {
056 return false;
057 }
058
059 /**
060 * Find the users who want to receive notifications
061 *
062 * @param array $post Data from submit_post
063 * @param array $options Options for finding users for notification
064 *
065 * @return array
066 */
067 public function find_users_for_notification($post, $options = array())
068 {
069 if ($post['reporter'] == $this->user->data['user_id'])
070 {
071 return array();
072 }
073
074 return array($post['reporter'] => array(''));
075 }
076
077 /**
078 * Get email template
079 *
080 * @return string|bool
081 */
082 public function get_email_template()
083 {
084 return false;
085 }
086
087 /**
088 * Get email template variables
089 *
090 * @return array
091 */
092 public function get_email_template_variables()
093 {
094 return array();
095 }
096
097 /**
098 * Get the url to this item
099 *
100 * @return string URL
101 */
102 public function get_url()
103 {
104 return '';
105 }
106
107 /**
108 * Get the HTML formatted title of this notification
109 *
110 * @return string
111 */
112 public function get_title()
113 {
114 $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
115
116 return $this->user->lang(
117 $this->language_key,
118 $username
119 );
120 }
121
122 /**
123 * Get the HTML formatted reference of the notification
124 *
125 * @return string
126 */
127 public function get_reference()
128 {
129 return $this->user->lang(
130 'NOTIFICATION_REFERENCE',
131 censor_text($this->get_data('post_subject'))
132 );
133 }
134
135 /**
136 * Get the user's avatar
137 */
138 public function get_avatar()
139 {
140 return $this->user_loader->get_avatar($this->get_data('closer_id'));
141 }
142
143 /**
144 * Users needed to query before this notification can be displayed
145 *
146 * @return array Array of user_ids
147 */
148 public function users_to_query()
149 {
150 return array($this->get_data('closer_id'));
151 }
152
153 /**
154 * Function for preparing the data for insertion in an SQL query
155 * (The service handles insertion)
156 *
157 * @param array $post Data from submit_post
158 * @param array $pre_create_data Data from pre_create_insert_array()
159 *
160 * @return array Array of data ready to be inserted into the database
161 */
162 public function create_insert_array($post, $pre_create_data = array())
163 {
164 $this->set_data('closer_id', $post['closer_id']);
165
166 $data = parent::create_insert_array($post, $pre_create_data);
167
168 $this->notification_time = $data['notification_time'] = time();
169
170 return $data;
171 }
172 }
173