/** * Return a HTML representation of the image gallery / slideshow */ public function toHTML() { global $wgRTEParserEnabled; $out = ''; wfProfileIn(__METHOD__); if (!wfRunHooks('GalleryBeforeProduceHTML', array($this->mData, &$out))) { wfProfileOut(__METHOD__); return $out; } // render as placeholder in RTE if (!empty($wgRTEParserEnabled)) { if ($this->mType == self::WIKIA_PHOTO_GALLERY) { // gallery: 185x185px placeholder $width = $height = 185; } elseif ($this->mType == self::WIKIA_PHOTO_SLIDER) { $width = WikiaPhotoGalleryHelper::SLIDER_MIN_IMG_WIDTH; $height = WikiaPhotoGalleryHelper::SLIDER_MIN_IMG_HEIGHT; } else { // slideshow: use user specified size $width = $this->mWidths; $height = round($this->mWidths * 3 / 4); } $out = WikiaPhotoGalleryHelper::renderGalleryPlaceholder($this, $width, $height); wfProfileOut(__METHOD__); return $out; } switch ($this->mType) { case self::WIKIA_PHOTO_GALLERY: $out = $this->renderGallery(); break; case self::WIKIA_PHOTO_SLIDESHOW: $out = $this->renderSlideshow(); break; case self::WIKIA_PHOTO_SLIDER: $out = $this->renderSlider(); break; } if (!$this->canRenderMediaGallery()) { $out .= $this->getBaseJSSnippets(); } wfProfileOut(__METHOD__); return $out; }
/** * Return a HTML representation of the image gallery / slideshow */ public function toHTML() { global $wgRTEParserEnabled; $out = ''; wfProfileIn(__METHOD__); // render as placeholder in RTE if (!empty($wgRTEParserEnabled)) { if ($this->mType == self::WIKIA_PHOTO_GALLERY) { // gallery: 185x185px placeholder $width = $height = 185; } elseif ($this->mType == self::WIKIA_PHOTO_SLIDER) { $width = WikiaPhotoGalleryHelper::SLIDER_MIN_IMG_WIDTH; $height = WikiaPhotoGalleryHelper::SLIDER_MIN_IMG_HEIGHT; } else { // slideshow: use user specified size $width = $this->mWidths; $height = round($this->mWidths * 3 / 4); } $out = WikiaPhotoGalleryHelper::renderGalleryPlaceholder($this, $width, $height); wfProfileOut(__METHOD__); return $out; } switch ($this->mType) { case self::WIKIA_PHOTO_GALLERY: if ($this->mFeedURL) { $out = $this->renderFeedGallery(); } else { $out = $this->renderGallery(); } break; case self::WIKIA_PHOTO_SLIDESHOW: if ($this->mFeedURL) { $out = $this->renderFeedSlideshow(); } else { $out = $this->renderSlideshow(); } break; case self::WIKIA_PHOTO_SLIDER: $out = $this->renderSlider(); break; } $out .= F::build('JSSnippets')->addToStack(array('/extensions/wikia/WikiaPhotoGallery/js/WikiaPhotoGallery.view.js'), array(), 'WikiaPhotoGalleryView.init'); wfProfileOut(__METHOD__); return $out; }