@@ -403,6 +403,9 @@ discard block |
||
403 | 403 | return $attr; |
404 | 404 | } |
405 | 405 | |
406 | + /** |
|
407 | + * @return string |
|
408 | + */ |
|
406 | 409 | protected function qte_move($attr_row, $action = 'move_up', $steps = 1) |
407 | 410 | { |
408 | 411 | global $db, $table_prefix; |
@@ -530,7 +533,7 @@ discard block |
||
530 | 533 | * Copy a permission (auth) option |
531 | 534 | * |
532 | 535 | * @param string $auth_option The name of the permission (auth) option |
533 | - * @param int|false $copy_from If set, contains the id of the permission from which to copy the new one. |
|
536 | + * @param string $copy_from If set, contains the id of the permission from which to copy the new one. |
|
534 | 537 | * @param bool $clear_dest_perms True if destination permissions should be deleted |
535 | 538 | * @return null |
536 | 539 | */ |
@@ -525,15 +525,15 @@ |
||
525 | 525 | } |
526 | 526 | |
527 | 527 | /** |
528 | - * Permission Copy |
|
529 | - * |
|
530 | - * Copy a permission (auth) option |
|
531 | - * |
|
532 | - * @param string $auth_option The name of the permission (auth) option |
|
533 | - * @param int|false $copy_from If set, contains the id of the permission from which to copy the new one. |
|
534 | - * @param bool $clear_dest_perms True if destination permissions should be deleted |
|
535 | - * @return null |
|
536 | - */ |
|
528 | + * Permission Copy |
|
529 | + * |
|
530 | + * Copy a permission (auth) option |
|
531 | + * |
|
532 | + * @param string $auth_option The name of the permission (auth) option |
|
533 | + * @param int|false $copy_from If set, contains the id of the permission from which to copy the new one. |
|
534 | + * @param bool $clear_dest_perms True if destination permissions should be deleted |
|
535 | + * @return null |
|
536 | + */ |
|
537 | 537 | private function _copy_permission($auth_option, $copy_from = false, $clear_dest_perms = true) |
538 | 538 | { |
539 | 539 | global $db, $phpbb_root_path, $phpEx; |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function __construct(\phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\log\log $log, \phpbb\auth\auth $auth, $root_path, $php_ext, $table_prefix) |
71 | 71 | { |
72 | - $this->request = $request; |
|
72 | + $this->request = $request; |
|
73 | 73 | $this->cache = $cache; |
74 | - $this->db = $db; |
|
75 | - $this->template = $template; |
|
74 | + $this->db = $db; |
|
75 | + $this->template = $template; |
|
76 | 76 | $this->user = $user; |
77 | - $this->log = $log; |
|
77 | + $this->log = $log; |
|
78 | 78 | $this->auth = $auth; |
79 | 79 | |
80 | - $this->root_path = $root_path; |
|
81 | - $this->php_ext = $php_ext; |
|
80 | + $this->root_path = $root_path; |
|
81 | + $this->php_ext = $php_ext; |
|
82 | 82 | $this->table_prefix = $table_prefix; |
83 | 83 | |
84 | 84 | $this->_get_attributes(); |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | public function attr_select($forum_id, $author_id = 0, $attribute_id = 0, $viewtopic_url = '') |
169 | 169 | { |
170 | 170 | $show_select = false; |
171 | - $current_time = time(); |
|
172 | - $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id); |
|
171 | + $current_time = time(); |
|
172 | + $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id); |
|
173 | 173 | $can_remove = $this->auth->acl_get('m_qte_attr_del', $forum_id); |
174 | - $is_author = $this->user->data['is_registered'] && $this->user->data['user_id'] == $author_id; |
|
174 | + $is_author = $this->user->data['is_registered'] && $this->user->data['user_id'] == $author_id; |
|
175 | 175 | |
176 | 176 | // Basic auth |
177 | 177 | if (!$can_remove && !$can_edit && !$is_author) |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | foreach ($this->_attr as $attr) |
183 | 183 | { |
184 | - if (!$this->auth->acl_get('f_qte_attr_'.$attr['attr_id'], $forum_id)) |
|
184 | + if (!$this->auth->acl_get('f_qte_attr_' . $attr['attr_id'], $forum_id)) |
|
185 | 185 | { |
186 | 186 | continue; |
187 | 187 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | { |
252 | 252 | foreach ($this->_attr as $attr) |
253 | 253 | { |
254 | - $forum_allowed = $this->auth->acl_getf('f_qte_attr_'.$attr['attr_id'], true); |
|
254 | + $forum_allowed = $this->auth->acl_getf('f_qte_attr_' . $attr['attr_id'], true); |
|
255 | 255 | |
256 | 256 | if (isset($forum_allowed[$forum_id])) |
257 | 257 | { |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | { |
285 | 285 | foreach ($this->_attr as $attr) |
286 | 286 | { |
287 | - $forum_allowed = $this->auth->acl_getf('f_qte_attr_'.$attr['attr_id'], true); |
|
287 | + $forum_allowed = $this->auth->acl_getf('f_qte_attr_' . $attr['attr_id'], true); |
|
288 | 288 | |
289 | 289 | if (isset($forum_allowed[$forum_id])) |
290 | 290 | { |
@@ -395,8 +395,8 @@ discard block |
||
395 | 395 | return; |
396 | 396 | } |
397 | 397 | |
398 | - $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id) || $this->auth->acl_get('f_qte_attr_'.$attribute_id, $forum_id) && $this->user->data['is_registered'] && $this->user->data['user_id'] == $author_id; |
|
399 | - $can_remove = $this->auth->acl_get('m_qte_attr_del', $forum_id); |
|
398 | + $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id) || $this->auth->acl_get('f_qte_attr_' . $attribute_id, $forum_id) && $this->user->data['is_registered'] && $this->user->data['user_id'] == $author_id; |
|
399 | + $can_remove = $this->auth->acl_get('m_qte_attr_del', $forum_id); |
|
400 | 400 | |
401 | 401 | if (!$can_edit && $attribute_id != self::REMOVE || !$can_remove && $attribute_id == self::REMOVE) |
402 | 402 | { |
@@ -470,8 +470,8 @@ discard block |
||
470 | 470 | */ |
471 | 471 | public function mcp_attr_apply($attribute_id = 0, $forum_id = 0, $topic_ids = array()) |
472 | 472 | { |
473 | - $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id); |
|
474 | - $can_remove = $this->auth->acl_get('m_qte_attr_del', $forum_id); |
|
473 | + $can_edit = $this->auth->acl_get('m_qte_attr_edit', $forum_id); |
|
474 | + $can_remove = $this->auth->acl_get('m_qte_attr_del', $forum_id); |
|
475 | 475 | |
476 | 476 | if (!$can_edit && $attribute_id != self::REMOVE || !$can_remove && $attribute_id == self::REMOVE) |
477 | 477 | { |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | $a_class_name = preg_replace('#[^a-z0-9 _-]#', '', strtolower($a_name)); |
583 | 583 | } |
584 | 584 | |
585 | - return ' class="qte-attr ' . (isset($a_class_name) ? $a_class_name : '') . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : ''); |
|
585 | + return ' class="qte-attr ' . (isset($a_class_name) ? $a_class_name : '') . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : ''); |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | /** |