public function delete($id) { AllowAccess::to([UserRoles::ADMIN, UserRoles::EDITOR], '/'); $result = $this->blockRepository->remove($id); if (!$result) { Redirect::loggedUser('/blocks/' . $id . '/edit'); } Redirect::loggedUser('/back'); }
public function background() { AllowAccess::to('admin', '/'); $this->view()->render('settings.background'); }
public function postSetupHomepage() { AllowAccess::to(['admin', 'editor'], '/'); if (isset($_POST['homepageId'])) { $homepageId = $_POST['homepageId']; } else { Session::flash('flash_messages', 'Something went wrong. Please try again!'); Redirect::to('pages/homepage'); } $result = $this->pageRepository->setHomepage($homepageId); if (!$result) { Redirect::loggedUser('/pages/homepage'); } Redirect::to('/'); }