@@ -21,32 +21,32 @@ discard block |
||
| 21 | 21 | protected $helper; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Set the controller helper |
|
| 25 | - * |
|
| 26 | - * @param \phpbb\controller\helper $helper |
|
| 27 | - * @return null |
|
| 28 | - */ |
|
| 24 | + * Set the controller helper |
|
| 25 | + * |
|
| 26 | + * @param \phpbb\controller\helper $helper |
|
| 27 | + * @return null |
|
| 28 | + */ |
|
| 29 | 29 | public function set_controller_helper(\phpbb\controller\helper $helper) |
| 30 | 30 | { |
| 31 | 31 | $this->helper = $helper; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Get notification type name |
|
| 36 | - * |
|
| 37 | - * @return string |
|
| 38 | - */ |
|
| 35 | + * Get notification type name |
|
| 36 | + * |
|
| 37 | + * @return string |
|
| 38 | + */ |
|
| 39 | 39 | public function get_type() |
| 40 | 40 | { |
| 41 | 41 | return 'ernadoo.phpbbdirectory.notification.type.directory_website'; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Notification option data (for outputting to the user) |
|
| 46 | - * |
|
| 47 | - * @var bool|array False if the service should use it's default data |
|
| 48 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | - */ |
|
| 45 | + * Notification option data (for outputting to the user) |
|
| 46 | + * |
|
| 47 | + * @var bool|array False if the service should use it's default data |
|
| 48 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | + */ |
|
| 50 | 50 | public static $notification_option = array( |
| 51 | 51 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_WEBSITE', |
| 52 | 52 | 'group' => 'NOTIFICATION_DIR_UCP', |
@@ -61,31 +61,31 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | - * Is available |
|
| 65 | - * |
|
| 66 | - * @return bool True/False whether or not this is available to the user |
|
| 67 | - */ |
|
| 64 | + * Is available |
|
| 65 | + * |
|
| 66 | + * @return bool True/False whether or not this is available to the user |
|
| 67 | + */ |
|
| 68 | 68 | public function is_available() |
| 69 | 69 | { |
| 70 | 70 | return true; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | - * Get link id |
|
| 75 | - * |
|
| 76 | - * @param array $data The data from the link |
|
| 77 | - * @return int |
|
| 78 | - */ |
|
| 74 | + * Get link id |
|
| 75 | + * |
|
| 76 | + * @param array $data The data from the link |
|
| 77 | + * @return int |
|
| 78 | + */ |
|
| 79 | 79 | static public function get_item_id($data) |
| 80 | 80 | { |
| 81 | 81 | return (int) $data['link_id']; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * Get parent id - it's not used |
|
| 86 | - * |
|
| 87 | - * @param array $data The data from the link |
|
| 88 | - */ |
|
| 85 | + * Get parent id - it's not used |
|
| 86 | + * |
|
| 87 | + * @param array $data The data from the link |
|
| 88 | + */ |
|
| 89 | 89 | static public function get_item_parent_id($data) |
| 90 | 90 | { |
| 91 | 91 | // No parent |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * Find the users who want to receive notifications |
|
| 97 | - * |
|
| 98 | - * @param array $data Data from submit link |
|
| 99 | - * @param array $options Options for finding users for notification |
|
| 100 | - * @return array |
|
| 101 | - */ |
|
| 96 | + * Find the users who want to receive notifications |
|
| 97 | + * |
|
| 98 | + * @param array $data Data from submit link |
|
| 99 | + * @param array $options Options for finding users for notification |
|
| 100 | + * @return array |
|
| 101 | + */ |
|
| 102 | 102 | public function find_users_for_notification($data, $options = array()) |
| 103 | 103 | { |
| 104 | 104 | $options = array_merge(array( |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * Get the user's avatar |
|
| 134 | - */ |
|
| 133 | + * Get the user's avatar |
|
| 134 | + */ |
|
| 135 | 135 | public function get_avatar() |
| 136 | 136 | { |
| 137 | 137 | return $this->user_loader->get_avatar($this->get_data('user_from'), false, true); |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Get the HTML formatted title of this notification |
|
| 143 | - * |
|
| 144 | - * @return string |
|
| 145 | - */ |
|
| 142 | + * Get the HTML formatted title of this notification |
|
| 143 | + * |
|
| 144 | + * @return string |
|
| 145 | + */ |
|
| 146 | 146 | |
| 147 | 147 | public function get_title() |
| 148 | 148 | { |
@@ -155,20 +155,20 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * Get email template |
|
| 159 | - * |
|
| 160 | - * @return string |
|
| 161 | - */ |
|
| 158 | + * Get email template |
|
| 159 | + * |
|
| 160 | + * @return string |
|
| 161 | + */ |
|
| 162 | 162 | public function get_email_template() |
| 163 | 163 | { |
| 164 | 164 | return '@ernadoo_phpbbdirectory/directory_website'; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * Get email template variables |
|
| 169 | - * |
|
| 170 | - * @return array |
|
| 171 | - */ |
|
| 168 | + * Get email template variables |
|
| 169 | + * |
|
| 170 | + * @return array |
|
| 171 | + */ |
|
| 172 | 172 | public function get_email_template_variables() |
| 173 | 173 | { |
| 174 | 174 | return array( |
@@ -180,33 +180,33 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * Get the url to this item |
|
| 184 | - * |
|
| 185 | - * @return string URL |
|
| 186 | - */ |
|
| 183 | + * Get the url to this item |
|
| 184 | + * |
|
| 185 | + * @return string URL |
|
| 186 | + */ |
|
| 187 | 187 | public function get_url() |
| 188 | 188 | { |
| 189 | 189 | return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id'))); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Users needed to query before this notification can be displayed |
|
| 194 | - * |
|
| 195 | - * @return array Array of user_ids |
|
| 196 | - */ |
|
| 193 | + * Users needed to query before this notification can be displayed |
|
| 194 | + * |
|
| 195 | + * @return array Array of user_ids |
|
| 196 | + */ |
|
| 197 | 197 | public function users_to_query() |
| 198 | 198 | { |
| 199 | 199 | return array($this->get_data('user_from')); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | - * Function for preparing the data for insertion in an SQL query |
|
| 204 | - * (The service handles insertion) |
|
| 205 | - * |
|
| 206 | - * @param array $data Data from submit link |
|
| 207 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 208 | - * @return array Array of data ready to be inserted into the database |
|
| 209 | - */ |
|
| 203 | + * Function for preparing the data for insertion in an SQL query |
|
| 204 | + * (The service handles insertion) |
|
| 205 | + * |
|
| 206 | + * @param array $data Data from submit link |
|
| 207 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 208 | + * @return array Array of data ready to be inserted into the database |
|
| 209 | + */ |
|
| 210 | 210 | public function create_insert_array($data, $pre_create_data = array()) |
| 211 | 211 | { |
| 212 | 212 | $this->set_data('link_name', $data['link_name']); |
@@ -21,32 +21,32 @@ discard block |
||
| 21 | 21 | protected $helper; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Set the controller helper |
|
| 25 | - * |
|
| 26 | - * @param \phpbb\controller\helper $helper |
|
| 27 | - * @return null |
|
| 28 | - */ |
|
| 24 | + * Set the controller helper |
|
| 25 | + * |
|
| 26 | + * @param \phpbb\controller\helper $helper |
|
| 27 | + * @return null |
|
| 28 | + */ |
|
| 29 | 29 | public function set_controller_helper(\phpbb\controller\helper $helper) |
| 30 | 30 | { |
| 31 | 31 | $this->helper = $helper; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Get notification type name |
|
| 36 | - * |
|
| 37 | - * @return string |
|
| 38 | - */ |
|
| 35 | + * Get notification type name |
|
| 36 | + * |
|
| 37 | + * @return string |
|
| 38 | + */ |
|
| 39 | 39 | public function get_type() |
| 40 | 40 | { |
| 41 | 41 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_approved'; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Notification option data (for outputting to the user) |
|
| 46 | - * |
|
| 47 | - * @var bool|array False if the service should use it's default data |
|
| 48 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | - */ |
|
| 45 | + * Notification option data (for outputting to the user) |
|
| 46 | + * |
|
| 47 | + * @var bool|array False if the service should use it's default data |
|
| 48 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | + */ |
|
| 50 | 50 | public static $notification_option = array( |
| 51 | 51 | 'id' => 'dir_moderation_queue', |
| 52 | 52 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE', |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Permission to check for (in find_users_for_notification) |
|
| 58 | - * |
|
| 59 | - * @var string Permission name |
|
| 60 | - */ |
|
| 57 | + * Permission to check for (in find_users_for_notification) |
|
| 58 | + * |
|
| 59 | + * @var string Permission name |
|
| 60 | + */ |
|
| 61 | 61 | protected $permission = array('a_', 'm_'); |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | - * Is available |
|
| 65 | - * |
|
| 66 | - * @return bool True/False whether or not this is available to the user |
|
| 67 | - */ |
|
| 64 | + * Is available |
|
| 65 | + * |
|
| 66 | + * @return bool True/False whether or not this is available to the user |
|
| 67 | + */ |
|
| 68 | 68 | public function is_available() |
| 69 | 69 | { |
| 70 | 70 | $has_permission = $this->auth->acl_gets($this->permission, true); |
@@ -73,21 +73,21 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * Get link id |
|
| 77 | - * |
|
| 78 | - * @param array $data The data from the link |
|
| 79 | - * @return int |
|
| 80 | - */ |
|
| 76 | + * Get link id |
|
| 77 | + * |
|
| 78 | + * @param array $data The data from the link |
|
| 79 | + * @return int |
|
| 80 | + */ |
|
| 81 | 81 | static public function get_item_id($data) |
| 82 | 82 | { |
| 83 | 83 | return (int) $data['link_id']; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * Get parent id - it's not used |
|
| 88 | - * |
|
| 89 | - * @param array $data The data from the link |
|
| 90 | - */ |
|
| 87 | + * Get parent id - it's not used |
|
| 88 | + * |
|
| 89 | + * @param array $data The data from the link |
|
| 90 | + */ |
|
| 91 | 91 | static public function get_item_parent_id($data) |
| 92 | 92 | { |
| 93 | 93 | // No parent |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * Find the users who want to receive notifications |
|
| 99 | - * |
|
| 100 | - * @param array $data Data from submit link |
|
| 101 | - * @param array $options Options for finding users for notification |
|
| 102 | - * @return array |
|
| 103 | - */ |
|
| 98 | + * Find the users who want to receive notifications |
|
| 99 | + * |
|
| 100 | + * @param array $data Data from submit link |
|
| 101 | + * @param array $options Options for finding users for notification |
|
| 102 | + * @return array |
|
| 103 | + */ |
|
| 104 | 104 | public function find_users_for_notification($data, $options = array()) |
| 105 | 105 | { |
| 106 | 106 | $options = array_merge(array( |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * Get the HTML formatted title of this notification |
|
| 120 | - * |
|
| 121 | - * @return string |
|
| 122 | - */ |
|
| 119 | + * Get the HTML formatted title of this notification |
|
| 120 | + * |
|
| 121 | + * @return string |
|
| 122 | + */ |
|
| 123 | 123 | public function get_title() |
| 124 | 124 | { |
| 125 | 125 | $link_name = $this->get_data('link_name'); |
@@ -129,20 +129,20 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * Get email template |
|
| 133 | - * |
|
| 134 | - * @return string |
|
| 135 | - */ |
|
| 132 | + * Get email template |
|
| 133 | + * |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 136 | 136 | public function get_email_template() |
| 137 | 137 | { |
| 138 | 138 | return '@ernadoo_phpbbdirectory/directory_website_approved'; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Get email template variables |
|
| 143 | - * |
|
| 144 | - * @return array |
|
| 145 | - */ |
|
| 142 | + * Get email template variables |
|
| 143 | + * |
|
| 144 | + * @return array |
|
| 145 | + */ |
|
| 146 | 146 | public function get_email_template_variables() |
| 147 | 147 | { |
| 148 | 148 | return array( |
@@ -151,33 +151,33 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | - * Get the url to this item |
|
| 155 | - * |
|
| 156 | - * @return string URL |
|
| 157 | - */ |
|
| 154 | + * Get the url to this item |
|
| 155 | + * |
|
| 156 | + * @return string URL |
|
| 157 | + */ |
|
| 158 | 158 | public function get_url() |
| 159 | 159 | { |
| 160 | 160 | return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id'))); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | - * Users needed to query before this notification can be displayed |
|
| 165 | - * |
|
| 166 | - * @return array Array of user_ids |
|
| 167 | - */ |
|
| 164 | + * Users needed to query before this notification can be displayed |
|
| 165 | + * |
|
| 166 | + * @return array Array of user_ids |
|
| 167 | + */ |
|
| 168 | 168 | public function users_to_query() |
| 169 | 169 | { |
| 170 | 170 | return array(); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Function for preparing the data for insertion in an SQL query |
|
| 175 | - * (The service handles insertion) |
|
| 176 | - * |
|
| 177 | - * @param array $data Data from submit link |
|
| 178 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 179 | - * @return array Array of data ready to be inserted into the database |
|
| 180 | - */ |
|
| 174 | + * Function for preparing the data for insertion in an SQL query |
|
| 175 | + * (The service handles insertion) |
|
| 176 | + * |
|
| 177 | + * @param array $data Data from submit link |
|
| 178 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 179 | + * @return array Array of data ready to be inserted into the database |
|
| 180 | + */ |
|
| 181 | 181 | public function create_insert_array($data, $pre_create_data = array()) |
| 182 | 182 | { |
| 183 | 183 | $this->set_data('link_name', $data['link_name']); |