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

report_pm_closed.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 3.06 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  * PM report closed notifications class
018  * This class handles notifications for when reports are closed on PMs (for the one who reported the PM)
019  */
020   
021  class report_pm_closed extends \phpbb\notification\type\pm
022  {
023      /**
024      * Get notification type name
025      *
026      * @return string
027      */
028      public function get_type()
029      {
030          return 'notification.type.report_pm_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      public function is_available()
048      {
049          return false;
050      }
051   
052      /**
053      * Find the users who want to receive notifications
054      *
055      * @param array $pm Data from submit_pm
056      * @param array $options Options for finding users for notification
057      *
058      * @return array
059      */
060      public function find_users_for_notification($pm, $options = array())
061      {
062          if ($pm['reporter'] == $this->user->data['user_id'])
063          {
064              return array();
065          }
066   
067          return array($pm['reporter'] => array(''));
068      }
069   
070      /**
071      * Get email template
072      *
073      * @return string|bool
074      */
075      public function get_email_template()
076      {
077          return false;
078      }
079   
080      /**
081      * Get email template variables
082      *
083      * @return array
084      */
085      public function get_email_template_variables()
086      {
087          return array();
088      }
089   
090      /**
091      * Get the url to this item
092      *
093      * @return string URL
094      */
095      public function get_url()
096      {
097          return '';
098      }
099   
100      /**
101      * Get the HTML formatted title of this notification
102      *
103      * @return string
104      */
105      public function get_title()
106      {
107          $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
108   
109          return $this->user->lang(
110              $this->language_key,
111              $username
112          );
113      }
114   
115      /**
116      * Get the HTML formatted reference of the notification
117      *
118      * @return string
119      */
120      public function get_reference()
121      {
122          return $this->user->lang(
123              'NOTIFICATION_REFERENCE',
124              censor_text($this->get_data('message_subject'))
125          );
126      }
127   
128      /**
129      * Get the user's avatar
130      */
131      public function get_avatar()
132      {
133          return $this->user_loader->get_avatar($this->get_data('closer_id'));
134      }
135   
136      /**
137      * Users needed to query before this notification can be displayed
138      *
139      * @return array Array of user_ids
140      */
141      public function users_to_query()
142      {
143          return array($this->get_data('closer_id'));
144      }
145   
146      /**
147      * Function for preparing the data for insertion in an SQL query
148      * (The service handles insertion)
149      *
150      * @param array $pm PM Data
151      * @param array $pre_create_data Data from pre_create_insert_array()
152      *
153      * @return array Array of data ready to be inserted into the database
154      */
155      public function create_insert_array($pm, $pre_create_data = array())
156      {
157          $this->set_data('closer_id', $pm['closer_id']);
158   
159          $data = parent::create_insert_array($pm, $pre_create_data);
160   
161          $this->notification_time = $data['notification_time'] = time();
162   
163          return $data;
164      }
165  }
166