@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | public $u_action; |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * |
|
| 19 | - * @param int $id |
|
| 20 | - * @param string $mode |
|
| 21 | - */ |
|
| 18 | + * |
|
| 19 | + * @param int $id |
|
| 20 | + * @param string $mode |
|
| 21 | + */ |
|
| 22 | 22 | public function main($id, $mode) |
| 23 | 23 | { |
| 24 | 24 | global $request, $phpbb_container; |
@@ -183,11 +183,11 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | - * Display thumb services available |
|
| 187 | - * |
|
| 188 | - * @param string $url_selected |
|
| 189 | - * @return string |
|
| 190 | - */ |
|
| 186 | + * Display thumb services available |
|
| 187 | + * |
|
| 188 | + * @param string $url_selected |
|
| 189 | + * @return string |
|
| 190 | + */ |
|
| 191 | 191 | public function get_thumb_service_list($url_selected) |
| 192 | 192 | { |
| 193 | 193 | $thumbshot = array( |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
| 210 | - * Display order drop-down list |
|
| 211 | - * |
|
| 212 | - * @param string $order_selected |
|
| 213 | - * @return string |
|
| 214 | - */ |
|
| 210 | + * Display order drop-down list |
|
| 211 | + * |
|
| 212 | + * @param string $order_selected |
|
| 213 | + * @return string |
|
| 214 | + */ |
|
| 215 | 215 | public function get_order_list($order_selected) |
| 216 | 216 | { |
| 217 | 217 | global $user; |
@@ -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'); |
@@ -5,9 +5,9 @@ |
||
| 5 | 5 | * |
| 6 | 6 | * @copyright (c) 2014 ErnadoO <http://www.phpbb-services.com> |
| 7 | 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | - * Dutch translation by Dutch Translators (https://github.com/dutch-translators) |
|
| 9 | - * |
|
| 10 | - */ |
|
| 8 | + * Dutch translation by Dutch Translators (https://github.com/dutch-translators) |
|
| 9 | + * |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * DO NOT CHANGE |
@@ -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']); |