コード例 #1
0
 /**
  * Render Media Gallery (gallery version 2014)
  * @return string
  */
 private function renderMediaGallery()
 {
     $media = [];
     $result = '';
     foreach ($this->mFiles as $val) {
         $file = wfFindFile($val[0]);
         if (empty($file) || WikiaFileHelper::isFileTypeVideo($file) || WikiaFileHelper::isFileTypeOgg($file)) {
             continue;
         }
         $media[] = ['title' => $val[0], 'caption' => $val[3], 'link' => $val[2]];
     }
     if (!empty($media)) {
         $result = F::app()->renderView('MediaGalleryController', 'gallery', ['items' => $media, 'gallery_params' => $this->mData['params'], 'parser' => $this->mParser]);
     }
     return $result;
 }