| @@ -79,8 +79,9 @@ | ||
| 79 | 79 | /** |
| 80 | 80 | * @var array<string,mixed> |
| 81 | 81 | */ |
| 82 | 82 | private $nav = array( |
| 83 | + 'admin' => 'site', | |
| 83 | 84 | 'placement' => 'dock', |
| 84 | 85 | 'nav_kind' => 'app', |
| 85 | 86 | 'dock_order' => 0, |
| 86 | 87 | 'placeable' => false, |
| @@ -301,8 +302,23 @@ | ||
| 301 | 302 | return $this; |
| 302 | 303 | } |
| 303 | 304 | |
| 304 | 305 | /** |
| 306 | + * Which admin's shell offers the window. `site` (the default) is | |
| 307 | + * every site's shell and never the network admin's — right for an | |
| 308 | + * app that reads the current site; `network` is the network admin's | |
| 309 | + * shell only; `any` is both. On a single-site install the network | |
| 310 | + * admin does not exist, so `network` there offers the app nowhere. | |
| 311 | + * | |
| 312 | + * @param string $admin `site` | `network` | `any`. | |
| 313 | + * @return self | |
| 314 | + */ | |
| 315 | + public function admin( $admin ) { | |
| 316 | + $this->nav['admin'] = in_array( $admin, array( 'site', 'network', 'any' ), true ) ? $admin : 'site'; | |
| 317 | + return $this; | |
| 318 | + } | |
| 319 | + | |
| 320 | + /** | |
| 305 | 321 | * What the window is to the navigation model. |
| 306 | 322 | * |
| 307 | 323 | * @param string $kind `app` | `control`. |
| 308 | 324 | * @return self |
| @@ -986,8 +1002,9 @@ | ||
| 986 | 1002 | 'width' => $this->size['width'], |
| 987 | 1003 | 'height' => $this->size['height'], |
| 988 | 1004 | 'min_width' => $this->size['min_width'], |
| 989 | 1005 | 'min_height' => $this->size['min_height'], |
| 1006 | + 'admin' => $this->nav['admin'], | |
| 990 | 1007 | 'placement' => $this->nav['placement'], |
| 991 | 1008 | 'nav_kind' => $this->nav['nav_kind'], |
| 992 | 1009 | 'dock_order' => $this->nav['dock_order'], |
| 993 | 1010 | 'placeable' => $this->nav['placeable'], |