Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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 |
type_interface.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 * Base notifications interface
018 */
019 interface type_interface
020 {
021 /**
022 * Get notification type name
023 *
024 * @return string
025 */
026 public function get_type();
027
028 /**
029 * Set initial data from the database
030 *
031 * @param array $data Row directly from the database
032 */
033 public function set_initial_data($data);
034
035 /**
036 * Get the id of the item
037 *
038 * @param array $type_data The type specific data
039 */
040 static public function get_item_id($type_data);
041
042 /**
043 * Get the id of the parent
044 *
045 * @param array $type_data The type specific data
046 */
047 static public function get_item_parent_id($type_data);
048
049 /**
050 * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
051 *
052 * @return bool True/False whether or not this is available to the user
053 */
054 public function is_available();
055
056 /**
057 * Find the users who want to receive notifications
058 *
059 * @param array $type_data The type specific data
060 * @param array $options Options for finding users for notification
061 * ignore_users => array of users and user types that should not receive notifications from this type because they've already been notified
062 * e.g.: array(2 => array(''), 3 => array('', 'email'), ...)
063 *
064 * @return array
065 */
066 public function find_users_for_notification($type_data, $options);
067
068 /**
069 * Users needed to query before this notification can be displayed
070 *
071 * @return array Array of user_ids
072 */
073 public function users_to_query();
074
075 /**
076 * Get the special items to load
077 *
078 * @return array Data will be combined sent to load_special() so you can run a single query and get data required for this notification type
079 */
080 public function get_load_special();
081
082 /**
083 * Load the special items
084 *
085 * @param array $data Data from get_load_special()
086 * @param array $notifications Array of notifications (key is notification_id, value is the notification objects)
087 */
088 public function load_special($data, $notifications);
089
090 /**
091 * Get the CSS style class of the notification
092 *
093 * @return string
094 */
095 public function get_style_class();
096
097 /**
098 * Get the HTML formatted title of this notification
099 *
100 * @return string
101 */
102 public function get_title();
103
104 /**
105 * Get the HTML formatted reference of the notification
106 *
107 * @return string
108 */
109 public function get_reference();
110
111 /**
112 * Get the forum of the notification reference
113 *
114 * @return string
115 */
116 public function get_forum();
117
118 /**
119 * Get the url to this item
120 *
121 * @return string URL
122 */
123 public function get_url();
124
125 /**
126 * Get the url to redirect after the item has been marked as read
127 *
128 * @return string URL
129 */
130 public function get_redirect_url();
131
132 /**
133 * URL to unsubscribe to this notification
134 *
135 * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item
136 */
137 public function get_unsubscribe_url($method);
138
139 /**
140 * Get the user's avatar (the user who caused the notification typically)
141 *
142 * @return string
143 */
144 public function get_avatar();
145
146 /**
147 * Prepare to output the notification to the template
148 */
149 public function prepare_for_display();
150
151 /**
152 * Get email template
153 *
154 * @return string|bool
155 */
156 public function get_email_template();
157
158 /**
159 * Get email template variables
160 *
161 * @return array
162 */
163 public function get_email_template_variables();
164
165 /**
166 * Pre create insert array function
167 * This allows you to perform certain actions, like run a query
168 * and load data, before create_insert_array() is run. The data
169 * returned from this function will be sent to create_insert_array().
170 *
171 * @param array $type_data The type specific data
172 * @param array $notify_users Notify users list
173 * Formated from find_users_for_notification()
174 * @return array Whatever you want to send to create_insert_array().
175 */
176 public function pre_create_insert_array($type_data, $notify_users);
177
178 /**
179 * Function for preparing the data for insertion in an SQL query
180 *
181 * @param array $type_data The type specific data
182 * @param array $pre_create_data Data from pre_create_insert_array()
183 */
184 public function create_insert_array($type_data, $pre_create_data);
185
186 /**
187 * Function for getting the data for insertion in an SQL query
188 *
189 * @return array Array of data ready to be inserted into the database
190 */
191 public function get_insert_array();
192
193 /**
194 * Function for preparing the data for update in an SQL query
195 * (The service handles insertion)
196 *
197 * @param array $type_data Data unique to this notification type
198 *
199 * @return array Array of data ready to be updated in the database
200 */
201 public function create_update_array($type_data);
202
203 /**
204 * Mark this item read
205 *
206 * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
207 * @return string
208 */
209 public function mark_read($return = false);
210
211 /**
212 * Mark this item unread
213 *
214 * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
215 * @return string
216 */
217 public function mark_unread($return = false);
218 }
219