@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | protected $php_ext; |
38 | 38 | |
39 | 39 | /** |
40 | - * Constructor |
|
41 | - * |
|
42 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
43 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
44 | - * @param \phpbb\language\language $language Language object |
|
45 | - * @param \phpbb\template\template $template Template object |
|
46 | - * @param string $table_prefix prefix table |
|
47 | - * @param string $php_ext phpEx |
|
48 | - * @access public |
|
49 | - */ |
|
40 | + * Constructor |
|
41 | + * |
|
42 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
43 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
44 | + * @param \phpbb\language\language $language Language object |
|
45 | + * @param \phpbb\template\template $template Template object |
|
46 | + * @param string $table_prefix prefix table |
|
47 | + * @param string $php_ext phpEx |
|
48 | + * @access public |
|
49 | + */ |
|
50 | 50 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext) |
51 | 51 | { |
52 | 52 | $this->db = $db; |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * Assign functions defined in this class to event listeners in the core |
|
62 | - * |
|
63 | - * @return array |
|
64 | - * @static |
|
65 | - * @access public |
|
66 | - */ |
|
61 | + * Assign functions defined in this class to event listeners in the core |
|
62 | + * |
|
63 | + * @return array |
|
64 | + * @static |
|
65 | + * @access public |
|
66 | + */ |
|
67 | 67 | static public function getSubscribedEvents() |
68 | 68 | { |
69 | 69 | return array( |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * Display links to Directory |
|
80 | - * |
|
81 | - * @return null |
|
82 | - */ |
|
79 | + * Display links to Directory |
|
80 | + * |
|
81 | + * @return null |
|
82 | + */ |
|
83 | 83 | public function add_page_header_variables() |
84 | 84 | { |
85 | 85 | $ext_theme_path = $this->get_ext_name() . '/styles/prosilver/theme/'; |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | - * Show users as viewing Directory on Who Is Online page |
|
103 | - * |
|
104 | - * @param object $event The event object |
|
105 | - * @return null |
|
106 | - */ |
|
102 | + * Show users as viewing Directory on Who Is Online page |
|
103 | + * |
|
104 | + * @param object $event The event object |
|
105 | + * @return null |
|
106 | + */ |
|
107 | 107 | public function add_page_viewonline($event) |
108 | 108 | { |
109 | 109 | if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * Load common language files during user setup |
|
118 | - * |
|
119 | - * @param object $event The event object |
|
120 | - * @return null |
|
121 | - */ |
|
117 | + * Load common language files during user setup |
|
118 | + * |
|
119 | + * @param object $event The event object |
|
120 | + * @return null |
|
121 | + */ |
|
122 | 122 | public function load_language_on_setup($event) |
123 | 123 | { |
124 | 124 | $lang_set_ext = $event['lang_set_ext']; |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * Add administrative permissions to manage Directory |
|
134 | - * |
|
135 | - * @param object $event The event object |
|
136 | - * @return null |
|
137 | - */ |
|
133 | + * Add administrative permissions to manage Directory |
|
134 | + * |
|
135 | + * @param object $event The event object |
|
136 | + * @return null |
|
137 | + */ |
|
138 | 138 | public function permissions_add_directory($event) |
139 | 139 | { |
140 | 140 | $event->update_subarray('categories', 'dir', 'ACL_CAT_DIRECTORY'); |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
158 | - * Update Directory tables if needed, after deleted an user |
|
159 | - * |
|
160 | - * @param object $event The event object |
|
161 | - * @return null |
|
162 | - */ |
|
158 | + * Update Directory tables if needed, after deleted an user |
|
159 | + * |
|
160 | + * @param object $event The event object |
|
161 | + * @return null |
|
162 | + */ |
|
163 | 163 | public function update_links_with_anonymous($event) |
164 | 164 | { |
165 | 165 | $user_ids = $event['user_ids']; |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext) |
51 | 51 | { |
52 | - $this->db = $db; |
|
53 | - $this->helper = $helper; |
|
52 | + $this->db = $db; |
|
53 | + $this->helper = $helper; |
|
54 | 54 | $this->language = $language; |
55 | 55 | $this->template = $template; |
56 | 56 | $this->table_prefix = $table_prefix; |
57 | - $this->php_ext = $php_ext; |
|
57 | + $this->php_ext = $php_ext; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function add_page_header_variables() |
84 | 84 | { |
85 | - $ext_theme_path = $this->get_ext_name() . '/styles/prosilver/theme/'; |
|
85 | + $ext_theme_path = $this->get_ext_name().'/styles/prosilver/theme/'; |
|
86 | 86 | $theme_lang_path = $this->language->get_used_language(); |
87 | 87 | |
88 | 88 | // Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist |
89 | - if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css')) |
|
89 | + if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css')) |
|
90 | 90 | { |
91 | 91 | // Fallback to English language. |
92 | 92 | $theme_lang_path = \phpbb\language\language::FALLBACK_LANGUAGE; |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function add_page_viewonline($event) |
108 | 108 | { |
109 | - if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
|
109 | + if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0) |
|
110 | 110 | { |
111 | - $event['location'] = $this->language->lang('DIRECTORY'); |
|
112 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
111 | + $event['location'] = $this->language->lang('DIRECTORY'); |
|
112 | + $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -137,21 +137,21 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function permissions_add_directory($event) |
139 | 139 | { |
140 | - $event->update_subarray('categories', 'dir', 'ACL_CAT_DIRECTORY'); |
|
141 | - |
|
142 | - $event->update_subarray('permissions', 'm_delete_dir', array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir')); |
|
143 | - $event->update_subarray('permissions', 'm_delete_comment_dir', array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir')); |
|
144 | - $event->update_subarray('permissions', 'm_edit_dir', array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir')); |
|
145 | - $event->update_subarray('permissions', 'm_edit_comment_dir', array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir')); |
|
146 | - |
|
147 | - $event->update_subarray('permissions', 'u_comment_dir', array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir')); |
|
148 | - $event->update_subarray('permissions', 'u_delete_dir', array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir')); |
|
149 | - $event->update_subarray('permissions', 'u_delete_comment_dir', array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir')); |
|
150 | - $event->update_subarray('permissions', 'u_edit_dir', array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir')); |
|
151 | - $event->update_subarray('permissions', 'u_edit_comment_dir', array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir')); |
|
152 | - $event->update_subarray('permissions', 'u_search_dir', array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir')); |
|
153 | - $event->update_subarray('permissions', 'u_submit_dir', array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir')); |
|
154 | - $event->update_subarray('permissions', 'u_vote_dir', array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir')); |
|
140 | + $event->update_subarray('categories', 'dir', 'ACL_CAT_DIRECTORY'); |
|
141 | + |
|
142 | + $event->update_subarray('permissions', 'm_delete_dir', array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir')); |
|
143 | + $event->update_subarray('permissions', 'm_delete_comment_dir', array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir')); |
|
144 | + $event->update_subarray('permissions', 'm_edit_dir', array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir')); |
|
145 | + $event->update_subarray('permissions', 'm_edit_comment_dir', array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir')); |
|
146 | + |
|
147 | + $event->update_subarray('permissions', 'u_comment_dir', array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir')); |
|
148 | + $event->update_subarray('permissions', 'u_delete_dir', array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir')); |
|
149 | + $event->update_subarray('permissions', 'u_delete_comment_dir', array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir')); |
|
150 | + $event->update_subarray('permissions', 'u_edit_dir', array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir')); |
|
151 | + $event->update_subarray('permissions', 'u_edit_comment_dir', array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir')); |
|
152 | + $event->update_subarray('permissions', 'u_search_dir', array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir')); |
|
153 | + $event->update_subarray('permissions', 'u_submit_dir', array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir')); |
|
154 | + $event->update_subarray('permissions', 'u_vote_dir', array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir')); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | $user_ids = array($user_ids); |
170 | 170 | } |
171 | 171 | |
172 | - $sql = 'UPDATE ' . $this->comments_table . ' |
|
173 | - SET comment_user_id = ' . ANONYMOUS . ' |
|
172 | + $sql = 'UPDATE '.$this->comments_table.' |
|
173 | + SET comment_user_id = ' . ANONYMOUS.' |
|
174 | 174 | WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids); |
175 | 175 | $this->db->sql_query($sql); |
176 | 176 | |
177 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
178 | - SET link_user_id = ' . ANONYMOUS . ' |
|
177 | + $sql = 'UPDATE '.$this->links_table.' |
|
178 | + SET link_user_id = ' . ANONYMOUS.' |
|
179 | 179 | WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids); |
180 | 180 | $this->db->sql_query($sql); |
181 | 181 | |
182 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
182 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
183 | 183 | WHERE ' . $this->db->sql_in_set('user_id', $user_ids); |
184 | 184 | $this->db->sql_query($sql); |
185 | 185 | } |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | private $cat_data; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor. |
|
26 | - * |
|
27 | - * @param \phpbb\config\config $config Config object |
|
28 | - * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
29 | - */ |
|
25 | + * Constructor. |
|
26 | + * |
|
27 | + * @param \phpbb\config\config $config Config object |
|
28 | + * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\config\config $config, \ernadoo\phpbbdirectory\core\cron $directory_cron) |
31 | 31 | { |
32 | 32 | $this->config = $config; |
@@ -34,66 +34,66 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Manually set categorie data. |
|
38 | - * |
|
39 | - * @param array $cat_data Information about a category to be pruned. |
|
40 | - */ |
|
37 | + * Manually set categorie data. |
|
38 | + * |
|
39 | + * @param array $cat_data Information about a category to be pruned. |
|
40 | + */ |
|
41 | 41 | public function set_categorie_data($cat_data) |
42 | 42 | { |
43 | 43 | $this->cat_data = $cat_data; |
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * Runs this cron task. |
|
48 | - * |
|
49 | - * @return null |
|
50 | - */ |
|
47 | + * Runs this cron task. |
|
48 | + * |
|
49 | + * @return null |
|
50 | + */ |
|
51 | 51 | public function run() |
52 | 52 | { |
53 | 53 | $this->dir_cron->auto_check($this->cat_data); |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Returns whether this cron task can run, given current board configuration. |
|
58 | - * |
|
59 | - * @return bool |
|
60 | - */ |
|
57 | + * Returns whether this cron task can run, given current board configuration. |
|
58 | + * |
|
59 | + * @return bool |
|
60 | + */ |
|
61 | 61 | public function is_runnable() |
62 | 62 | { |
63 | 63 | return !$this->config['use_system_cron'] && !empty($this->cat_data); |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * Returns whether this cron task should run now, because enough time |
|
68 | - * has passed since it was last run. |
|
69 | - * |
|
70 | - * @return bool |
|
71 | - */ |
|
67 | + * Returns whether this cron task should run now, because enough time |
|
68 | + * has passed since it was last run. |
|
69 | + * |
|
70 | + * @return bool |
|
71 | + */ |
|
72 | 72 | public function should_run() |
73 | 73 | { |
74 | 74 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time(); |
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | - * Returns parameters of this cron task as an array. |
|
79 | - * The array has one key, c, whose value is id of the category to be pruned. |
|
80 | - * |
|
81 | - * @return array |
|
82 | - */ |
|
78 | + * Returns parameters of this cron task as an array. |
|
79 | + * The array has one key, c, whose value is id of the category to be pruned. |
|
80 | + * |
|
81 | + * @return array |
|
82 | + */ |
|
83 | 83 | public function get_parameters() |
84 | 84 | { |
85 | 85 | return array('c' => $this->cat_data['cat_id']); |
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * Parses parameters found in $request, which is an instance of |
|
90 | - * \phpbb\request\request_interface. |
|
91 | - * |
|
92 | - * It is expected to have a key f whose value is id of the forum to be pruned. |
|
93 | - * |
|
94 | - * @param \phpbb\request\request_interface $request Request object. |
|
95 | - * @return null |
|
96 | - */ |
|
89 | + * Parses parameters found in $request, which is an instance of |
|
90 | + * \phpbb\request\request_interface. |
|
91 | + * |
|
92 | + * It is expected to have a key f whose value is id of the forum to be pruned. |
|
93 | + * |
|
94 | + * @param \phpbb\request\request_interface $request Request object. |
|
95 | + * @return null |
|
96 | + */ |
|
97 | 97 | public function parse_parameters(\phpbb\request\request_interface $request) |
98 | 98 | { |
99 | 99 | $this->cat_data = array(); |
@@ -29,8 +29,8 @@ |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\config\config $config, \ernadoo\phpbbdirectory\core\cron $directory_cron) |
31 | 31 | { |
32 | - $this->config = $config; |
|
33 | - $this->dir_cron = $directory_cron; |
|
32 | + $this->config = $config; |
|
33 | + $this->dir_cron = $directory_cron; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |