/** * Delete an existing redirect * * @param string $cabin * @param string $redirectId */ public function deleteRedirect(string $cabin, string $redirectId) { $cabins = $this->getCabinNamespaces(); if (!\in_array($cabin, $cabins) && !$this->can('delete')) { \Airship\redirect($this->airship_cabin_prefix . '/redirects'); } $this->storeLensVar('active_submenu', ['Cabins', 'Cabin__' . $cabin]); $post = $this->post(); $redirectId = (int) $redirectId; $redirect = $this->pg->getRedirect($cabin, $redirectId); if (empty($redirect)) { \Airship\redirect($this->airship_cabin_prefix . '/redirects/' . $cabin); } if ($post) { if ($this->pg->deleteRedirect($redirectId)) { \Airship\redirect($this->airship_cabin_prefix . '/redirects/' . $cabin); } } $this->lens('redirect/delete', ['cabin' => $cabin, 'redirect' => $redirect]); }