diff options
author | awjrichards <arichards@wikimedia.org> | 2012-06-06 00:32:18 +0000 |
---|---|---|
committer | awjrichards <arichards@wikimedia.org> | 2012-06-02 11:00:45 -0700 |
commit | 99d056f1c9dc7f31667d7ec0d81c8068eee535a9 (patch) | |
tree | 8bfbce5ead8bb69c67ac320bcbad0a91d0b93629 | |
parent | 3c4cab7e370b9d15d01de0f049b5205a344108ff (diff) |
Revert "Beginning to implement 'viewType' in RequestContext to let MW know what type of view to render (eg standard, print, mobile)."origin/mobilefrontend-core-merge
This reverts commit c080c1c5ddc06b69ed265cd6560caf0b5ee61787
Change-Id: I2cb86079c473c6db2d9000b0cf9c8d6c611cd6cd
-rw-r--r-- | includes/OutputPage.php | 2 | ||||
-rw-r--r-- | includes/Wiki.php | 5 | ||||
-rw-r--r-- | includes/context/RequestContext.php | 32 |
3 files changed, 5 insertions, 34 deletions
diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 465a333a789d..35b2f385802c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -928,7 +928,7 @@ class OutputPage extends ContextSource { * @return Boolean */ public function isPrintable() { - return $this->getContext()->getViewType() === 'print'; + return $this->mPrintable; } /** diff --git a/includes/Wiki.php b/includes/Wiki.php index b6dccc4d523d..b20cb958378b 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -153,7 +153,10 @@ class MediaWiki { $title = $this->context->getTitle(); $output = $this->context->getOutput(); $user = $this->context->getUser(); - $this->context->setViewType(); + + if ( $request->getVal( 'printable' ) === 'yes' ) { + $output->setPrintable(); + } $unused = null; // To pass it by reference wfRunHooks( 'BeforeInitialize', array( &$title, &$unused, &$output, &$user, $request, $this ) ); diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 678edd86bdd0..1ffbc08ce20b 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -394,37 +394,5 @@ class RequestContext implements IContextSource { return $context; } - public function getViewType() { - if ( is_null( $this->viewType ) ) { - $this->setViewType(); - } - return $this->viewType; - } - - public function setViewType( $viewType = null ) { - if ( !is_null( $viewType ) ) { // and in array valid view types? - $this->viewType = (string) $viewType; - return; - } - - // printable? - if ( $this->getRequest()->getVal( 'printable' ) === 'yes' ) { - $this->viewType = 'print'; - return; - } - - // mobile? - // view toggling?! - $mobileContext = MobileContext::singleton(); - if ( $mobileContext->shouldDisplayMobileView() ) { - $this->viewType = 'mobile'; - $extMobileFrontend = new ExtMobileFrontend( $this ); - $mobileSkin = SkinMobile::factory( $extMobileFrontend ); - $this->setSkin( $mobileSkin ); - return; - } - - // provide hook for other view handling? - } } |