@@ -70,20 +70,20 @@ discard block |
||
| 70 | 70 | private $update; |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Constructor |
|
| 74 | - * |
|
| 75 | - * @param \phpbb\cache\service $cache Cache object |
|
| 76 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 77 | - * @param \phpbb\controller\helper $helper Helper object |
|
| 78 | - * @param \phpbb\language\language $language Language object |
|
| 79 | - * @param \phpbb\log\log $log Log object |
|
| 80 | - * @param \phpbb\request\request $request Request object |
|
| 81 | - * @param \phpbb\template\template $template Template object |
|
| 82 | - * @param \phpbb\user $user User object |
|
| 83 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 84 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 85 | - * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
| 86 | - */ |
|
| 73 | + * Constructor |
|
| 74 | + * |
|
| 75 | + * @param \phpbb\cache\service $cache Cache object |
|
| 76 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 77 | + * @param \phpbb\controller\helper $helper Helper object |
|
| 78 | + * @param \phpbb\language\language $language Language object |
|
| 79 | + * @param \phpbb\log\log $log Log object |
|
| 80 | + * @param \phpbb\request\request $request Request object |
|
| 81 | + * @param \phpbb\template\template $template Template object |
|
| 82 | + * @param \phpbb\user $user User object |
|
| 83 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 84 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 85 | + * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
| 86 | + */ |
|
| 87 | 87 | 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\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
| 88 | 88 | { |
| 89 | 89 | $this->cache = $cache; |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * Initialize defaults data for add page |
|
| 112 | - * |
|
| 113 | - * @return null |
|
| 114 | - */ |
|
| 111 | + * Initialize defaults data for add page |
|
| 112 | + * |
|
| 113 | + * @return null |
|
| 114 | + */ |
|
| 115 | 115 | public function action_add() |
| 116 | 116 | { |
| 117 | 117 | $this->cat_id = $this->parent_id; |
@@ -145,10 +145,10 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * Display deleting page |
|
| 149 | - * |
|
| 150 | - * @return null |
|
| 151 | - */ |
|
| 148 | + * Display deleting page |
|
| 149 | + * |
|
| 150 | + * @return null |
|
| 151 | + */ |
|
| 152 | 152 | public function action_delete() |
| 153 | 153 | { |
| 154 | 154 | if (!$this->cat_id) |
@@ -199,10 +199,10 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | - * Initialize data for edit page |
|
| 203 | - * |
|
| 204 | - * @return null |
|
| 205 | - */ |
|
| 202 | + * Initialize data for edit page |
|
| 203 | + * |
|
| 204 | + * @return null |
|
| 205 | + */ |
|
| 206 | 206 | public function action_edit() |
| 207 | 207 | { |
| 208 | 208 | $row = $this->_get_cat_info($this->cat_id); |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
| 232 | - * Move order categories |
|
| 233 | - * |
|
| 234 | - * @return null |
|
| 235 | - */ |
|
| 232 | + * Move order categories |
|
| 233 | + * |
|
| 234 | + * @return null |
|
| 235 | + */ |
|
| 236 | 236 | public function action_move() |
| 237 | 237 | { |
| 238 | 238 | if (!$this->cat_id) |
@@ -275,10 +275,10 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | - * Display progress bar for syncinc categories |
|
| 279 | - * |
|
| 280 | - * @return null |
|
| 281 | - */ |
|
| 278 | + * Display progress bar for syncinc categories |
|
| 279 | + * |
|
| 280 | + * @return null |
|
| 281 | + */ |
|
| 282 | 282 | public function action_progress_bar() |
| 283 | 283 | { |
| 284 | 284 | $start = $this->request->variable('start', 0); |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
| 302 | - * Get link's ID interval for _sync_dir_links() |
|
| 303 | - * |
|
| 304 | - * @return null |
|
| 305 | - */ |
|
| 302 | + * Get link's ID interval for _sync_dir_links() |
|
| 303 | + * |
|
| 304 | + * @return null |
|
| 305 | + */ |
|
| 306 | 306 | public function action_sync() |
| 307 | 307 | { |
| 308 | 308 | if (!$this->cat_id) |
@@ -386,10 +386,10 @@ discard block |
||
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
| 389 | - * Sync category data |
|
| 390 | - * |
|
| 391 | - * @return null |
|
| 392 | - */ |
|
| 389 | + * Sync category data |
|
| 390 | + * |
|
| 391 | + * @return null |
|
| 392 | + */ |
|
| 393 | 393 | public function action_sync_cat() |
| 394 | 394 | { |
| 395 | 395 | $sql = 'SELECT cat_name |
@@ -413,10 +413,10 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
| 416 | - * Display categories page |
|
| 417 | - * |
|
| 418 | - * @return null |
|
| 419 | - */ |
|
| 416 | + * Display categories page |
|
| 417 | + * |
|
| 418 | + * @return null |
|
| 419 | + */ |
|
| 420 | 420 | public function display_cats() |
| 421 | 421 | { |
| 422 | 422 | // Default management page |
@@ -511,22 +511,22 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /** |
| 514 | - * Set page url |
|
| 515 | - * |
|
| 516 | - * @param string $u_action Custom form action |
|
| 517 | - * @return null |
|
| 518 | - * @access public |
|
| 519 | - */ |
|
| 514 | + * Set page url |
|
| 515 | + * |
|
| 516 | + * @param string $u_action Custom form action |
|
| 517 | + * @return null |
|
| 518 | + * @access public |
|
| 519 | + */ |
|
| 520 | 520 | public function set_page_url($u_action) |
| 521 | 521 | { |
| 522 | 522 | $this->u_action = $u_action; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | /** |
| 526 | - * Update cat table |
|
| 527 | - * |
|
| 528 | - * @return null |
|
| 529 | - */ |
|
| 526 | + * Update cat table |
|
| 527 | + * |
|
| 528 | + * @return null |
|
| 529 | + */ |
|
| 530 | 530 | public function update() |
| 531 | 531 | { |
| 532 | 532 | if (!check_form_key($this->form_key)) |
@@ -620,11 +620,11 @@ discard block |
||
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | /** |
| 623 | - * Display form |
|
| 624 | - * |
|
| 625 | - * @param string $parents_list Drop-down list |
|
| 626 | - * @return null |
|
| 627 | - */ |
|
| 623 | + * Display form |
|
| 624 | + * |
|
| 625 | + * @param string $parents_list Drop-down list |
|
| 626 | + * @return null |
|
| 627 | + */ |
|
| 628 | 628 | private function _display_cat_form($parents_list) |
| 629 | 629 | { |
| 630 | 630 | $dir_cat_desc_data = array( |
@@ -694,11 +694,11 @@ discard block |
||
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
| 697 | - * Get category details |
|
| 698 | - * |
|
| 699 | - * @param int $cat_id The category ID |
|
| 700 | - * @return array |
|
| 701 | - */ |
|
| 697 | + * Get category details |
|
| 698 | + * |
|
| 699 | + * @param int $cat_id The category ID |
|
| 700 | + * @return array |
|
| 701 | + */ |
|
| 702 | 702 | private function _get_cat_info($cat_id) |
| 703 | 703 | { |
| 704 | 704 | $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 |
@@ -717,10 +717,10 @@ discard block |
||
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | /** |
| 720 | - * Update category data |
|
| 721 | - * |
|
| 722 | - * @return array |
|
| 723 | - */ |
|
| 720 | + * Update category data |
|
| 721 | + * |
|
| 722 | + * @return array |
|
| 723 | + */ |
|
| 724 | 724 | private function _update_cat_data() |
| 725 | 725 | { |
| 726 | 726 | if (!$this->cat_data['cat_name']) |
@@ -814,14 +814,14 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | /** |
| 817 | - * Remove complete category |
|
| 818 | - * |
|
| 819 | - * @param string $action_links Action for categories links |
|
| 820 | - * @param string $action_subcats Action for sub-categories |
|
| 821 | - * @param int $links_to_id New category ID for links |
|
| 822 | - * @param int $subcats_to_id New category ID for sub-categories |
|
| 823 | - * @return array |
|
| 824 | - */ |
|
| 817 | + * Remove complete category |
|
| 818 | + * |
|
| 819 | + * @param string $action_links Action for categories links |
|
| 820 | + * @param string $action_subcats Action for sub-categories |
|
| 821 | + * @param int $links_to_id New category ID for links |
|
| 822 | + * @param int $subcats_to_id New category ID for sub-categories |
|
| 823 | + * @return array |
|
| 824 | + */ |
|
| 825 | 825 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0) |
| 826 | 826 | { |
| 827 | 827 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -938,12 +938,12 @@ discard block |
||
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | /** |
| 941 | - * Move category content from one to another forum |
|
| 942 | - * |
|
| 943 | - * @param int $from_id |
|
| 944 | - * @param int $to_id |
|
| 945 | - * @return null |
|
| 946 | - */ |
|
| 941 | + * Move category content from one to another forum |
|
| 942 | + * |
|
| 943 | + * @param int $from_id |
|
| 944 | + * @param int $to_id |
|
| 945 | + * @return null |
|
| 946 | + */ |
|
| 947 | 947 | private function _move_cat_content($from_id, $to_id) |
| 948 | 948 | { |
| 949 | 949 | $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
@@ -959,10 +959,10 @@ discard block |
||
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | /** |
| 962 | - * Delete category content |
|
| 963 | - * |
|
| 964 | - * @return array |
|
| 965 | - */ |
|
| 962 | + * Delete category content |
|
| 963 | + * |
|
| 964 | + * @return array |
|
| 965 | + */ |
|
| 966 | 966 | private function _delete_cat_content() |
| 967 | 967 | { |
| 968 | 968 | $this->db->sql_transaction('begin'); |
@@ -1021,11 +1021,11 @@ discard block |
||
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | 1023 | /** |
| 1024 | - * Update links counter |
|
| 1025 | - * |
|
| 1026 | - * @param int $cat_id The category ID |
|
| 1027 | - * @return null |
|
| 1028 | - */ |
|
| 1024 | + * Update links counter |
|
| 1025 | + * |
|
| 1026 | + * @param int $cat_id The category ID |
|
| 1027 | + * @return null |
|
| 1028 | + */ |
|
| 1029 | 1029 | private function _sync_dir_cat($cat_id) |
| 1030 | 1030 | { |
| 1031 | 1031 | $sql = 'SELECT COUNT(link_id) AS num_links |
@@ -1043,12 +1043,12 @@ discard block |
||
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | /** |
| 1046 | - * Update link data (note, vote, comment) |
|
| 1047 | - * |
|
| 1048 | - * @param int $start |
|
| 1049 | - * @param int $stop |
|
| 1050 | - * @return null |
|
| 1051 | - */ |
|
| 1046 | + * Update link data (note, vote, comment) |
|
| 1047 | + * |
|
| 1048 | + * @param int $start |
|
| 1049 | + * @param int $stop |
|
| 1050 | + * @return null |
|
| 1051 | + */ |
|
| 1052 | 1052 | private function _sync_dir_links($start, $stop) |
| 1053 | 1053 | { |
| 1054 | 1054 | $sql_ary = array( |
@@ -1091,12 +1091,12 @@ discard block |
||
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | /** |
| 1094 | - * Display icons drop-down list |
|
| 1095 | - * |
|
| 1096 | - * @param string $icons_path |
|
| 1097 | - * @param string $img_selected |
|
| 1098 | - * @return string |
|
| 1099 | - */ |
|
| 1094 | + * Display icons drop-down list |
|
| 1095 | + * |
|
| 1096 | + * @param string $icons_path |
|
| 1097 | + * @param string $img_selected |
|
| 1098 | + * @return string |
|
| 1099 | + */ |
|
| 1100 | 1100 | private function _get_dir_icon_list($icons_path, $img_selected) |
| 1101 | 1101 | { |
| 1102 | 1102 | $imglist = filelist($icons_path, ''); |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | protected $u_action; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * Constructor |
|
| 35 | - * |
|
| 36 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 37 | - * @param \phpbb\language\language $language Language object |
|
| 38 | - * @param \phpbb\request\request $request Request object |
|
| 39 | - * @param \phpbb\template\template $template Template object |
|
| 40 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 41 | - */ |
|
| 34 | + * Constructor |
|
| 35 | + * |
|
| 36 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 37 | + * @param \phpbb\language\language $language Language object |
|
| 38 | + * @param \phpbb\request\request $request Request object |
|
| 39 | + * @param \phpbb\template\template $template Template object |
|
| 40 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 41 | + */ |
|
| 42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
| 43 | 43 | { |
| 44 | 44 | $this->db = $db; |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * Display confirm box |
|
| 53 | - * |
|
| 54 | - * @param string $action Requested action |
|
| 55 | - * @return null |
|
| 56 | - */ |
|
| 52 | + * Display confirm box |
|
| 53 | + * |
|
| 54 | + * @param string $action Requested action |
|
| 55 | + * @return null |
|
| 56 | + */ |
|
| 57 | 57 | public function display_confirm($action) |
| 58 | 58 | { |
| 59 | 59 | switch ($action) |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * Display phpBB Directory statistics |
|
| 95 | - * |
|
| 96 | - * @return null |
|
| 97 | - */ |
|
| 94 | + * Display phpBB Directory statistics |
|
| 95 | + * |
|
| 96 | + * @return null |
|
| 97 | + */ |
|
| 98 | 98 | public function display_stats() |
| 99 | 99 | { |
| 100 | 100 | // Count number of categories |
@@ -181,11 +181,11 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | - * Execute action requested |
|
| 185 | - * |
|
| 186 | - * @param string $action Requested action |
|
| 187 | - * @return null |
|
| 188 | - */ |
|
| 184 | + * Execute action requested |
|
| 185 | + * |
|
| 186 | + * @param string $action Requested action |
|
| 187 | + * @return null |
|
| 188 | + */ |
|
| 189 | 189 | public function exec_action($action) |
| 190 | 190 | { |
| 191 | 191 | switch ($action) |
@@ -260,23 +260,23 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | - * Set page url |
|
| 264 | - * |
|
| 265 | - * @param string $u_action Custom form action |
|
| 266 | - * @return null |
|
| 267 | - * @access public |
|
| 268 | - */ |
|
| 263 | + * Set page url |
|
| 264 | + * |
|
| 265 | + * @param string $u_action Custom form action |
|
| 266 | + * @return null |
|
| 267 | + * @access public |
|
| 268 | + */ |
|
| 269 | 269 | public function set_page_url($u_action) |
| 270 | 270 | { |
| 271 | 271 | $this->u_action = $u_action; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
| 275 | - * Get orphan banners |
|
| 276 | - * |
|
| 277 | - * @param bool $delete True if we want to delete banners, else false |
|
| 278 | - * @return null|int Number of orphan files, else null |
|
| 279 | - */ |
|
| 275 | + * Get orphan banners |
|
| 276 | + * |
|
| 277 | + * @param bool $delete True if we want to delete banners, else false |
|
| 278 | + * @return null|int Number of orphan files, else null |
|
| 279 | + */ |
|
| 280 | 280 | private function _orphan_files($delete = false) |
| 281 | 281 | { |
| 282 | 282 | $banner_path = $this->dir_helper->get_banner_path(); |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | private $display_vars; |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Constructor |
|
| 44 | - * |
|
| 45 | - * @param \phpbb\config\config $config Config object |
|
| 46 | - * @param \phpbb\language\language $language Language object |
|
| 47 | - * @param \phpbb\log\log $log Log object |
|
| 48 | - * @param \phpbb\request\request $request Request object |
|
| 49 | - * @param \phpbb\template\template $template Template object |
|
| 50 | - * @param \phpbb\user $user User object |
|
| 51 | - */ |
|
| 43 | + * Constructor |
|
| 44 | + * |
|
| 45 | + * @param \phpbb\config\config $config Config object |
|
| 46 | + * @param \phpbb\language\language $language Language object |
|
| 47 | + * @param \phpbb\log\log $log Log object |
|
| 48 | + * @param \phpbb\request\request $request Request object |
|
| 49 | + * @param \phpbb\template\template $template Template object |
|
| 50 | + * @param \phpbb\user $user User object |
|
| 51 | + */ |
|
| 52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
| 53 | 53 | { |
| 54 | 54 | $this->config = $config; |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Display config page |
|
| 66 | - * |
|
| 67 | - * @return null |
|
| 68 | - */ |
|
| 65 | + * Display config page |
|
| 66 | + * |
|
| 67 | + * @return null |
|
| 68 | + */ |
|
| 69 | 69 | public function display_config() |
| 70 | 70 | { |
| 71 | 71 | // Output relevant page |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | - * Validate config vars and update config table if needed |
|
| 115 | - * |
|
| 116 | - * @return null |
|
| 117 | - */ |
|
| 114 | + * Validate config vars and update config table if needed |
|
| 115 | + * |
|
| 116 | + * @return null |
|
| 117 | + */ |
|
| 118 | 118 | public function process() |
| 119 | 119 | { |
| 120 | 120 | $submit = ($this->request->is_set_post('submit')) ? true : false; |
@@ -167,22 +167,22 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | - * Set page url |
|
| 171 | - * |
|
| 172 | - * @param string $u_action Custom form action |
|
| 173 | - * @return null |
|
| 174 | - * @access public |
|
| 175 | - */ |
|
| 170 | + * Set page url |
|
| 171 | + * |
|
| 172 | + * @param string $u_action Custom form action |
|
| 173 | + * @return null |
|
| 174 | + * @access public |
|
| 175 | + */ |
|
| 176 | 176 | public function set_page_url($u_action) |
| 177 | 177 | { |
| 178 | 178 | $this->u_action = $u_action; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * Build config matrice |
|
| 183 | - * |
|
| 184 | - * @return null |
|
| 185 | - */ |
|
| 182 | + * Build config matrice |
|
| 183 | + * |
|
| 184 | + * @return null |
|
| 185 | + */ |
|
| 186 | 186 | private function _generate_config() |
| 187 | 187 | { |
| 188 | 188 | $this->display_vars = array( |
@@ -67,23 +67,23 @@ discard block |
||
| 67 | 67 | private $links_data; |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * Constructor |
|
| 71 | - * |
|
| 72 | - * @param \phpbb\config\config $config Config object |
|
| 73 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 74 | - * @param \phpbb\pagination $pagination Pagination object |
|
| 75 | - * @param \phpbb\language\language $language Language object |
|
| 76 | - * @param \phpbb\log\log $log Log object |
|
| 77 | - * @param \phpbb\notification\manager $notification Notification object |
|
| 78 | - * @param \phpbb\request\request $request Request object |
|
| 79 | - * @param \phpbb\template\template $template Template object |
|
| 80 | - * @param \phpbb\user $user User object |
|
| 81 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 82 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 83 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 84 | - * @param string $root_path phpBB root path |
|
| 85 | - * @param string $php_ext phpEx |
|
| 86 | - */ |
|
| 70 | + * Constructor |
|
| 71 | + * |
|
| 72 | + * @param \phpbb\config\config $config Config object |
|
| 73 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 74 | + * @param \phpbb\pagination $pagination Pagination object |
|
| 75 | + * @param \phpbb\language\language $language Language object |
|
| 76 | + * @param \phpbb\log\log $log Log object |
|
| 77 | + * @param \phpbb\notification\manager $notification Notification object |
|
| 78 | + * @param \phpbb\request\request $request Request object |
|
| 79 | + * @param \phpbb\template\template $template Template object |
|
| 80 | + * @param \phpbb\user $user User object |
|
| 81 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 82 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 83 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 84 | + * @param string $root_path phpBB root path |
|
| 85 | + * @param string $php_ext phpEx |
|
| 86 | + */ |
|
| 87 | 87 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
| 88 | 88 | { |
| 89 | 89 | $this->config = $config; |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * Display confirm box |
|
| 109 | - * |
|
| 110 | - * @param array $mark Website selected for (dis)approval |
|
| 111 | - * @return null |
|
| 112 | - */ |
|
| 108 | + * Display confirm box |
|
| 109 | + * |
|
| 110 | + * @param array $mark Website selected for (dis)approval |
|
| 111 | + * @return null |
|
| 112 | + */ |
|
| 113 | 113 | public function display_confirm($mark) |
| 114 | 114 | { |
| 115 | 115 | $s_hidden_fields = array( |
@@ -121,10 +121,10 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * Display website list for (dis)approval |
|
| 125 | - * |
|
| 126 | - * @return null |
|
| 127 | - */ |
|
| 124 | + * Display website list for (dis)approval |
|
| 125 | + * |
|
| 126 | + * @return null |
|
| 127 | + */ |
|
| 128 | 128 | public function display_websites() |
| 129 | 129 | { |
| 130 | 130 | global $phpbb_admin_path; |
@@ -228,11 +228,11 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | - * Get link's information and call appropriate action |
|
| 232 | - * |
|
| 233 | - * @param array $mark Website selected for (dis)approval |
|
| 234 | - * @return null |
|
| 235 | - */ |
|
| 231 | + * Get link's information and call appropriate action |
|
| 232 | + * |
|
| 233 | + * @param array $mark Website selected for (dis)approval |
|
| 234 | + * @return null |
|
| 235 | + */ |
|
| 236 | 236 | public function exec_action($mark) |
| 237 | 237 | { |
| 238 | 238 | $this->_get_infos_links($mark); |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
| 258 | - * Notify users which had submitted their websites |
|
| 259 | - * |
|
| 260 | - * @return null |
|
| 261 | - */ |
|
| 258 | + * Notify users which had submitted their websites |
|
| 259 | + * |
|
| 260 | + * @return null |
|
| 261 | + */ |
|
| 262 | 262 | public function notifiy_submiters() |
| 263 | 263 | { |
| 264 | 264 | if (!class_exists('messenger')) |
@@ -302,22 +302,22 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | - * Set page url |
|
| 306 | - * |
|
| 307 | - * @param string $u_action Custom form action |
|
| 308 | - * @return null |
|
| 309 | - * @access public |
|
| 310 | - */ |
|
| 305 | + * Set page url |
|
| 306 | + * |
|
| 307 | + * @param string $u_action Custom form action |
|
| 308 | + * @return null |
|
| 309 | + * @access public |
|
| 310 | + */ |
|
| 311 | 311 | public function set_page_url($u_action) |
| 312 | 312 | { |
| 313 | 313 | $this->u_action = $u_action; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
| 317 | - * Approve action |
|
| 318 | - * |
|
| 319 | - * @return null |
|
| 320 | - */ |
|
| 317 | + * Approve action |
|
| 318 | + * |
|
| 319 | + * @return null |
|
| 320 | + */ |
|
| 321 | 321 | private function _action_approved() |
| 322 | 322 | { |
| 323 | 323 | foreach ($this->links_data as $row) |
@@ -346,10 +346,10 @@ discard block |
||
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
| 349 | - * Disapprove action |
|
| 350 | - * |
|
| 351 | - * @return null |
|
| 352 | - */ |
|
| 349 | + * Disapprove action |
|
| 350 | + * |
|
| 351 | + * @return null |
|
| 352 | + */ |
|
| 353 | 353 | private function _action_disapproved() |
| 354 | 354 | { |
| 355 | 355 | foreach ($this->links_data as $row) |
@@ -370,11 +370,11 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
| 373 | - * Get informations about links selected |
|
| 374 | - * |
|
| 375 | - * @param $mark Website selected for (dis)approval |
|
| 376 | - * @return null |
|
| 377 | - */ |
|
| 373 | + * Get informations about links selected |
|
| 374 | + * |
|
| 375 | + * @param $mark Website selected for (dis)approval |
|
| 376 | + * @return null |
|
| 377 | + */ |
|
| 378 | 378 | private function _get_infos_links($mark) |
| 379 | 379 | { |
| 380 | 380 | $sql_array = array( |
@@ -409,11 +409,11 @@ discard block |
||
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /** |
| 412 | - * Notify users which watch categories |
|
| 413 | - * |
|
| 414 | - * @param $row Informations about website |
|
| 415 | - * @return null |
|
| 416 | - */ |
|
| 412 | + * Notify users which watch categories |
|
| 413 | + * |
|
| 414 | + * @param $row Informations about website |
|
| 415 | + * @return null |
|
| 416 | + */ |
|
| 417 | 417 | private function _notify_suscribers($row) |
| 418 | 418 | { |
| 419 | 419 | $notification_data = array( |
@@ -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()) |
@@ -59,23 +59,23 @@ discard block |
||
| 59 | 59 | protected $php_ext; |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Constructor |
|
| 63 | - * |
|
| 64 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 65 | - * @param \phpbb\config\config $config Config object |
|
| 66 | - * @param \phpbb\language\language $language Language object |
|
| 67 | - * @param \phpbb\template\template $template Template object |
|
| 68 | - * @param \phpbb\user $user User object |
|
| 69 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 70 | - * @param \phpbb\request\request $request Request object |
|
| 71 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 72 | - * @param \phpbb\pagination $pagination Pagination object |
|
| 73 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
| 74 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 75 | - * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
| 76 | - * @param string $root_path phpBB root path |
|
| 77 | - * @param string $php_ext phpEx |
|
| 78 | - */ |
|
| 62 | + * Constructor |
|
| 63 | + * |
|
| 64 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 65 | + * @param \phpbb\config\config $config Config object |
|
| 66 | + * @param \phpbb\language\language $language Language object |
|
| 67 | + * @param \phpbb\template\template $template Template object |
|
| 68 | + * @param \phpbb\user $user User object |
|
| 69 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 70 | + * @param \phpbb\request\request $request Request object |
|
| 71 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 72 | + * @param \phpbb\pagination $pagination Pagination object |
|
| 73 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
| 74 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 75 | + * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
| 76 | + * @param string $root_path phpBB root path |
|
| 77 | + * @param string $php_ext phpEx |
|
| 78 | + */ |
|
| 79 | 79 | 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, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
| 80 | 80 | { |
| 81 | 81 | $this->db = $db; |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | - * Populate form when an error occurred |
|
| 115 | - * |
|
| 116 | - * @param int $link_id The link ID |
|
| 117 | - * @param int $comment_id The comment ID |
|
| 118 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 119 | - * @throws \phpbb\exception\http_exception |
|
| 120 | - */ |
|
| 114 | + * Populate form when an error occurred |
|
| 115 | + * |
|
| 116 | + * @param int $link_id The link ID |
|
| 117 | + * @param int $comment_id The comment ID |
|
| 118 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 119 | + * @throws \phpbb\exception\http_exception |
|
| 120 | + */ |
|
| 121 | 121 | public function delete_comment($link_id, $comment_id) |
| 122 | 122 | { |
| 123 | 123 | $this->_check_comments_enable($link_id); |
@@ -156,13 +156,13 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * Edit a comment |
|
| 160 | - * |
|
| 161 | - * @param int $link_id The category ID |
|
| 162 | - * @param int $comment_id The comment ID |
|
| 163 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 164 | - * @throws \phpbb\exception\http_exception |
|
| 165 | - */ |
|
| 159 | + * Edit a comment |
|
| 160 | + * |
|
| 161 | + * @param int $link_id The category ID |
|
| 162 | + * @param int $comment_id The comment ID |
|
| 163 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 164 | + * @throws \phpbb\exception\http_exception |
|
| 165 | + */ |
|
| 166 | 166 | public function edit_comment($link_id, $comment_id) |
| 167 | 167 | { |
| 168 | 168 | $this->_check_comments_enable($link_id); |
@@ -193,12 +193,12 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | - * Post a new comment |
|
| 197 | - * |
|
| 198 | - * @param int $link_id The category ID |
|
| 199 | - * @return null |
|
| 200 | - * @throws \phpbb\exception\http_exception |
|
| 201 | - */ |
|
| 196 | + * Post a new comment |
|
| 197 | + * |
|
| 198 | + * @param int $link_id The category ID |
|
| 199 | + * @return null |
|
| 200 | + * @throws \phpbb\exception\http_exception |
|
| 201 | + */ |
|
| 202 | 202 | public function new_comment($link_id) |
| 203 | 203 | { |
| 204 | 204 | $this->_check_comments_enable($link_id); |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | - * Display popup comment |
|
| 228 | - * |
|
| 229 | - * @param int $link_id The category ID |
|
| 230 | - * @param int $page Page number taken from the URL |
|
| 231 | - * @param string $mode add|edit |
|
| 232 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 233 | - * @throws \phpbb\exception\http_exception |
|
| 234 | - */ |
|
| 227 | + * Display popup comment |
|
| 228 | + * |
|
| 229 | + * @param int $link_id The category ID |
|
| 230 | + * @param int $page Page number taken from the URL |
|
| 231 | + * @param string $mode add|edit |
|
| 232 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 233 | + * @throws \phpbb\exception\http_exception |
|
| 234 | + */ |
|
| 235 | 235 | public function view($link_id, $page, $mode = 'new') |
| 236 | 236 | { |
| 237 | 237 | $this->_check_comments_enable($link_id); |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
| 327 | - * Routine |
|
| 328 | - * |
|
| 329 | - * @param int $link_id The link ID |
|
| 330 | - * @param int $comment_id The comment ID |
|
| 331 | - * @param string $mode new|edit |
|
| 332 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 333 | - */ |
|
| 327 | + * Routine |
|
| 328 | + * |
|
| 329 | + * @param int $link_id The link ID |
|
| 330 | + * @param int $comment_id The comment ID |
|
| 331 | + * @param string $mode new|edit |
|
| 332 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 333 | + */ |
|
| 334 | 334 | private function _data_processing($link_id, $comment_id = 0, $mode = 'new') |
| 335 | 335 | { |
| 336 | 336 | if (!check_form_key('dir_form_comment')) |
@@ -418,12 +418,12 @@ discard block |
||
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
| 421 | - * Check if comments are enable in a category |
|
| 422 | - * |
|
| 423 | - * @param int $link_id The link ID |
|
| 424 | - * @return null Retun null if comments are allowed, http_exception if not |
|
| 425 | - * @throws \phpbb\exception\http_exception |
|
| 426 | - */ |
|
| 421 | + * Check if comments are enable in a category |
|
| 422 | + * |
|
| 423 | + * @param int $link_id The link ID |
|
| 424 | + * @return null Retun null if comments are allowed, http_exception if not |
|
| 425 | + * @throws \phpbb\exception\http_exception |
|
| 426 | + */ |
|
| 427 | 427 | private function _check_comments_enable($link_id) |
| 428 | 428 | { |
| 429 | 429 | $sql = 'SELECT link_cat |
@@ -449,12 +449,12 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /** |
| 452 | - * Populate form when an error occurred |
|
| 453 | - * |
|
| 454 | - * @param int $link_id The link ID |
|
| 455 | - * @param string $mode add|edit |
|
| 456 | - * @return null |
|
| 457 | - */ |
|
| 452 | + * Populate form when an error occurred |
|
| 453 | + * |
|
| 454 | + * @param int $link_id The link ID |
|
| 455 | + * @param string $mode add|edit |
|
| 456 | + * @return null |
|
| 457 | + */ |
|
| 458 | 458 | private function _populate_form($link_id, $mode) |
| 459 | 459 | { |
| 460 | 460 | if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit') |
@@ -71,23 +71,23 @@ discard block |
||
| 71 | 71 | protected $php_ext; |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | - * Constructor |
|
| 75 | - * |
|
| 76 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 77 | - * @param \phpbb\config\config $config Config object |
|
| 78 | - * @param \phpbb\language\language $language Language object |
|
| 79 | - * @param \phpbb\template\template $template Template object |
|
| 80 | - * @param \phpbb\user $user User object |
|
| 81 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 82 | - * @param \phpbb\request\request $request Request object |
|
| 83 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 84 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
| 85 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 86 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 87 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 88 | - * @param string $root_path phpBB root path |
|
| 89 | - * @param string $php_ext phpEx |
|
| 90 | - */ |
|
| 74 | + * Constructor |
|
| 75 | + * |
|
| 76 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 77 | + * @param \phpbb\config\config $config Config object |
|
| 78 | + * @param \phpbb\language\language $language Language object |
|
| 79 | + * @param \phpbb\template\template $template Template object |
|
| 80 | + * @param \phpbb\user $user User object |
|
| 81 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 82 | + * @param \phpbb\request\request $request Request object |
|
| 83 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 84 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
| 85 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 86 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 87 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
| 88 | + * @param string $root_path phpBB root path |
|
| 89 | + * @param string $php_ext phpEx |
|
| 90 | + */ |
|
| 91 | 91 | 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\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext) |
| 92 | 92 | { |
| 93 | 93 | $this->db = $db; |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | - * Delete a link |
|
| 118 | - * |
|
| 119 | - * @param int $cat_id The category ID |
|
| 120 | - * @param int $link_id The link ID |
|
| 121 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 122 | - */ |
|
| 117 | + * Delete a link |
|
| 118 | + * |
|
| 119 | + * @param int $cat_id The category ID |
|
| 120 | + * @param int $link_id The link ID |
|
| 121 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 122 | + */ |
|
| 123 | 123 | public function delete_link($cat_id, $link_id) |
| 124 | 124 | { |
| 125 | 125 | if ($this->request->is_set_post('cancel')) |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | - * Edit a link |
|
| 166 | - * |
|
| 167 | - * @param int $cat_id The category ID |
|
| 168 | - * @param int $link_id The link ID |
|
| 169 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 170 | - * @throws \phpbb\exception\http_exception |
|
| 171 | - */ |
|
| 165 | + * Edit a link |
|
| 166 | + * |
|
| 167 | + * @param int $cat_id The category ID |
|
| 168 | + * @param int $link_id The link ID |
|
| 169 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 170 | + * @throws \phpbb\exception\http_exception |
|
| 171 | + */ |
|
| 172 | 172 | public function edit_link($cat_id, $link_id) |
| 173 | 173 | { |
| 174 | 174 | $sql = 'SELECT link_user_id |
@@ -243,12 +243,12 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | - * Display add form |
|
| 247 | - * |
|
| 248 | - * @param int $cat_id The category ID |
|
| 249 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 250 | - * @throws \phpbb\exception\http_exception |
|
| 251 | - */ |
|
| 246 | + * Display add form |
|
| 247 | + * |
|
| 248 | + * @param int $cat_id The category ID |
|
| 249 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 250 | + * @throws \phpbb\exception\http_exception |
|
| 251 | + */ |
|
| 252 | 252 | public function new_link($cat_id) |
| 253 | 253 | { |
| 254 | 254 | if (!$this->auth->acl_get('u_submit_dir')) |
@@ -290,23 +290,23 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
| 293 | - * View link controller |
|
| 294 | - * |
|
| 295 | - * @param int $link_id The link ID |
|
| 296 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 297 | - */ |
|
| 293 | + * View link controller |
|
| 294 | + * |
|
| 295 | + * @param int $link_id The link ID |
|
| 296 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 297 | + */ |
|
| 298 | 298 | public function view_link($link_id) |
| 299 | 299 | { |
| 300 | 300 | return $this->link->view($link_id); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
| 304 | - * Vote for a link |
|
| 305 | - * |
|
| 306 | - * @param int $cat_id The category ID |
|
| 307 | - * @param int $link_id The link ID |
|
| 308 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 309 | - */ |
|
| 304 | + * Vote for a link |
|
| 305 | + * |
|
| 306 | + * @param int $cat_id The category ID |
|
| 307 | + * @param int $link_id The link ID |
|
| 308 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 309 | + */ |
|
| 310 | 310 | public function vote_link($cat_id, $link_id) |
| 311 | 311 | { |
| 312 | 312 | $this->categorie->get($cat_id); |
@@ -342,14 +342,14 @@ discard block |
||
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** |
| 345 | - * Routine |
|
| 346 | - * |
|
| 347 | - * @param int $cat_id The category ID |
|
| 348 | - * @param int $link_id The link ID |
|
| 349 | - * @param string $mode add|edit |
|
| 350 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 351 | - * @throws \phpbb\exception\http_exception |
|
| 352 | - */ |
|
| 345 | + * Routine |
|
| 346 | + * |
|
| 347 | + * @param int $cat_id The category ID |
|
| 348 | + * @param int $link_id The link ID |
|
| 349 | + * @param string $mode add|edit |
|
| 350 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 351 | + * @throws \phpbb\exception\http_exception |
|
| 352 | + */ |
|
| 353 | 353 | private function _data_processing($cat_id, $link_id = 0, $mode = 'new') |
| 354 | 354 | { |
| 355 | 355 | if (($mode == 'edit' && !$this->auth->acl_get('m_edit_dir') && !$this->auth->acl_get('u_edit_dir')) || ($mode == 'new' && !$this->auth->acl_get('u_submit_dir'))) |
@@ -439,8 +439,8 @@ discard block |
||
| 439 | 439 | if (!$error) |
| 440 | 440 | { |
| 441 | 441 | /** |
| 442 | - * No errrors, we execute heavy tasks wich need a valid url |
|
| 443 | - */ |
|
| 442 | + * No errrors, we execute heavy tasks wich need a valid url |
|
| 443 | + */ |
|
| 444 | 444 | |
| 445 | 445 | // Banner |
| 446 | 446 | $this->link->banner_process($this->banner, $error); |
@@ -523,11 +523,11 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | /** |
| 526 | - * Display a banner |
|
| 527 | - * |
|
| 528 | - * @param string $banner_img Path to banner file |
|
| 529 | - * @return Response object |
|
| 530 | - */ |
|
| 526 | + * Display a banner |
|
| 527 | + * |
|
| 528 | + * @param string $banner_img Path to banner file |
|
| 529 | + * @return Response object |
|
| 530 | + */ |
|
| 531 | 531 | public function return_banner($banner_img) |
| 532 | 532 | { |
| 533 | 533 | if (!function_exists('file_gc')) |
@@ -561,13 +561,13 @@ discard block |
||
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | /** |
| 564 | - * Populate form when an error occurred |
|
| 565 | - * |
|
| 566 | - * @param int $cat_id The category ID |
|
| 567 | - * @param string $mode add|edit |
|
| 568 | - * @param string $title Page title (depends of $mode) |
|
| 569 | - * @return null |
|
| 570 | - */ |
|
| 564 | + * Populate form when an error occurred |
|
| 565 | + * |
|
| 566 | + * @param int $cat_id The category ID |
|
| 567 | + * @param string $mode add|edit |
|
| 568 | + * @param string $title Page title (depends of $mode) |
|
| 569 | + * @return null |
|
| 570 | + */ |
|
| 571 | 571 | private function _populate_form($cat_id, $mode, $title) |
| 572 | 572 | { |
| 573 | 573 | global $phpbb_extension_manager; |
@@ -50,21 +50,21 @@ discard block |
||
| 50 | 50 | protected $link; |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * Constructor |
|
| 54 | - * |
|
| 55 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 56 | - * @param \phpbb\config\config $config Config object |
|
| 57 | - * @param \phpbb\language\language $language Language object |
|
| 58 | - * @param \phpbb\template\template $template Template object |
|
| 59 | - * @param \phpbb\user $user User object |
|
| 60 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
| 61 | - * @param \phpbb\request\request $request Request object |
|
| 62 | - * @param \phpbb\auth\auth $auth Auth object |
|
| 63 | - * @param \phpbb\pagination $pagination Pagination object |
|
| 64 | - * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
| 65 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 66 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 67 | - */ |
|
| 53 | + * Constructor |
|
| 54 | + * |
|
| 55 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 56 | + * @param \phpbb\config\config $config Config object |
|
| 57 | + * @param \phpbb\language\language $language Language object |
|
| 58 | + * @param \phpbb\template\template $template Template object |
|
| 59 | + * @param \phpbb\user $user User object |
|
| 60 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
| 61 | + * @param \phpbb\request\request $request Request object |
|
| 62 | + * @param \phpbb\auth\auth $auth Auth object |
|
| 63 | + * @param \phpbb\pagination $pagination Pagination object |
|
| 64 | + * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
| 65 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
| 66 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
| 67 | + */ |
|
| 68 | 68 | 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\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
| 69 | 69 | { |
| 70 | 70 | $this->db = $db; |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * Search controller |
|
| 94 | - * |
|
| 95 | - * @param int $page Page number taken from the URL |
|
| 96 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 97 | - * @throws \phpbb\exception\http_exception |
|
| 98 | - */ |
|
| 93 | + * Search controller |
|
| 94 | + * |
|
| 95 | + * @param int $page Page number taken from the URL |
|
| 96 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 97 | + * @throws \phpbb\exception\http_exception |
|
| 98 | + */ |
|
| 99 | 99 | public function main($page) |
| 100 | 100 | { |
| 101 | 101 | if (!$this->auth->acl_get('u_search_dir')) |
@@ -319,11 +319,11 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | - * |
|
| 323 | - * @param array $search_category |
|
| 324 | - * @param bool $search_child |
|
| 325 | - * @return array Categories to exclude from search |
|
| 326 | - */ |
|
| 322 | + * |
|
| 323 | + * @param array $search_category |
|
| 324 | + * @param bool $search_child |
|
| 325 | + * @return array Categories to exclude from search |
|
| 326 | + */ |
|
| 327 | 327 | private function _get_exclude_categories(&$search_category, $search_child) |
| 328 | 328 | { |
| 329 | 329 | $sql = 'SELECT cat_id, parent_id, right_id |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | protected $language; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Constructor |
|
| 26 | - * |
|
| 27 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 28 | - * @param \phpbb\language\language $language Language object |
|
| 29 | - */ |
|
| 25 | + * Constructor |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 28 | + * @param \phpbb\language\language $language Language object |
|
| 29 | + */ |
|
| 30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
| 31 | 31 | { |
| 32 | 32 | $this->db = $db; |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Add a comment |
|
| 38 | - * |
|
| 39 | - * @param array $data Link's data from db |
|
| 40 | - * @return null |
|
| 41 | - */ |
|
| 37 | + * Add a comment |
|
| 38 | + * |
|
| 39 | + * @param array $data Link's data from db |
|
| 40 | + * @return null |
|
| 41 | + */ |
|
| 42 | 42 | public function add($data) |
| 43 | 43 | { |
| 44 | 44 | $this->db->sql_transaction('begin'); |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Edit a comment |
|
| 59 | - * |
|
| 60 | - * @param array $data Data to edit |
|
| 61 | - * @param int $comment_id The comment ID |
|
| 62 | - * @return null |
|
| 63 | - */ |
|
| 58 | + * Edit a comment |
|
| 59 | + * |
|
| 60 | + * @param array $data Data to edit |
|
| 61 | + * @param int $comment_id The comment ID |
|
| 62 | + * @return null |
|
| 63 | + */ |
|
| 64 | 64 | public function edit($data, $comment_id) |
| 65 | 65 | { |
| 66 | 66 | $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Delete a comment |
|
| 74 | - * |
|
| 75 | - * @param string $link_id The link ID |
|
| 76 | - * @param string $comment_id The comment ID |
|
| 77 | - * @return null |
|
| 78 | - */ |
|
| 73 | + * Delete a comment |
|
| 74 | + * |
|
| 75 | + * @param string $link_id The link ID |
|
| 76 | + * @param string $comment_id The comment ID |
|
| 77 | + * @return null |
|
| 78 | + */ |
|
| 79 | 79 | public function del($link_id, $comment_id) |
| 80 | 80 | { |
| 81 | 81 | global $request; |