- $out = $this->getContext()->getOutput();
- $this->loadFile();
-
- $descText = $this->mPage->getFile()->getDescriptionText();
-
- $out->setArticleBodyOnly( true );
-
- if ( !$descText ) {
- // If no description text, just do standard action=render
- parent::view();
- } else {
- if ( $this->mPage->getID() !== 0 ) {
- // Local description exists. We need to output both
- parent::view();
- $out->addHTML( '<div class="mw-shared-image-desc">' . $descText . "</div>\n" );
- } else {
- // We don't want to output both a "noarticletext" message and the shared
- // description, so don't call parent::view().
- $out->addHTML( '<div class="mw-shared-image-desc">' . $descText . "</div>\n" );
- // Since we did not call parent::view(), have to call some methods it
- // normally takes care of. (Not that it matters much since skin not displayed)
- $out->setArticleFlag( true );
- $out->setPageTitle( $this->getTitle()->getPrefixedText() );
- $this->mPage->doViewUpdates( $this->getContext()->getUser() );
- }
- }