| @@ -118,8 +118,38 @@ | ||
| 118 | 118 | } |
| 119 | 119 | ) |
| 120 | 120 | // Resolved when the window registers, for the viewer registering it. |
| 121 | 121 | ->config( 'openstation_users_profile_facts' ) |
| 122 | + // The Users menu, while this window is the one answering for it: | |
| 123 | + // the dock's submenu becomes these tabs, same labels, same order, | |
| 124 | + // and picking one opens the window on it. The window's own strip | |
| 125 | + // renders from the same list (`menuTabs` in the config extra), so | |
| 126 | + // the two cannot drift. | |
| 127 | + ->menu( | |
| 128 | + 'users.php', | |
| 129 | + static function () { | |
| 130 | + $tabs = array( | |
| 131 | + 'all' => array( | |
| 132 | + 'label' => __( 'People', 'desktop-mode' ), | |
| 133 | + 'page' => 'users.php', | |
| 134 | + ), | |
| 135 | + 'roles' => __( 'Roles', 'desktop-mode' ), | |
| 136 | + 'activity' => __( 'Activity', 'desktop-mode' ), | |
| 137 | + ); | |
| 138 | + if ( current_user_can( 'create_users' ) ) { | |
| 139 | + $tabs['add-new'] = array( | |
| 140 | + 'label' => __( 'Add new', 'desktop-mode' ), | |
| 141 | + 'page' => 'user-new.php', | |
| 142 | + ); | |
| 143 | + } | |
| 144 | + $tabs['edit'] = array( | |
| 145 | + 'label' => __( 'Profile', 'desktop-mode' ), | |
| 146 | + 'page' => 'profile.php', | |
| 147 | + ); | |
| 148 | + return $tabs; | |
| 149 | + }, | |
| 150 | + 'openstation_users_window_user_can_use' | |
| 151 | + ) | |
| 122 | 152 | ->state( |
| 123 | 153 | array( |
| 124 | 154 | 'page' => 1, |
| 125 | 155 | 'perPage' => 20, |
| @@ -298,8 +328,12 @@ | ||
| 298 | 328 | foreach ( $list['items'] as $i => $row ) { |
| 299 | 329 | $id = isset( $row['id'] ) ? (int) $row['id'] : 0; |
| 300 | 330 | if ( isset( $stats[ $id ] ) ) { |
| 301 | 331 | $list['items'][ $i ]['openstation_user_stats'] = $stats[ $id ]; |
| 332 | + } | |
| 333 | + // Core's row carries the name as stored (`&`); the view paints text. | |
| 334 | + if ( isset( $row['name'] ) ) { | |
| 335 | + $list['items'][ $i ]['name'] = openstation_plain_text_title( $row['name'] ); | |
| 302 | 336 | } |
| 303 | 337 | } |
| 304 | 338 | return array( 'list' => $list ); |
| 305 | 339 | } |