コード例 #1
0
ファイル: ajax.php プロジェクト: Tommar/vino2
 /**
  * Get images from JoomGallery Component
  */
 function getImagesFromJoomGallery(&$photos)
 {
     if (!is_array($photos)) {
         $photos = array();
     }
     require_once JPATH_ROOT . '/modules/mod_bt_backgroundslideshow/helpers/helper.php';
     $helper = new BTBgSlideShowHelper();
     if (!$helper->checkJGalleryComponent()) {
         $this->result["success"] = false;
         $this->result["message"] = JText::_('MOD_BTBGSLIDESHOW_COM_JOOMGALLERY_NOT_EXIST');
     } else {
         $rs = $helper->getJoomGalleryPhotos(JRequest::getString('jgallery_catid'));
         if (count($rs) > 0) {
             foreach ($rs as $photo) {
                 $file = JURI::root() . "images/joomgallery/originals/" . $photo->cat_name . '/' . $photo->filename;
                 $fileInfo = pathinfo($file);
                 $hashedName = md5($this->moduleID . '-' . 'jgallery-' . $photo->cat_name . '-' . $fileInfo['filename']);
                 if ($file && !JFile::exists($this->saveDir . "/tmp/manager/{$hashedName}.{$fileInfo["extension"]}") && !in_array($hashedName . '.' . $fileInfo["extension"], $this->items)) {
                     $objFile = new stdClass();
                     $objFile->file = $file;
                     $objFile->title = $photo->title;
                     $objFile->source = 'jgallery-' . $photo->cat_name;
                     $photos[] = $objFile;
                 }
             }
         }
     }
 }