/** * Get the IContextSource in use here * @return IContextSource */ public final function getContext() { if ($this->context instanceof IContextSource) { return $this->context; } return $this->page->getContext(); }
/** * @param ImagePage $imagePage */ public function __construct($imagePage) { global $wgShowArchiveThumbnails; $this->current = $imagePage->getPage()->getFile(); $this->img = $imagePage->getDisplayedFile(); $this->title = $imagePage->getTitle(); $this->imagePage = $imagePage; $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender(); $this->setContext($imagePage->getContext()); }
/** * @param ImagePage $imagePage */ function __construct($imagePage) { parent::__construct($imagePage->getContext()); $this->mImagePage = $imagePage; $this->mTitle = clone $imagePage->getTitle(); $this->mTitle->setFragment('#filehistory'); $this->mImg = null; $this->mHist = array(); $this->mRange = array(0, 0); // display range }
/** * Get the IContextSource in use here * @return IContextSource */ final public function getContext() { if ( $this->context instanceof IContextSource ) { return $this->context; } else if ( $this->page instanceof Article ) { // NOTE: $this->page can be a WikiPage, which does not have a context. wfDebug( __METHOD__ . ': no context known, falling back to Article\'s context.' ); return $this->page->getContext(); } wfWarn( __METHOD__ . ': no context known, falling back to RequestContext::getMain().' ); return RequestContext::getMain(); }