| @@ -27,28 +27,25 @@ | ||
| 27 | 27 | * Tree view : a simple tree view |
| 28 | 28 | */ |
| 29 | 29 | function groups_admin_tree_view() { |
| 30 | 30 | |
| 31 | - global $wpdb; | |
| 32 | - | |
| 33 | 31 | $output = ''; |
| 34 | - $today = date( 'Y-m-d', time() ); | |
| 35 | 32 | |
| 36 | - if ( !current_user_can( GROUPS_ACCESS_GROUPS ) ) { | |
| 37 | - wp_die( __( 'Access denied.', GROUPS_PLUGIN_DOMAIN ) ); | |
| 33 | + if ( !Groups_User::current_user_can( GROUPS_ACCESS_GROUPS ) ) { | |
| 34 | + wp_die( esc_html__( 'Access denied.', 'groups' ) ); | |
| 38 | 35 | } |
| 39 | 36 | |
| 40 | - $output .= | |
| 41 | - '<div class="groups-tree-view">' . | |
| 42 | - '<h1>' . | |
| 43 | - __( 'Tree of Groups', GROUPS_PLUGIN_DOMAIN ) . | |
| 44 | - '</h1>'; | |
| 37 | + $output .= '<div class="groups-tree-view">'; | |
| 38 | + $output .= '<h1>'; | |
| 39 | + $output .= esc_html__( 'Tree of Groups', 'groups' ); | |
| 40 | + $output .= '</h1>'; | |
| 45 | 41 | |
| 46 | - $tree = Groups_Utility::get_group_tree(); | |
| 42 | + $tree = Groups_Utility::get_tree(); | |
| 47 | 43 | $tree_output = ''; |
| 48 | - Groups_Utility::render_group_tree( $tree, $tree_output ); | |
| 44 | + $linked = Groups_User::current_user_can( GROUPS_ADMINISTER_GROUPS ); | |
| 45 | + Groups_Utility::render_tree( $tree, $tree_output, $linked, true ); | |
| 49 | 46 | $output .= $tree_output; |
| 50 | 47 | |
| 51 | 48 | $output .= '</div>'; // .groups-tree-view |
| 52 | 49 | |
| 53 | - echo $output; | |
| 50 | + echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 54 | 51 | } // function groups_admin_tree_view() |