@@ -46,20 +46,20 @@ discard block |
||
| 46 | 46 | protected $link; |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Constructor |
|
| 50 | - * |
|
| 51 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | - * @param \phpbb\config\config $config Config object |
|
| 53 | - * @param \phpbb\language\language $language Language object |
|
| 54 | - * @param \phpbb\template\template $template Template object |
|
| 55 | - * @param \phpbb\user $user User object |
|
| 56 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | - * @param \phpbb\request\request $request Request object |
|
| 58 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | - * @param \phpbb\pagination $pagination Pagination object |
|
| 60 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 61 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 62 | - */ |
|
| 49 | + * Constructor |
|
| 50 | + * |
|
| 51 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 52 | + * @param \phpbb\config\config $config Config object |
|
| 53 | + * @param \phpbb\language\language $language Language object |
|
| 54 | + * @param \phpbb\template\template $template Template object |
|
| 55 | + * @param \phpbb\user $user User object |
|
| 56 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 57 | + * @param \phpbb\request\request $request Request object |
|
| 58 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 59 | + * @param \phpbb\pagination $pagination Pagination object |
|
| 60 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 61 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 62 | + */ |
|
| 63 | 63 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
| 64 | 64 | { |
| 65 | 65 | $this->db = $db; |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * Base controller to be accessed with the URL /directory |
|
| 87 | - * |
|
| 88 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 89 | - */ |
|
| 86 | + * Base controller to be accessed with the URL /directory |
|
| 87 | + * |
|
| 88 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 89 | + */ |
|
| 90 | 90 | public function base() |
| 91 | 91 | { |
| 92 | 92 | $this->categorie->display(); |
@@ -96,17 +96,17 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * View controller for display a category |
|
| 100 | - * |
|
| 101 | - * @param int $cat_id The category ID |
|
| 102 | - * @param int $page Page number taken from the URL |
|
| 103 | - * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
| 104 | - * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
| 105 | - * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
| 106 | - * @param string $mode watch|unwatch |
|
| 107 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 108 | - * @throws \phpbb\exception\http_exception |
|
| 109 | - */ |
|
| 99 | + * View controller for display a category |
|
| 100 | + * |
|
| 101 | + * @param int $cat_id The category ID |
|
| 102 | + * @param int $page Page number taken from the URL |
|
| 103 | + * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
| 104 | + * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
| 105 | + * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
| 106 | + * @param string $mode watch|unwatch |
|
| 107 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 108 | + * @throws \phpbb\exception\http_exception |
|
| 109 | + */ |
|
| 110 | 110 | public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '') |
| 111 | 111 | { |
| 112 | 112 | if (false === $this->categorie->get($cat_id)) |
@@ -366,11 +366,11 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /** |
| 369 | - * date controller for return a date |
|
| 370 | - * |
|
| 371 | - * @return \phpbb\json_response A Json Response |
|
| 372 | - * @throws \phpbb\exception\http_exception |
|
| 373 | - */ |
|
| 369 | + * date controller for return a date |
|
| 370 | + * |
|
| 371 | + * @return \phpbb\json_response A Json Response |
|
| 372 | + * @throws \phpbb\exception\http_exception |
|
| 373 | + */ |
|
| 374 | 374 | public function return_date() |
| 375 | 375 | { |
| 376 | 376 | if (!$this->request->is_ajax()) |
@@ -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'); |
@@ -21,32 +21,32 @@ discard block |
||
| 21 | 21 | protected $helper; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Set the controller helper |
|
| 25 | - * |
|
| 26 | - * @param \phpbb\controller\helper $helper |
|
| 27 | - * @return null |
|
| 28 | - */ |
|
| 24 | + * Set the controller helper |
|
| 25 | + * |
|
| 26 | + * @param \phpbb\controller\helper $helper |
|
| 27 | + * @return null |
|
| 28 | + */ |
|
| 29 | 29 | public function set_controller_helper(\phpbb\controller\helper $helper) |
| 30 | 30 | { |
| 31 | 31 | $this->helper = $helper; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Get notification type name |
|
| 36 | - * |
|
| 37 | - * @return string |
|
| 38 | - */ |
|
| 35 | + * Get notification type name |
|
| 36 | + * |
|
| 37 | + * @return string |
|
| 38 | + */ |
|
| 39 | 39 | public function get_type() |
| 40 | 40 | { |
| 41 | 41 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_approved'; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Notification option data (for outputting to the user) |
|
| 46 | - * |
|
| 47 | - * @var bool|array False if the service should use it's default data |
|
| 48 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | - */ |
|
| 45 | + * Notification option data (for outputting to the user) |
|
| 46 | + * |
|
| 47 | + * @var bool|array False if the service should use it's default data |
|
| 48 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
| 49 | + */ |
|
| 50 | 50 | public static $notification_option = array( |
| 51 | 51 | 'id' => 'dir_moderation_queue', |
| 52 | 52 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE', |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Permission to check for (in find_users_for_notification) |
|
| 58 | - * |
|
| 59 | - * @var string Permission name |
|
| 60 | - */ |
|
| 57 | + * Permission to check for (in find_users_for_notification) |
|
| 58 | + * |
|
| 59 | + * @var string Permission name |
|
| 60 | + */ |
|
| 61 | 61 | protected $permission = array('a_', 'm_'); |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | - * Is available |
|
| 65 | - * |
|
| 66 | - * @return bool True/False whether or not this is available to the user |
|
| 67 | - */ |
|
| 64 | + * Is available |
|
| 65 | + * |
|
| 66 | + * @return bool True/False whether or not this is available to the user |
|
| 67 | + */ |
|
| 68 | 68 | public function is_available() |
| 69 | 69 | { |
| 70 | 70 | $has_permission = $this->auth->acl_gets($this->permission, true); |
@@ -73,21 +73,21 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * Get link id |
|
| 77 | - * |
|
| 78 | - * @param array $data The data from the link |
|
| 79 | - * @return int |
|
| 80 | - */ |
|
| 76 | + * Get link id |
|
| 77 | + * |
|
| 78 | + * @param array $data The data from the link |
|
| 79 | + * @return int |
|
| 80 | + */ |
|
| 81 | 81 | static public function get_item_id($data) |
| 82 | 82 | { |
| 83 | 83 | return (int) $data['link_id']; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * Get parent id - it's not used |
|
| 88 | - * |
|
| 89 | - * @param array $data The data from the link |
|
| 90 | - */ |
|
| 87 | + * Get parent id - it's not used |
|
| 88 | + * |
|
| 89 | + * @param array $data The data from the link |
|
| 90 | + */ |
|
| 91 | 91 | static public function get_item_parent_id($data) |
| 92 | 92 | { |
| 93 | 93 | // No parent |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * Find the users who want to receive notifications |
|
| 99 | - * |
|
| 100 | - * @param array $data Data from submit link |
|
| 101 | - * @param array $options Options for finding users for notification |
|
| 102 | - * @return array |
|
| 103 | - */ |
|
| 98 | + * Find the users who want to receive notifications |
|
| 99 | + * |
|
| 100 | + * @param array $data Data from submit link |
|
| 101 | + * @param array $options Options for finding users for notification |
|
| 102 | + * @return array |
|
| 103 | + */ |
|
| 104 | 104 | public function find_users_for_notification($data, $options = array()) |
| 105 | 105 | { |
| 106 | 106 | $options = array_merge(array( |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * Get the HTML formatted title of this notification |
|
| 120 | - * |
|
| 121 | - * @return string |
|
| 122 | - */ |
|
| 119 | + * Get the HTML formatted title of this notification |
|
| 120 | + * |
|
| 121 | + * @return string |
|
| 122 | + */ |
|
| 123 | 123 | public function get_title() |
| 124 | 124 | { |
| 125 | 125 | $link_name = $this->get_data('link_name'); |
@@ -129,20 +129,20 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * Get email template |
|
| 133 | - * |
|
| 134 | - * @return string |
|
| 135 | - */ |
|
| 132 | + * Get email template |
|
| 133 | + * |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 136 | 136 | public function get_email_template() |
| 137 | 137 | { |
| 138 | 138 | return '@ernadoo_phpbbdirectory/directory_website_approved'; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Get email template variables |
|
| 143 | - * |
|
| 144 | - * @return array |
|
| 145 | - */ |
|
| 142 | + * Get email template variables |
|
| 143 | + * |
|
| 144 | + * @return array |
|
| 145 | + */ |
|
| 146 | 146 | public function get_email_template_variables() |
| 147 | 147 | { |
| 148 | 148 | return array( |
@@ -151,33 +151,33 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | - * Get the url to this item |
|
| 155 | - * |
|
| 156 | - * @return string URL |
|
| 157 | - */ |
|
| 154 | + * Get the url to this item |
|
| 155 | + * |
|
| 156 | + * @return string URL |
|
| 157 | + */ |
|
| 158 | 158 | public function get_url() |
| 159 | 159 | { |
| 160 | 160 | return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id'))); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | - * Users needed to query before this notification can be displayed |
|
| 165 | - * |
|
| 166 | - * @return array Array of user_ids |
|
| 167 | - */ |
|
| 164 | + * Users needed to query before this notification can be displayed |
|
| 165 | + * |
|
| 166 | + * @return array Array of user_ids |
|
| 167 | + */ |
|
| 168 | 168 | public function users_to_query() |
| 169 | 169 | { |
| 170 | 170 | return array(); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Function for preparing the data for insertion in an SQL query |
|
| 175 | - * (The service handles insertion) |
|
| 176 | - * |
|
| 177 | - * @param array $data Data from submit link |
|
| 178 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 179 | - * @return array Array of data ready to be inserted into the database |
|
| 180 | - */ |
|
| 174 | + * Function for preparing the data for insertion in an SQL query |
|
| 175 | + * (The service handles insertion) |
|
| 176 | + * |
|
| 177 | + * @param array $data Data from submit link |
|
| 178 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 179 | + * @return array Array of data ready to be inserted into the database |
|
| 180 | + */ |
|
| 181 | 181 | public function create_insert_array($data, $pre_create_data = array()) |
| 182 | 182 | { |
| 183 | 183 | $this->set_data('link_name', $data['link_name']); |
@@ -69,19 +69,19 @@ discard block |
||
| 69 | 69 | private $update; |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * Constructor |
|
| 73 | - * |
|
| 74 | - * @param \phpbb\cache\service $cache Cache object |
|
| 75 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 76 | - * @param \phpbb\controller\helper $helper Helper object |
|
| 77 | - * @param \phpbb\language\language $language Language object |
|
| 78 | - * @param \phpbb\log\log $log Log object |
|
| 79 | - * @param \phpbb\request\request $request Request object |
|
| 80 | - * @param \phpbb\template\template $template Template object |
|
| 81 | - * @param \phpbb\user $user User object |
|
| 82 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 83 | - * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
| 84 | - */ |
|
| 72 | + * Constructor |
|
| 73 | + * |
|
| 74 | + * @param \phpbb\cache\service $cache Cache object |
|
| 75 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 76 | + * @param \phpbb\controller\helper $helper Helper object |
|
| 77 | + * @param \phpbb\language\language $language Language object |
|
| 78 | + * @param \phpbb\log\log $log Log object |
|
| 79 | + * @param \phpbb\request\request $request Request object |
|
| 80 | + * @param \phpbb\template\template $template Template object |
|
| 81 | + * @param \phpbb\user $user User object |
|
| 82 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 83 | + * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
| 84 | + */ |
|
| 85 | 85 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
| 86 | 86 | { |
| 87 | 87 | $this->cache = $cache; |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * Initialize defaults data for add page |
|
| 109 | - * |
|
| 110 | - * @return null |
|
| 111 | - */ |
|
| 108 | + * Initialize defaults data for add page |
|
| 109 | + * |
|
| 110 | + * @return null |
|
| 111 | + */ |
|
| 112 | 112 | public function action_add() |
| 113 | 113 | { |
| 114 | 114 | $this->cat_id = $this->parent_id; |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | - * Display deleting page |
|
| 146 | - * |
|
| 147 | - * @return null |
|
| 148 | - */ |
|
| 145 | + * Display deleting page |
|
| 146 | + * |
|
| 147 | + * @return null |
|
| 148 | + */ |
|
| 149 | 149 | public function action_delete() |
| 150 | 150 | { |
| 151 | 151 | if (!$this->cat_id) |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * Initialize data for edit page |
|
| 200 | - * |
|
| 201 | - * @return null |
|
| 202 | - */ |
|
| 199 | + * Initialize data for edit page |
|
| 200 | + * |
|
| 201 | + * @return null |
|
| 202 | + */ |
|
| 203 | 203 | public function action_edit() |
| 204 | 204 | { |
| 205 | 205 | $row = $this->_get_cat_info($this->cat_id); |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | - * Move order categories |
|
| 230 | - * |
|
| 231 | - * @return null |
|
| 232 | - */ |
|
| 229 | + * Move order categories |
|
| 230 | + * |
|
| 231 | + * @return null |
|
| 232 | + */ |
|
| 233 | 233 | public function action_move() |
| 234 | 234 | { |
| 235 | 235 | if (!$this->cat_id) |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
| 275 | - * Display progress bar for syncinc categories |
|
| 276 | - * |
|
| 277 | - * @return null |
|
| 278 | - */ |
|
| 275 | + * Display progress bar for syncinc categories |
|
| 276 | + * |
|
| 277 | + * @return null |
|
| 278 | + */ |
|
| 279 | 279 | public function action_progress_bar() |
| 280 | 280 | { |
| 281 | 281 | $start = $this->request->variable('start', 0); |
@@ -296,10 +296,10 @@ discard block |
||
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | - * Get link's ID interval for _sync_dir_links() |
|
| 300 | - * |
|
| 301 | - * @return null |
|
| 302 | - */ |
|
| 299 | + * Get link's ID interval for _sync_dir_links() |
|
| 300 | + * |
|
| 301 | + * @return null |
|
| 302 | + */ |
|
| 303 | 303 | public function action_sync() |
| 304 | 304 | { |
| 305 | 305 | if (!$this->cat_id) |
@@ -383,10 +383,10 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
| 386 | - * Sync category data |
|
| 387 | - * |
|
| 388 | - * @return null |
|
| 389 | - */ |
|
| 386 | + * Sync category data |
|
| 387 | + * |
|
| 388 | + * @return null |
|
| 389 | + */ |
|
| 390 | 390 | public function action_sync_cat() |
| 391 | 391 | { |
| 392 | 392 | $sql = 'SELECT cat_name |
@@ -410,10 +410,10 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
| 413 | - * Display categories page |
|
| 414 | - * |
|
| 415 | - * @return null |
|
| 416 | - */ |
|
| 413 | + * Display categories page |
|
| 414 | + * |
|
| 415 | + * @return null |
|
| 416 | + */ |
|
| 417 | 417 | public function display_cats() |
| 418 | 418 | { |
| 419 | 419 | // Default management page |
@@ -508,22 +508,22 @@ discard block |
||
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | /** |
| 511 | - * Set page url |
|
| 512 | - * |
|
| 513 | - * @param string $u_action Custom form action |
|
| 514 | - * @return null |
|
| 515 | - * @access public |
|
| 516 | - */ |
|
| 511 | + * Set page url |
|
| 512 | + * |
|
| 513 | + * @param string $u_action Custom form action |
|
| 514 | + * @return null |
|
| 515 | + * @access public |
|
| 516 | + */ |
|
| 517 | 517 | public function set_page_url($u_action) |
| 518 | 518 | { |
| 519 | 519 | $this->u_action = $u_action; |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | /** |
| 523 | - * Update cat table |
|
| 524 | - * |
|
| 525 | - * @return null |
|
| 526 | - */ |
|
| 523 | + * Update cat table |
|
| 524 | + * |
|
| 525 | + * @return null |
|
| 526 | + */ |
|
| 527 | 527 | public function update() |
| 528 | 528 | { |
| 529 | 529 | if (!check_form_key($this->form_key)) |
@@ -617,11 +617,11 @@ discard block |
||
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | /** |
| 620 | - * Display form |
|
| 621 | - * |
|
| 622 | - * @param string $parents_list Drop-down list |
|
| 623 | - * @return null |
|
| 624 | - */ |
|
| 620 | + * Display form |
|
| 621 | + * |
|
| 622 | + * @param string $parents_list Drop-down list |
|
| 623 | + * @return null |
|
| 624 | + */ |
|
| 625 | 625 | private function _display_cat_form($parents_list) |
| 626 | 626 | { |
| 627 | 627 | $dir_cat_desc_data = array( |
@@ -691,11 +691,11 @@ discard block |
||
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | /** |
| 694 | - * Get category details |
|
| 695 | - * |
|
| 696 | - * @param int $cat_id The category ID |
|
| 697 | - * @return array |
|
| 698 | - */ |
|
| 694 | + * Get category details |
|
| 695 | + * |
|
| 696 | + * @param int $cat_id The category ID |
|
| 697 | + * @return array |
|
| 698 | + */ |
|
| 699 | 699 | private function _get_cat_info($cat_id) |
| 700 | 700 | { |
| 701 | 701 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
@@ -714,10 +714,10 @@ discard block |
||
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /** |
| 717 | - * Update category data |
|
| 718 | - * |
|
| 719 | - * @return array |
|
| 720 | - */ |
|
| 717 | + * Update category data |
|
| 718 | + * |
|
| 719 | + * @return array |
|
| 720 | + */ |
|
| 721 | 721 | private function _update_cat_data() |
| 722 | 722 | { |
| 723 | 723 | if (!$this->cat_data['cat_name']) |
@@ -811,14 +811,14 @@ discard block |
||
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | /** |
| 814 | - * Remove complete category |
|
| 815 | - * |
|
| 816 | - * @param string $action_links Action for categories links |
|
| 817 | - * @param string $action_subcats Action for sub-categories |
|
| 818 | - * @param int $links_to_id New category ID for links |
|
| 819 | - * @param int $subcats_to_id New category ID for sub-categories |
|
| 820 | - * @return array |
|
| 821 | - */ |
|
| 814 | + * Remove complete category |
|
| 815 | + * |
|
| 816 | + * @param string $action_links Action for categories links |
|
| 817 | + * @param string $action_subcats Action for sub-categories |
|
| 818 | + * @param int $links_to_id New category ID for links |
|
| 819 | + * @param int $subcats_to_id New category ID for sub-categories |
|
| 820 | + * @return array |
|
| 821 | + */ |
|
| 822 | 822 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0) |
| 823 | 823 | { |
| 824 | 824 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -935,12 +935,12 @@ discard block |
||
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | /** |
| 938 | - * Move category content from one to another forum |
|
| 939 | - * |
|
| 940 | - * @param int $from_id |
|
| 941 | - * @param int $to_id |
|
| 942 | - * @return null |
|
| 943 | - */ |
|
| 938 | + * Move category content from one to another forum |
|
| 939 | + * |
|
| 940 | + * @param int $from_id |
|
| 941 | + * @param int $to_id |
|
| 942 | + * @return null |
|
| 943 | + */ |
|
| 944 | 944 | private function _move_cat_content($from_id, $to_id) |
| 945 | 945 | { |
| 946 | 946 | $sql = 'UPDATE ' . $this->links_table . ' |
@@ -956,10 +956,10 @@ discard block |
||
| 956 | 956 | } |
| 957 | 957 | |
| 958 | 958 | /** |
| 959 | - * Delete category content |
|
| 960 | - * |
|
| 961 | - * @return array |
|
| 962 | - */ |
|
| 959 | + * Delete category content |
|
| 960 | + * |
|
| 961 | + * @return array |
|
| 962 | + */ |
|
| 963 | 963 | private function _delete_cat_content() |
| 964 | 964 | { |
| 965 | 965 | $this->db->sql_transaction('begin'); |
@@ -1018,11 +1018,11 @@ discard block |
||
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 | /** |
| 1021 | - * Update links counter |
|
| 1022 | - * |
|
| 1023 | - * @param int $cat_id The category ID |
|
| 1024 | - * @return null |
|
| 1025 | - */ |
|
| 1021 | + * Update links counter |
|
| 1022 | + * |
|
| 1023 | + * @param int $cat_id The category ID |
|
| 1024 | + * @return null |
|
| 1025 | + */ |
|
| 1026 | 1026 | private function _sync_dir_cat($cat_id) |
| 1027 | 1027 | { |
| 1028 | 1028 | $sql = 'SELECT COUNT(link_id) AS num_links |
@@ -1040,12 +1040,12 @@ discard block |
||
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | 1042 | /** |
| 1043 | - * Update link data (note, vote, comment) |
|
| 1044 | - * |
|
| 1045 | - * @param int $start |
|
| 1046 | - * @param int $stop |
|
| 1047 | - * @return null |
|
| 1048 | - */ |
|
| 1043 | + * Update link data (note, vote, comment) |
|
| 1044 | + * |
|
| 1045 | + * @param int $start |
|
| 1046 | + * @param int $stop |
|
| 1047 | + * @return null |
|
| 1048 | + */ |
|
| 1049 | 1049 | private function _sync_dir_links($start, $stop) |
| 1050 | 1050 | { |
| 1051 | 1051 | $sql_ary = array( |
@@ -1088,12 +1088,12 @@ discard block |
||
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | /** |
| 1091 | - * Display icons drop-down list |
|
| 1092 | - * |
|
| 1093 | - * @param string $icons_path |
|
| 1094 | - * @param string $img_selected |
|
| 1095 | - * @return string |
|
| 1096 | - */ |
|
| 1091 | + * Display icons drop-down list |
|
| 1092 | + * |
|
| 1093 | + * @param string $icons_path |
|
| 1094 | + * @param string $img_selected |
|
| 1095 | + * @return string |
|
| 1096 | + */ |
|
| 1097 | 1097 | private function _get_dir_icon_list($icons_path, $img_selected) |
| 1098 | 1098 | { |
| 1099 | 1099 | $imglist = filelist($icons_path, ''); |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | protected $watch_table; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Set the controller helper |
|
| 28 | - * |
|
| 29 | - * @param \phpbb\controller\helper $helper |
|
| 30 | - * @return null |
|
| 31 | - */ |
|
| 27 | + * Set the controller helper |
|
| 28 | + * |
|
| 29 | + * @param \phpbb\controller\helper $helper |
|
| 30 | + * @return null |
|
| 31 | + */ |
|
| 32 | 32 | public function set_controller_helper(\phpbb\controller\helper $helper) |
| 33 | 33 | { |
| 34 | 34 | $this->helper = $helper; |
@@ -46,21 +46,21 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * Get notification type name |
|
| 50 | - * |
|
| 51 | - * @return string |
|
| 52 | - */ |
|
| 49 | + * Get notification type name |
|
| 50 | + * |
|
| 51 | + * @return string |
|
| 52 | + */ |
|
| 53 | 53 | public function get_type() |
| 54 | 54 | { |
| 55 | 55 | return 'ernadoo.phpbbdirectory.notification.type.directory_website'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * Notification option data (for outputting to the user) |
|
| 60 | - * |
|
| 61 | - * @var bool|array False if the service should use it's default data |
|
| 62 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
| 63 | - */ |
|
| 59 | + * Notification option data (for outputting to the user) |
|
| 60 | + * |
|
| 61 | + * @var bool|array False if the service should use it's default data |
|
| 62 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
| 63 | + */ |
|
| 64 | 64 | public static $notification_option = array( |
| 65 | 65 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_WEBSITE', |
| 66 | 66 | 'group' => 'NOTIFICATION_DIR_UCP', |
@@ -75,31 +75,31 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Is available |
|
| 79 | - * |
|
| 80 | - * @return bool True/False whether or not this is available to the user |
|
| 81 | - */ |
|
| 78 | + * Is available |
|
| 79 | + * |
|
| 80 | + * @return bool True/False whether or not this is available to the user |
|
| 81 | + */ |
|
| 82 | 82 | public function is_available() |
| 83 | 83 | { |
| 84 | 84 | return true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Get link id |
|
| 89 | - * |
|
| 90 | - * @param array $data The data from the link |
|
| 91 | - * @return int |
|
| 92 | - */ |
|
| 88 | + * Get link id |
|
| 89 | + * |
|
| 90 | + * @param array $data The data from the link |
|
| 91 | + * @return int |
|
| 92 | + */ |
|
| 93 | 93 | static public function get_item_id($data) |
| 94 | 94 | { |
| 95 | 95 | return (int) $data['link_id']; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * Get parent id - it's not used |
|
| 100 | - * |
|
| 101 | - * @param array $data The data from the link |
|
| 102 | - */ |
|
| 99 | + * Get parent id - it's not used |
|
| 100 | + * |
|
| 101 | + * @param array $data The data from the link |
|
| 102 | + */ |
|
| 103 | 103 | static public function get_item_parent_id($data) |
| 104 | 104 | { |
| 105 | 105 | // No parent |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Find the users who want to receive notifications |
|
| 111 | - * |
|
| 112 | - * @param array $data Data from submit link |
|
| 113 | - * @param array $options Options for finding users for notification |
|
| 114 | - * @return array |
|
| 115 | - */ |
|
| 110 | + * Find the users who want to receive notifications |
|
| 111 | + * |
|
| 112 | + * @param array $data Data from submit link |
|
| 113 | + * @param array $options Options for finding users for notification |
|
| 114 | + * @return array |
|
| 115 | + */ |
|
| 116 | 116 | public function find_users_for_notification($data, $options = array()) |
| 117 | 117 | { |
| 118 | 118 | $options = array_merge(array( |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | - * Get the user's avatar |
|
| 148 | - */ |
|
| 147 | + * Get the user's avatar |
|
| 148 | + */ |
|
| 149 | 149 | public function get_avatar() |
| 150 | 150 | { |
| 151 | 151 | return $this->user_loader->get_avatar($this->get_data('user_from'), false, true); |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * Get the HTML formatted title of this notification |
|
| 157 | - * |
|
| 158 | - * @return string |
|
| 159 | - */ |
|
| 156 | + * Get the HTML formatted title of this notification |
|
| 157 | + * |
|
| 158 | + * @return string |
|
| 159 | + */ |
|
| 160 | 160 | |
| 161 | 161 | public function get_title() |
| 162 | 162 | { |
@@ -169,20 +169,20 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * Get email template |
|
| 173 | - * |
|
| 174 | - * @return string |
|
| 175 | - */ |
|
| 172 | + * Get email template |
|
| 173 | + * |
|
| 174 | + * @return string |
|
| 175 | + */ |
|
| 176 | 176 | public function get_email_template() |
| 177 | 177 | { |
| 178 | 178 | return '@ernadoo_phpbbdirectory/directory_website'; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * Get email template variables |
|
| 183 | - * |
|
| 184 | - * @return array |
|
| 185 | - */ |
|
| 182 | + * Get email template variables |
|
| 183 | + * |
|
| 184 | + * @return array |
|
| 185 | + */ |
|
| 186 | 186 | public function get_email_template_variables() |
| 187 | 187 | { |
| 188 | 188 | return array( |
@@ -194,33 +194,33 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | - * Get the url to this item |
|
| 198 | - * |
|
| 199 | - * @return string URL |
|
| 200 | - */ |
|
| 197 | + * Get the url to this item |
|
| 198 | + * |
|
| 199 | + * @return string URL |
|
| 200 | + */ |
|
| 201 | 201 | public function get_url() |
| 202 | 202 | { |
| 203 | 203 | return $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $this->get_data('cat_id'))); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | - * Users needed to query before this notification can be displayed |
|
| 208 | - * |
|
| 209 | - * @return array Array of user_ids |
|
| 210 | - */ |
|
| 207 | + * Users needed to query before this notification can be displayed |
|
| 208 | + * |
|
| 209 | + * @return array Array of user_ids |
|
| 210 | + */ |
|
| 211 | 211 | public function users_to_query() |
| 212 | 212 | { |
| 213 | 213 | return array($this->get_data('user_from')); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
| 217 | - * Function for preparing the data for insertion in an SQL query |
|
| 218 | - * (The service handles insertion) |
|
| 219 | - * |
|
| 220 | - * @param array $data Data from submit link |
|
| 221 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 222 | - * @return array Array of data ready to be inserted into the database |
|
| 223 | - */ |
|
| 217 | + * Function for preparing the data for insertion in an SQL query |
|
| 218 | + * (The service handles insertion) |
|
| 219 | + * |
|
| 220 | + * @param array $data Data from submit link |
|
| 221 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
| 222 | + * @return array Array of data ready to be inserted into the database |
|
| 223 | + */ |
|
| 224 | 224 | public function create_insert_array($data, $pre_create_data = array()) |
| 225 | 225 | { |
| 226 | 226 | $this->set_data('link_name', $data['link_name']); |