code/pages/WikiPage.php
public function delete() {
		$page = $this->data();
		/* @var $page Page */
		if ($page) {
			$parent = $page->Parent();
			$ID = $page->ID;

			$page->deleteFromStage('Live');

			// only fully delete if we're autopublishing stuff.. a bit counter
			// intuitive, but works pretty well
			if (WikiPage::$auto_publish) {
				$page->ID = $ID;
				$page->deleteFromStage('Stage');
			}

			return $this->redirect($parent->Link());
			return;
		}

		throw new Exception("Invalid request");
	}
public function delete() {
		$page = $this->data();
		/* @var $page Page */
		if ($page) {
			$parent = $page->Parent();
			$ID = $page->ID;

			$page->deleteFromStage('Live');

			// only fully delete if we're autopublishing stuff.. a bit counter
			// intuitive, but works pretty well
			if (WikiPage::$auto_publish) {
				$page->ID = $ID;
				$page->deleteFromStage('Stage');
			}

			return $this->redirect($parent->Link());
			return;
		}

		throw new Exception("Invalid request");
	}
public function delete ( ) { $ page = $ this -> data ( ) ; /* @var $page Page */ if ( $ page ) { $ parent = $ page -> Parent ( ) ; $ ID = $ page -> ID ; $ page -> deleteFromStage ( 'Live' ) ; // only fully delete if we're autopublishing stuff.. a bit counter // intuitive, but works pretty well if ( WikiPage :: $ auto_publish ) { $ page -> ID = $ ID ; $ page -> deleteFromStage ( 'Stage' ) ; } return $ this -> redirect ( $ parent -> Link ( ) ) ; return ; } throw new Exception ( "Invalid request" ) ; }
Deletes the current page and returns the user to the parent
of the now deleted page.
Deletes the current page and returns the user to the parent of the now deleted page .