| @@ -59,8 +59,41 @@ | ||
| 59 | 59 | return openstation_posts_app_config( 'posts', 'date', 'desc' ); |
| 60 | 60 | } |
| 61 | 61 | ) |
| 62 | 62 | ->state( openstation_posts_app_state( 'date', 'desc' ) ) |
| 63 | + // The Posts menu, while this window answers for it: the dock's | |
| 64 | + // submenu becomes these tabs and a row opens the window on its | |
| 65 | + // own one. The runtime lands the window on it; the client view | |
| 66 | + // renders the strip from the same list. | |
| 67 | + ->menu( | |
| 68 | + 'edit.php', | |
| 69 | + static function () { | |
| 70 | + $tabs = array( | |
| 71 | + 'posts' => array( | |
| 72 | + 'label' => __( 'All posts', 'desktop-mode' ), | |
| 73 | + 'page' => 'edit.php', | |
| 74 | + ), | |
| 75 | + 'new' => array( | |
| 76 | + 'label' => __( 'Add Post', 'desktop-mode' ), | |
| 77 | + 'page' => 'post-new.php', | |
| 78 | + ), | |
| 79 | + ); | |
| 80 | + // The taxonomy tabs are the taxonomy screens, so they | |
| 81 | + // answer to the same capability those screens do. | |
| 82 | + if ( current_user_can( 'manage_categories' ) ) { | |
| 83 | + $tabs['categories'] = array( | |
| 84 | + 'label' => __( 'Categories', 'desktop-mode' ), | |
| 85 | + 'page' => 'edit-tags.php?taxonomy=category', | |
| 86 | + ); | |
| 87 | + $tabs['tags'] = array( | |
| 88 | + 'label' => __( 'Tags', 'desktop-mode' ), | |
| 89 | + 'page' => 'edit-tags.php?taxonomy=post_tag', | |
| 90 | + ); | |
| 91 | + } | |
| 92 | + return $tabs; | |
| 93 | + }, | |
| 94 | + 'openstation_posts_window_user_can_use' | |
| 95 | + ) | |
| 63 | 96 | ->action( |
| 64 | 97 | 'filter', |
| 65 | 98 | static function ( State $state ) { |
| 66 | 99 | openstation_posts_app_filter( $state ); |