@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | private $ext_name = 'ernadoo/phpbbdirectory'; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\extension\manager $phpbb_extension_manager Extension manager helper |
|
28 | - * @param \phpbb\path_helper $path_helper Controller path helper object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\extension\manager $phpbb_extension_manager Extension manager helper |
|
28 | + * @param \phpbb\path_helper $path_helper Controller path helper object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
31 | 31 | { |
32 | 32 | $this->extension_manager = $phpbb_extension_manager; |
@@ -34,48 +34,48 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Return ext name |
|
38 | - * |
|
39 | - * @param bool $web_root_path Whether the path should be relative to web root |
|
40 | - * @return string Path to an extension |
|
41 | - */ |
|
37 | + * Return ext name |
|
38 | + * |
|
39 | + * @param bool $web_root_path Whether the path should be relative to web root |
|
40 | + * @return string Path to an extension |
|
41 | + */ |
|
42 | 42 | public function get_ext_name($web_root_path = false) |
43 | 43 | { |
44 | 44 | return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * Return path to resource image |
|
49 | - * |
|
50 | - * @param string $type is ressource type (flags|icons) |
|
51 | - * @param string $image is the resource to display |
|
52 | - * @return string The relative path to ressource |
|
53 | - */ |
|
48 | + * Return path to resource image |
|
49 | + * |
|
50 | + * @param string $type is ressource type (flags|icons) |
|
51 | + * @param string $image is the resource to display |
|
52 | + * @return string The relative path to ressource |
|
53 | + */ |
|
54 | 54 | public function get_img_path($type, $image = '') |
55 | 55 | { |
56 | 56 | return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Return path to banner |
|
61 | - * |
|
62 | - * @param string $banner is the physical name |
|
63 | - * @return string The relative path to banner |
|
64 | - */ |
|
60 | + * Return path to banner |
|
61 | + * |
|
62 | + * @param string $banner is the physical name |
|
63 | + * @return string The relative path to banner |
|
64 | + */ |
|
65 | 65 | public function get_banner_path($banner = '') |
66 | 66 | { |
67 | 67 | return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Return array entries that match the pattern |
|
72 | - * |
|
73 | - * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
74 | - * |
|
75 | - * @param string $pattern The pattern to search for |
|
76 | - * @param array $input The input array |
|
77 | - * @return array $vals Returns an array indexed using the keys from the input array |
|
78 | - */ |
|
71 | + * Return array entries that match the pattern |
|
72 | + * |
|
73 | + * @link http://php.net/manual/fr/function.preg-grep.php#95787 |
|
74 | + * |
|
75 | + * @param string $pattern The pattern to search for |
|
76 | + * @param array $input The input array |
|
77 | + * @return array $vals Returns an array indexed using the keys from the input array |
|
78 | + */ |
|
79 | 79 | public function preg_grep_keys($pattern, $input) |
80 | 80 | { |
81 | 81 | $keys = preg_grep($pattern, array_keys($input)); |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | private $cat_data; |
29 | 29 | |
30 | 30 | /** |
31 | - * Constructor. |
|
32 | - * |
|
33 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | - * @param \phpbb\config\config $config Config object |
|
35 | - * @param \ernadoo\phpbbdirectory\core\link $directory_cron PhpBB Directory extension link object |
|
36 | - * @param string $php_ext phpEx |
|
37 | - */ |
|
31 | + * Constructor. |
|
32 | + * |
|
33 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | + * @param \phpbb\config\config $config Config object |
|
35 | + * @param \ernadoo\phpbbdirectory\core\link $directory_cron PhpBB Directory extension link object |
|
36 | + * @param string $php_ext phpEx |
|
37 | + */ |
|
38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext) |
39 | 39 | { |
40 | 40 | $this->db = $db; |
@@ -44,66 +44,66 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * Manually set categorie data. |
|
48 | - * |
|
49 | - * @param array $cat_data Information about a category to be pruned. |
|
50 | - */ |
|
47 | + * Manually set categorie data. |
|
48 | + * |
|
49 | + * @param array $cat_data Information about a category to be pruned. |
|
50 | + */ |
|
51 | 51 | public function set_categorie_data($cat_data) |
52 | 52 | { |
53 | 53 | $this->cat_data = $cat_data; |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Runs this cron task. |
|
58 | - * |
|
59 | - * @return null |
|
60 | - */ |
|
57 | + * Runs this cron task. |
|
58 | + * |
|
59 | + * @return null |
|
60 | + */ |
|
61 | 61 | public function run() |
62 | 62 | { |
63 | 63 | $this->dir_cron->auto_check($this->cat_data); |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * Returns whether this cron task can run, given current board configuration. |
|
68 | - * |
|
69 | - * @return bool |
|
70 | - */ |
|
67 | + * Returns whether this cron task can run, given current board configuration. |
|
68 | + * |
|
69 | + * @return bool |
|
70 | + */ |
|
71 | 71 | public function is_runnable() |
72 | 72 | { |
73 | 73 | return !$this->config['use_system_cron'] && !empty($this->cat_data); |
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Returns whether this cron task should run now, because enough time |
|
78 | - * has passed since it was last run. |
|
79 | - * |
|
80 | - * @return bool |
|
81 | - */ |
|
77 | + * Returns whether this cron task should run now, because enough time |
|
78 | + * has passed since it was last run. |
|
79 | + * |
|
80 | + * @return bool |
|
81 | + */ |
|
82 | 82 | public function should_run() |
83 | 83 | { |
84 | 84 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time(); |
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Returns parameters of this cron task as an array. |
|
89 | - * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | - * |
|
91 | - * @return array |
|
92 | - */ |
|
88 | + * Returns parameters of this cron task as an array. |
|
89 | + * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | + * |
|
91 | + * @return array |
|
92 | + */ |
|
93 | 93 | public function get_parameters() |
94 | 94 | { |
95 | 95 | return array('c' => $this->cat_data['cat_id']); |
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Parses parameters found in $request, which is an instance of |
|
100 | - * \phpbb\request\request_interface. |
|
101 | - * |
|
102 | - * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | - * |
|
104 | - * @param \phpbb\request\request_interface $request Request object. |
|
105 | - * @return null |
|
106 | - */ |
|
99 | + * Parses parameters found in $request, which is an instance of |
|
100 | + * \phpbb\request\request_interface. |
|
101 | + * |
|
102 | + * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | + * |
|
104 | + * @param \phpbb\request\request_interface $request Request object. |
|
105 | + * @return null |
|
106 | + */ |
|
107 | 107 | public function parse_parameters(\phpbb\request\request_interface $request) |
108 | 108 | { |
109 | 109 | $this->cat_data = array(); |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | class ext extends \phpbb\extension\base |
18 | 18 | { |
19 | 19 | /** |
20 | - * Enable extension if requirements are met |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @aceess public |
|
24 | - */ |
|
20 | + * Enable extension if requirements are met |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @aceess public |
|
24 | + */ |
|
25 | 25 | public function is_enableable() |
26 | 26 | { |
27 | 27 | $config = $this->container->get('config'); |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * Single enable step that installs any included migrations |
|
46 | - * |
|
47 | - * @param mixed $old_state State returned by previous call of this method |
|
48 | - * @return mixed Returns false after last step, otherwise temporary state |
|
49 | - */ |
|
45 | + * Single enable step that installs any included migrations |
|
46 | + * |
|
47 | + * @param mixed $old_state State returned by previous call of this method |
|
48 | + * @return mixed Returns false after last step, otherwise temporary state |
|
49 | + */ |
|
50 | 50 | public function enable_step($old_state) |
51 | 51 | { |
52 | 52 | switch ($old_state) |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Single disable step that does nothing |
|
78 | - * |
|
79 | - * @param mixed $old_state State returned by previous call of this method |
|
80 | - * @return mixed Returns false after last step, otherwise temporary state |
|
81 | - */ |
|
77 | + * Single disable step that does nothing |
|
78 | + * |
|
79 | + * @param mixed $old_state State returned by previous call of this method |
|
80 | + * @return mixed Returns false after last step, otherwise temporary state |
|
81 | + */ |
|
82 | 82 | public function disable_step($old_state) |
83 | 83 | { |
84 | 84 | switch ($old_state) |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Single purge step that reverts any included and installed migrations |
|
110 | - * |
|
111 | - * @param mixed $old_state State returned by previous call of this method |
|
112 | - * @return mixed Returns false after last step, otherwise temporary state |
|
113 | - */ |
|
109 | + * Single purge step that reverts any included and installed migrations |
|
110 | + * |
|
111 | + * @param mixed $old_state State returned by previous call of this method |
|
112 | + * @return mixed Returns false after last step, otherwise temporary state |
|
113 | + */ |
|
114 | 114 | public function purge_step($old_state) |
115 | 115 | { |
116 | 116 | switch ($old_state) |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Notification handler to call notification enable/disable/purge steps |
|
142 | - * |
|
143 | - * @author VSEphpbb (Matt Friedman) |
|
144 | - * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | - * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | - * @param string $step The step (enable, disable, purge) |
|
147 | - * @param array $notification_types The notification type names |
|
148 | - * @return string Return notifications as temporary state |
|
149 | - * @access protected |
|
150 | - */ |
|
141 | + * Notification handler to call notification enable/disable/purge steps |
|
142 | + * |
|
143 | + * @author VSEphpbb (Matt Friedman) |
|
144 | + * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | + * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | + * @param string $step The step (enable, disable, purge) |
|
147 | + * @param array $notification_types The notification type names |
|
148 | + * @return string Return notifications as temporary state |
|
149 | + * @access protected |
|
150 | + */ |
|
151 | 151 | protected function notification_handler($step, $notification_types) |
152 | 152 | { |
153 | 153 | $phpbb_notifications = $this->container->get('notification_manager'); |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | class convert_module extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | - * |
|
21 | - * @return bool True if table does not exist |
|
22 | - * @access public |
|
23 | - */ |
|
19 | + * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | + * |
|
21 | + * @return bool True if table does not exist |
|
22 | + * @access public |
|
23 | + */ |
|
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Add or update data in the database |
|
41 | - * |
|
42 | - * @return array Array of table data |
|
43 | - * @access public |
|
44 | - */ |
|
40 | + * Add or update data in the database |
|
41 | + * |
|
42 | + * @return array Array of table data |
|
43 | + * @access public |
|
44 | + */ |
|
45 | 45 | public function update_data() |
46 | 46 | { |
47 | 47 | return array( |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | class convert_notifications extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * Skip this migration if phpbb_directory_notifications table does not exist |
|
20 | - * |
|
21 | - * @return bool True if table does not exist |
|
22 | - * @access public |
|
23 | - */ |
|
19 | + * Skip this migration if phpbb_directory_notifications table does not exist |
|
20 | + * |
|
21 | + * @return bool True if table does not exist |
|
22 | + * @access public |
|
23 | + */ |
|
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | return !$this->db_tools->sql_table_exists($this->table_prefix . 'directory_notifications'); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Add or update data in the database |
|
38 | - * |
|
39 | - * @return array Array of table data |
|
40 | - * @access public |
|
41 | - */ |
|
37 | + * Add or update data in the database |
|
38 | + * |
|
39 | + * @return array Array of table data |
|
40 | + * @access public |
|
41 | + */ |
|
42 | 42 | public function update_data() |
43 | 43 | { |
44 | 44 | return array( |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * Copy category track from 3.0.x table |
|
51 | - * |
|
52 | - * @return null |
|
53 | - */ |
|
50 | + * Copy category track from 3.0.x table |
|
51 | + * |
|
52 | + * @return null |
|
53 | + */ |
|
54 | 54 | public function copy_from_notifications() |
55 | 55 | { |
56 | 56 | $sql = 'SELECT n_user_id, n_cat_id |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
262 | - * Create directories for banners/icons uploaded |
|
263 | - * |
|
264 | - * @return null |
|
265 | - */ |
|
262 | + * Create directories for banners/icons uploaded |
|
263 | + * |
|
264 | + * @return null |
|
265 | + */ |
|
266 | 266 | public function create_directories() |
267 | 267 | { |
268 | 268 | $directories = array( |
@@ -281,10 +281,10 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | - * Remove directories for banners/icons uploaded |
|
285 | - * |
|
286 | - * @return null |
|
287 | - */ |
|
284 | + * Remove directories for banners/icons uploaded |
|
285 | + * |
|
286 | + * @return null |
|
287 | + */ |
|
288 | 288 | public function remove_directories() |
289 | 289 | { |
290 | 290 | $dir = $this->phpbb_root_path . 'files/ext/ernadoo/phpbbdirectory/'; |
@@ -293,15 +293,15 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
296 | - * Attempts to remove recursively the directory named by dirname. |
|
297 | - * |
|
298 | - * @author Mehdi Kabab <http://pioupioum.fr> |
|
299 | - * @copyright Copyright (C) 2009 Mehdi Kabab |
|
300 | - * @license http://www.gnu.org/licenses/gpl.html GNU GPL version 3 or later |
|
301 | - * |
|
302 | - * @param string $dirname Path to the directory. |
|
303 | - * @return null |
|
304 | - */ |
|
296 | + * Attempts to remove recursively the directory named by dirname. |
|
297 | + * |
|
298 | + * @author Mehdi Kabab <http://pioupioum.fr> |
|
299 | + * @copyright Copyright (C) 2009 Mehdi Kabab |
|
300 | + * @license http://www.gnu.org/licenses/gpl.html GNU GPL version 3 or later |
|
301 | + * |
|
302 | + * @param string $dirname Path to the directory. |
|
303 | + * @return null |
|
304 | + */ |
|
305 | 305 | private function _recursive_rmdir($dirname) |
306 | 306 | { |
307 | 307 | if (is_dir($dirname) && !is_link($dirname)) |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | class directory_website extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_WEBSITE', |
38 | 38 | 'group' => 'NOTIFICATION_DIR_UCP', |
@@ -47,31 +47,31 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * Is available |
|
51 | - * |
|
52 | - * @return bool True/False whether or not this is available to the user |
|
53 | - */ |
|
50 | + * Is available |
|
51 | + * |
|
52 | + * @return bool True/False whether or not this is available to the user |
|
53 | + */ |
|
54 | 54 | public function is_available() |
55 | 55 | { |
56 | 56 | return true; |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Get link id |
|
61 | - * |
|
62 | - * @param array $data The data from the link |
|
63 | - * @return int |
|
64 | - */ |
|
60 | + * Get link id |
|
61 | + * |
|
62 | + * @param array $data The data from the link |
|
63 | + * @return int |
|
64 | + */ |
|
65 | 65 | static public function get_item_id($data) |
66 | 66 | { |
67 | 67 | return (int) $data['link_id']; |
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Get parent id - it's not used |
|
72 | - * |
|
73 | - * @param array $data The data from the link |
|
74 | - */ |
|
71 | + * Get parent id - it's not used |
|
72 | + * |
|
73 | + * @param array $data The data from the link |
|
74 | + */ |
|
75 | 75 | static public function get_item_parent_id($data) |
76 | 76 | { |
77 | 77 | // No parent |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * Find the users who want to receive notifications |
|
83 | - * |
|
84 | - * @param array $data Data from submit link |
|
85 | - * @param array $options Options for finding users for notification |
|
86 | - * @return array |
|
87 | - */ |
|
82 | + * Find the users who want to receive notifications |
|
83 | + * |
|
84 | + * @param array $data Data from submit link |
|
85 | + * @param array $options Options for finding users for notification |
|
86 | + * @return array |
|
87 | + */ |
|
88 | 88 | public function find_users_for_notification($data, $options = array()) |
89 | 89 | { |
90 | 90 | $options = array_merge(array( |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Get the user's avatar |
|
122 | - */ |
|
121 | + * Get the user's avatar |
|
122 | + */ |
|
123 | 123 | public function get_avatar() |
124 | 124 | { |
125 | 125 | return $this->user_loader->get_avatar($this->get_data('user_from'), false, true); |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | |
128 | 128 | |
129 | 129 | /** |
130 | - * Get the HTML formatted title of this notification |
|
131 | - * |
|
132 | - * @return string |
|
133 | - */ |
|
130 | + * Get the HTML formatted title of this notification |
|
131 | + * |
|
132 | + * @return string |
|
133 | + */ |
|
134 | 134 | |
135 | 135 | public function get_title() |
136 | 136 | { |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | |
144 | 144 | |
145 | 145 | /** |
146 | - * Get email template |
|
147 | - * |
|
148 | - * @return string |
|
149 | - */ |
|
146 | + * Get email template |
|
147 | + * |
|
148 | + * @return string |
|
149 | + */ |
|
150 | 150 | public function get_email_template() |
151 | 151 | { |
152 | 152 | return '@ernadoo_phpbbdirectory/directory_website'; |
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
156 | - * Get email template variables |
|
157 | - * |
|
158 | - * @return array |
|
159 | - */ |
|
156 | + * Get email template variables |
|
157 | + * |
|
158 | + * @return array |
|
159 | + */ |
|
160 | 160 | public function get_email_template_variables() |
161 | 161 | { |
162 | 162 | return array( |
@@ -168,33 +168,33 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | - * Get the url to this item |
|
172 | - * |
|
173 | - * @return string URL |
|
174 | - */ |
|
171 | + * Get the url to this item |
|
172 | + * |
|
173 | + * @return string URL |
|
174 | + */ |
|
175 | 175 | public function get_url() |
176 | 176 | { |
177 | 177 | return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * Users needed to query before this notification can be displayed |
|
182 | - * |
|
183 | - * @return array Array of user_ids |
|
184 | - */ |
|
181 | + * Users needed to query before this notification can be displayed |
|
182 | + * |
|
183 | + * @return array Array of user_ids |
|
184 | + */ |
|
185 | 185 | public function users_to_query() |
186 | 186 | { |
187 | 187 | return array($this->get_data('user_from')); |
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | - * Function for preparing the data for insertion in an SQL query |
|
192 | - * (The service handles insertion) |
|
193 | - * |
|
194 | - * @param array $data Data from submit link |
|
195 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
196 | - * @return array Array of data ready to be inserted into the database |
|
197 | - */ |
|
191 | + * Function for preparing the data for insertion in an SQL query |
|
192 | + * (The service handles insertion) |
|
193 | + * |
|
194 | + * @param array $data Data from submit link |
|
195 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
196 | + * @return array Array of data ready to be inserted into the database |
|
197 | + */ |
|
198 | 198 | public function create_insert_array($data, $pre_create_data = array()) |
199 | 199 | { |
200 | 200 | $this->set_data('link_name', $data['link_name']); |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | class directory_website_disapproved extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_disapproved'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'id' => 'dir_moderation_queue', |
38 | 38 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE', |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | ); |
41 | 41 | |
42 | 42 | /** |
43 | - * Permission to check for (in find_users_for_notification) |
|
44 | - * |
|
45 | - * @var string Permission name |
|
46 | - */ |
|
43 | + * Permission to check for (in find_users_for_notification) |
|
44 | + * |
|
45 | + * @var string Permission name |
|
46 | + */ |
|
47 | 47 | protected $permission = array('a_', 'm_'); |
48 | 48 | |
49 | 49 | /** |
50 | - * Is available |
|
51 | - * |
|
52 | - * @return bool True/False whether or not this is available to the user |
|
53 | - */ |
|
50 | + * Is available |
|
51 | + * |
|
52 | + * @return bool True/False whether or not this is available to the user |
|
53 | + */ |
|
54 | 54 | public function is_available() |
55 | 55 | { |
56 | 56 | $has_permission = $this->auth->acl_gets($this->permission, true); |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Get link id |
|
63 | - * |
|
64 | - * @param array $data The data from the link |
|
65 | - * @return int |
|
66 | - */ |
|
62 | + * Get link id |
|
63 | + * |
|
64 | + * @param array $data The data from the link |
|
65 | + * @return int |
|
66 | + */ |
|
67 | 67 | static public function get_item_id($data) |
68 | 68 | { |
69 | 69 | return (int) $data['link_id']; |
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Get parent id - it's not used |
|
74 | - * |
|
75 | - * @param array $data The data from the link |
|
76 | - */ |
|
73 | + * Get parent id - it's not used |
|
74 | + * |
|
75 | + * @param array $data The data from the link |
|
76 | + */ |
|
77 | 77 | static public function get_item_parent_id($data) |
78 | 78 | { |
79 | 79 | // No parent |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Find the users who want to receive notifications |
|
85 | - * |
|
86 | - * @param array $data Data from submit link |
|
87 | - * @param array $options Options for finding users for notification |
|
88 | - * @return array |
|
89 | - */ |
|
84 | + * Find the users who want to receive notifications |
|
85 | + * |
|
86 | + * @param array $data Data from submit link |
|
87 | + * @param array $options Options for finding users for notification |
|
88 | + * @return array |
|
89 | + */ |
|
90 | 90 | public function find_users_for_notification($data, $options = array()) |
91 | 91 | { |
92 | 92 | $options = array_merge(array( |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Get the HTML formatted title of this notification |
|
107 | - * |
|
108 | - * @return string |
|
109 | - */ |
|
106 | + * Get the HTML formatted title of this notification |
|
107 | + * |
|
108 | + * @return string |
|
109 | + */ |
|
110 | 110 | public function get_title() |
111 | 111 | { |
112 | 112 | $link_name = $this->get_data('link_name'); |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Get email template |
|
120 | - * |
|
121 | - * @return string |
|
122 | - */ |
|
119 | + * Get email template |
|
120 | + * |
|
121 | + * @return string |
|
122 | + */ |
|
123 | 123 | public function get_email_template() |
124 | 124 | { |
125 | 125 | return '@ernadoo_phpbbdirectory/directory_website_disapproved'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | - * Get email template variables |
|
130 | - * |
|
131 | - * @return array |
|
132 | - */ |
|
129 | + * Get email template variables |
|
130 | + * |
|
131 | + * @return array |
|
132 | + */ |
|
133 | 133 | public function get_email_template_variables() |
134 | 134 | { |
135 | 135 | return array( |
@@ -138,33 +138,33 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Get the url to this item |
|
142 | - * |
|
143 | - * @return string URL |
|
144 | - */ |
|
141 | + * Get the url to this item |
|
142 | + * |
|
143 | + * @return string URL |
|
144 | + */ |
|
145 | 145 | public function get_url() |
146 | 146 | { |
147 | 147 | return ''; |
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | - * Users needed to query before this notification can be displayed |
|
152 | - * |
|
153 | - * @return array Array of user_ids |
|
154 | - */ |
|
151 | + * Users needed to query before this notification can be displayed |
|
152 | + * |
|
153 | + * @return array Array of user_ids |
|
154 | + */ |
|
155 | 155 | public function users_to_query() |
156 | 156 | { |
157 | 157 | return array(); |
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * Function for preparing the data for insertion in an SQL query |
|
162 | - * (The service handles insertion) |
|
163 | - * |
|
164 | - * @param array $data Data from submit link |
|
165 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | - * @return array Array of data ready to be inserted into the database |
|
167 | - */ |
|
161 | + * Function for preparing the data for insertion in an SQL query |
|
162 | + * (The service handles insertion) |
|
163 | + * |
|
164 | + * @param array $data Data from submit link |
|
165 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | + * @return array Array of data ready to be inserted into the database |
|
167 | + */ |
|
168 | 168 | public function create_insert_array($data, $pre_create_data = array()) |
169 | 169 | { |
170 | 170 | $this->set_data('link_name', $data['link_name']); |
@@ -18,52 +18,52 @@ discard block |
||
18 | 18 | class directory_website_error_cron extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_error_cron'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_ERROR_CHECK', |
38 | 38 | 'group' => 'NOTIFICATION_DIR_UCP', |
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
42 | - * Is available |
|
43 | - * |
|
44 | - * @return bool True/False whether or not this is available to the user |
|
45 | - */ |
|
42 | + * Is available |
|
43 | + * |
|
44 | + * @return bool True/False whether or not this is available to the user |
|
45 | + */ |
|
46 | 46 | public function is_available() |
47 | 47 | { |
48 | 48 | return true; |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Get link id |
|
53 | - * |
|
54 | - * @param array $data The data from the link |
|
55 | - * @return int |
|
56 | - */ |
|
52 | + * Get link id |
|
53 | + * |
|
54 | + * @param array $data The data from the link |
|
55 | + * @return int |
|
56 | + */ |
|
57 | 57 | static public function get_item_id($data) |
58 | 58 | { |
59 | 59 | return (int) $data['link_id']; |
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | - * Get parent id - it's not used |
|
64 | - * |
|
65 | - * @param array $data The data from the link |
|
66 | - */ |
|
63 | + * Get parent id - it's not used |
|
64 | + * |
|
65 | + * @param array $data The data from the link |
|
66 | + */ |
|
67 | 67 | static public function get_item_parent_id($data) |
68 | 68 | { |
69 | 69 | // No parent |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | - * Find the users who want to receive notifications |
|
75 | - * |
|
76 | - * @param array $data Data from submit link |
|
77 | - * @param array $options Options for finding users for notification |
|
78 | - * @return array |
|
79 | - */ |
|
74 | + * Find the users who want to receive notifications |
|
75 | + * |
|
76 | + * @param array $data Data from submit link |
|
77 | + * @param array $options Options for finding users for notification |
|
78 | + * @return array |
|
79 | + */ |
|
80 | 80 | public function find_users_for_notification($data, $options = array()) |
81 | 81 | { |
82 | 82 | $users = array(); |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * Get the HTML formatted title of this notification |
|
108 | - * |
|
109 | - * @return string |
|
110 | - */ |
|
107 | + * Get the HTML formatted title of this notification |
|
108 | + * |
|
109 | + * @return string |
|
110 | + */ |
|
111 | 111 | public function get_title() |
112 | 112 | { |
113 | 113 | $link_name = $this->get_data('link_name'); |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
120 | - * Get email template |
|
121 | - * |
|
122 | - * @return string |
|
123 | - */ |
|
120 | + * Get email template |
|
121 | + * |
|
122 | + * @return string |
|
123 | + */ |
|
124 | 124 | public function get_email_template() |
125 | 125 | { |
126 | 126 | return '@ernadoo_phpbbdirectory/directory_website_error_cron'; |
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
130 | - * Get email template variables |
|
131 | - * |
|
132 | - * @return array |
|
133 | - */ |
|
130 | + * Get email template variables |
|
131 | + * |
|
132 | + * @return array |
|
133 | + */ |
|
134 | 134 | public function get_email_template_variables() |
135 | 135 | { |
136 | 136 | return array( |
@@ -142,33 +142,33 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Get the url to this item |
|
146 | - * |
|
147 | - * @return string URL |
|
148 | - */ |
|
145 | + * Get the url to this item |
|
146 | + * |
|
147 | + * @return string URL |
|
148 | + */ |
|
149 | 149 | public function get_url() |
150 | 150 | { |
151 | 151 | return ''; |
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
155 | - * Users needed to query before this notification can be displayed |
|
156 | - * |
|
157 | - * @return array Array of user_ids |
|
158 | - */ |
|
155 | + * Users needed to query before this notification can be displayed |
|
156 | + * |
|
157 | + * @return array Array of user_ids |
|
158 | + */ |
|
159 | 159 | public function users_to_query() |
160 | 160 | { |
161 | 161 | return array(); |
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * Function for preparing the data for insertion in an SQL query |
|
166 | - * (The service handles insertion) |
|
167 | - * |
|
168 | - * @param array $data Data from submit link |
|
169 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
170 | - * @return array Array of data ready to be inserted into the database |
|
171 | - */ |
|
165 | + * Function for preparing the data for insertion in an SQL query |
|
166 | + * (The service handles insertion) |
|
167 | + * |
|
168 | + * @param array $data Data from submit link |
|
169 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
170 | + * @return array Array of data ready to be inserted into the database |
|
171 | + */ |
|
172 | 172 | public function create_insert_array($data, $pre_create_data = array()) |
173 | 173 | { |
174 | 174 | $this->set_data('link_name', $data['link_name']); |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
185 | - * Function for preparing the data for update in an SQL query |
|
186 | - * (The service handles insertion) |
|
187 | - * |
|
188 | - * @param array $type_data Data unique to this notification type |
|
189 | - * @return array Array of data ready to be updated in the database |
|
190 | - */ |
|
185 | + * Function for preparing the data for update in an SQL query |
|
186 | + * (The service handles insertion) |
|
187 | + * |
|
188 | + * @param array $type_data Data unique to this notification type |
|
189 | + * @return array Array of data ready to be updated in the database |
|
190 | + */ |
|
191 | 191 | public function create_update_array($type_data) |
192 | 192 | { |
193 | 193 | $data = $this->create_insert_array($type_data); |