@@ -144,7 +144,7 @@ |
||
144 | 144 | * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
145 | 145 | * @license GNU General Public License, version 2 (GPL-2.0) |
146 | 146 | * @param string $step The step (enable, disable, purge) |
147 | - * @param array $notification_types The notification type names |
|
147 | + * @param string[] $notification_types The notification type names |
|
148 | 148 | * @return string Return notifications as temporary state |
149 | 149 | * @access protected |
150 | 150 | */ |
@@ -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'); |
@@ -155,7 +155,7 @@ |
||
155 | 155 | |
156 | 156 | foreach ($notification_types as $notification_type) |
157 | 157 | { |
158 | - call_user_func(array($phpbb_notifications, $step . '_notifications'), $notification_type); |
|
158 | + call_user_func(array($phpbb_notifications, $step.'_notifications'), $notification_type); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return 'notifications'; |
@@ -18,11 +18,11 @@ |
||
18 | 18 | 'filename' => '\ernadoo\phpbbdirectory\acp\phpbbdirectory_module', |
19 | 19 | 'title' => 'ACP_DIRECTORY', |
20 | 20 | 'modes' => array( |
21 | - '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | - 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | - 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | - 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | - 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
21 | + '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | + 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | + 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | + 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | + 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
26 | 26 | ), |
27 | 27 | ); |
28 | 28 | } |
@@ -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)); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
31 | 31 | { |
32 | - $this->extension_manager = $phpbb_extension_manager; |
|
33 | - $this->path_helper = $path_helper; |
|
32 | + $this->extension_manager = $phpbb_extension_manager; |
|
33 | + $this->path_helper = $path_helper; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get_ext_name($web_root_path = false) |
43 | 43 | { |
44 | - return (($web_root_path) ? $this->path_helper->get_web_root_path() : '') . $this->extension_manager->get_extension_path($this->ext_name); |
|
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 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_img_path($type, $image = '') |
55 | 55 | { |
56 | - return $this->get_ext_name(true) . 'images/' . $type . '/' . $image; |
|
56 | + return $this->get_ext_name(true).'images/'.$type.'/'.$image; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function get_banner_path($banner = '') |
66 | 66 | { |
67 | - return 'files/' . $this->get_ext_name() . 'banners/' . $banner; |
|
67 | + return 'files/'.$this->get_ext_name().'banners/'.$banner; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -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(); |
@@ -37,8 +37,8 @@ discard block |
||
37 | 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 | - $this->db = $db; |
|
41 | - $this->config = $config; |
|
40 | + $this->db = $db; |
|
41 | + $this->config = $config; |
|
42 | 42 | $this->dir_cron = $directory_cron; |
43 | 43 | $this->php_ext = $php_ext; |
44 | 44 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $cat_id = $request->variable('c', 0); |
114 | 114 | |
115 | 115 | $sql = 'SELECT cat_id, cat_cron_enable, cat_cron_next, cat_cron_freq, cat_cron_nb_check |
116 | - FROM ' . DIR_CAT_TABLE . " |
|
116 | + FROM ' . DIR_CAT_TABLE." |
|
117 | 117 | WHERE cat_id = $cat_id"; |
118 | 118 | $result = $this->db->sql_query($sql); |
119 | 119 | $row = $this->db->sql_fetchrow($result); |
@@ -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( |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
27 | - FROM ' . $this->table_prefix . "modules |
|
27 | + FROM ' . $this->table_prefix."modules |
|
28 | 28 | WHERE module_class = 'acp' |
29 | 29 | AND module_basename = 'acp_directory' |
30 | 30 | AND module_mode = 'main'"; |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | 'module_auth' => 'ext_ernadoo/phpbbdirectory' |
57 | 57 | ); |
58 | 58 | |
59 | - $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
60 | - SET ' . $this->db->sql_build_array('UPDATE', $module_data) . " |
|
59 | + $sql = 'UPDATE '.$this->table_prefix.'modules |
|
60 | + SET ' . $this->db->sql_build_array('UPDATE', $module_data)." |
|
61 | 61 | WHERE module_basename = 'acp_directory' |
62 | 62 | AND module_mode IN ('main', 'settings', 'cat', 'val')"; |
63 | 63 | $this->db->sql_query($sql); |
@@ -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 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | - return !$this->db_tools->sql_table_exists($this->table_prefix . 'directory_notifications'); |
|
26 | + return !$this->db_tools->sql_table_exists($this->table_prefix.'directory_notifications'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | static public function depends_on() |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function copy_from_notifications() |
55 | 55 | { |
56 | 56 | $sql = 'SELECT n_user_id, n_cat_id |
57 | - FROM ' . $this->table_prefix . 'directory_notifications'; |
|
57 | + FROM ' . $this->table_prefix.'directory_notifications'; |
|
58 | 58 | $result = $this->db->sql_query($sql); |
59 | 59 | |
60 | 60 | while ($row = $this->db->sql_fetchrow($result)) |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'notify_status' => 1, |
66 | 66 | ); |
67 | 67 | |
68 | - $sql = 'INSERT INTO ' . $this->table_prefix . 'directory_watch ' . $this->db->sql_build_array('INSERT', $data); |
|
68 | + $sql = 'INSERT INTO '.$this->table_prefix.'directory_watch '.$this->db->sql_build_array('INSERT', $data); |
|
69 | 69 | $this->db->sql_query($sql); |
70 | 70 | } |
71 | 71 | $this->db->sql_freeresult($result); |
@@ -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)) |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | return array( |
25 | 25 | 'add_tables' => array( |
26 | - $this->table_prefix . 'directory_cats' => array( |
|
26 | + $this->table_prefix.'directory_cats' => array( |
|
27 | 27 | 'COLUMNS' => array( |
28 | 28 | 'cat_id' => array('UINT', null, 'auto_increment'), |
29 | 29 | 'parent_id' => array('UINT', 0), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ), |
58 | 58 | ), |
59 | 59 | |
60 | - $this->table_prefix . 'directory_comments' => array( |
|
60 | + $this->table_prefix.'directory_comments' => array( |
|
61 | 61 | 'COLUMNS' => array( |
62 | 62 | 'comment_id' => array('UINT', null, 'auto_increment'), |
63 | 63 | 'comment_date' => array('TIMESTAMP', 0), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'PRIMARY_KEY' => array('comment_id'), |
74 | 74 | ), |
75 | 75 | |
76 | - $this->table_prefix . 'directory_links' => array( |
|
76 | + $this->table_prefix.'directory_links' => array( |
|
77 | 77 | 'COLUMNS' => array( |
78 | 78 | 'link_id' => array('UINT', null, 'auto_increment'), |
79 | 79 | 'link_time' => array('TIMESTAMP', 0), |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ), |
111 | 111 | ), |
112 | 112 | |
113 | - $this->table_prefix . 'directory_watch' => array( |
|
113 | + $this->table_prefix.'directory_watch' => array( |
|
114 | 114 | 'COLUMNS' => array( |
115 | 115 | 'cat_id' => array('UINT', 0), |
116 | 116 | 'user_id' => array('UINT', 0), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | ), |
127 | 127 | |
128 | - $this->table_prefix . 'directory_votes' => array( |
|
128 | + $this->table_prefix.'directory_votes' => array( |
|
129 | 129 | 'COLUMNS' => array( |
130 | 130 | 'vote_id' => array('UINT', null, 'auto_increment'), |
131 | 131 | 'vote_link_id' => array('UINT', 0), |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | { |
149 | 149 | return array( |
150 | 150 | 'drop_tables' => array( |
151 | - $this->table_prefix . 'directory_cats', |
|
152 | - $this->table_prefix . 'directory_comments', |
|
153 | - $this->table_prefix . 'directory_links', |
|
154 | - $this->table_prefix . 'directory_votes', |
|
155 | - $this->table_prefix . 'directory_watch', |
|
151 | + $this->table_prefix.'directory_cats', |
|
152 | + $this->table_prefix.'directory_comments', |
|
153 | + $this->table_prefix.'directory_links', |
|
154 | + $this->table_prefix.'directory_votes', |
|
155 | + $this->table_prefix.'directory_watch', |
|
156 | 156 | ), |
157 | 157 | ); |
158 | 158 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | |
273 | 273 | foreach ($directories as $dir) |
274 | 274 | { |
275 | - if (!file_exists($this->phpbb_root_path . $dir)) |
|
275 | + if (!file_exists($this->phpbb_root_path.$dir)) |
|
276 | 276 | { |
277 | - @mkdir($this->phpbb_root_path . $dir, 0777, true); |
|
278 | - phpbb_chmod($this->phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); |
|
277 | + @mkdir($this->phpbb_root_path.$dir, 0777, true); |
|
278 | + phpbb_chmod($this->phpbb_root_path.$dir, CHMOD_READ | CHMOD_WRITE); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function remove_directories() |
289 | 289 | { |
290 | - $dir = $this->phpbb_root_path . 'files/ext/ernadoo/phpbbdirectory/'; |
|
290 | + $dir = $this->phpbb_root_path.'files/ext/ernadoo/phpbbdirectory/'; |
|
291 | 291 | |
292 | 292 | $this->_recursive_rmdir($dir); |
293 | 293 | } |
@@ -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']); |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | $users = array(); |
87 | 87 | |
88 | 88 | $sql = 'SELECT user_id |
89 | - FROM ' . DIR_WATCH_TABLE . ' |
|
90 | - WHERE cat_id = ' . (int) $data['cat_id'] . ' |
|
91 | - AND notify_status = ' . NOTIFY_YES . ' |
|
89 | + FROM ' . DIR_WATCH_TABLE.' |
|
90 | + WHERE cat_id = ' . (int) $data['cat_id'].' |
|
91 | + AND notify_status = ' . NOTIFY_YES.' |
|
92 | 92 | AND user_id <> ' . (int) $data['user_from']; |
93 | 93 | $result = $this->db->sql_query($sql); |
94 | 94 | while ($row = $this->db->sql_fetchrow($result)) |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function get_url() |
166 | 166 | { |
167 | - return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
167 | + return append_sid($this->phpbb_root_path.'directory/categorie/'.(int) $this->get_data('cat_id')); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -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']); |