/** * Process the landing page. * * @param string $path * @param string $cabin */ protected function commonIndex(string $path, string $cabin) { list($publicPath, $root) = $this->loadCommonData($path, $cabin); $post = $this->post(new NewDirFilter()); if (!empty($post['submit_btn'])) { switch ($post['submit_btn']) { case 'new_dir': $status = $this->createDir($root, $cabin, $post); break; case 'upload': $status = $this->uploadFiles($root, $cabin); break; default: $status = ['status' => 'ERROR', 'message' => \__('Unknown operation')]; } if ($status['status'] === 'SUCCESS') { \Airship\redirect($this->airship_cabin_prefix . '/' . $this->path_middle . '/' . $cabin, ['dir' => $path]); } $this->storeLensVar('form_status', $status); } $this->lens('files/index', ['cabins' => $this->getCabinNamespaces(), 'subdirs' => $this->files->getChildrenOf($root, $cabin), 'files' => $this->files->getFilesInDirectory($root, $cabin), 'pathinfo' => $publicPath, 'current' => $path, 'cabin' => $cabin]); }