Changeset 14986 for extensions/Shadogo/trunk/overlaylibs.inc.php
- Timestamp:
- May 15, 2012, 12:50:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Shadogo/trunk/overlaylibs.inc.php
r10021 r14986 140 140 } 141 141 142 class MediaboxAdvanced15Wrapper implements iModalOverlayLib { 143 public static $LIB_NAME = 'mediaboxAdvanced_1_5_x'; 144 145 static function getName() { 146 return self::$LIB_NAME; 147 } 148 149 static public function isInstalled() { 150 $filename = ModalOverlayLibFactory::getFactoryPath() .DS. self::getName() .DS. 'mediaboxAdv-1.5.4.js'; 151 return file_exists($filename); 152 } 153 154 public function getFlashVarsTemplate() { 155 //return 'mediaURL={$VIDEO_URL}&teaserURL={$SRC_IMG}&allowSmoothing=true&autoPlay=false&buffer=6&showTimecode=true&loop=false&controlColor=0xFFFFFF&controlBackColor=0x000000&scaleIfFullScreen=true&showScalingButton=true&defaultVolume=100&crop=false'; 156 return 'file={$VIDEO_URL}&image={$SRC_IMG}&controlbar.position=over'; 157 } 158 159 public function getPlayerUrl() { 160 //$path = ModalOverlayLibFactory::getFactoryUrl() .'/'. self::getName() .'/NonverBlaster.swf'; 161 $path = ModalOverlayLibFactory::getFactoryUrl() .'/'. self::getName() .'/player.swf'; 162 return $path; 163 } 164 165 public function getDefaultLinkRelationship() { 166 return 'lightbox'; 167 } 168 169 public function appendHeaderContent($template, $tpl_var, $config) { 170 global $page; 171 $libPath = ModalOverlayLibFactory::getFactoryUrl() .'/'. self::getName(); 172 $content = ''; 173 174 // add script for services (used for "add to caddie") 175 //{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} 176 /* Not available for Piwigo 2.1.6 177 $template->func_combine_script( 178 array( 179 'id' => 'core.scripts', 180 'load' => 'async', 181 'path' => 'themes/default/js/scripts.js' 182 ), 183 $template->smarty 184 ); 185 */ 186 $content .= '<script src="themes/default/js/scripts.js" type="text/javascript"></script>'; 187 188 $theme = $config->modalOverlayTheme; 189 if ( !empty( $theme )) { 190 //$content .= '<link rel="stylesheet" href="'. $libPath .'/themes/style.css" type="text/css" media="screen" />'; 191 $content .= '<link rel="stylesheet" href="'. $libPath .'/themes/'. $theme .'/style.css" type="text/css" media="screen,projection" />'; 192 } 193 194 //$content .= '<script src="'. $libPath .'/mootools-core-1.3.2.js" type="text/javascript"></script>'; 195 $content .= '<script src="'. $libPath .'/mootools-core-1.4.5.js" type="text/javascript"></script>'; 196 $content .= '<script src="'. $libPath .'/Quickie.js" type="text/javascript"></script>'; 197 $content .= '<script src="'. $libPath .'/mediaboxAdv-1.5.4.js" type="text/javascript"></script>'; 198 199 $content .= '<script type="text/javascript">var ShadogoOverlayWnd=Mediabox; shadogoOptions = {'; 200 $content .= 'piwigoRootUrl: "'. get_root_url() .'"'; 201 if (isset($page['category'])) { 202 $content .= ', piwigoCategory: '. $page['category']['id']; 203 } 204 $content .= ', displayAddToBasket: '. (int) (is_admin() && $config->addToBasket && isset($page['category'])); 205 $content .= ', displayFavorite: '. (int) (!is_a_guest() && $config->favoritePicture && isset($page['category'])); 206 $content .= ', displayHdPicture: '. (int) $config->hdPicture; 207 $content .= ', displayDownload: '. (int) $config->downloadPicture; 208 $content .= '};</script>'; 209 210 $template->append($tpl_var, $content); 211 } 212 213 public function getCloseThumbnailJavaScript() { 214 return 'parent.window.Shadowbox.close(); return false;'; 215 } 216 217 static public function getThemes() { 218 return ModalOverlayLibFactory::getDirectoriesFromPath(ModalOverlayLibFactory::getFactoryPath() .DS. self::getName() .DS. 'themes'); 219 } 220 } 221 142 222 143 223 class ModalOverlayLibFactory { … … 159 239 $libs = array(); 160 240 if (MediaboxAdvancedWrapper::isInstalled() === true) $libs[] = MediaboxAdvancedWrapper::getName(); 241 if (MediaboxAdvanced15Wrapper::isInstalled() === true) $libs[] = MediaboxAdvanced15Wrapper::getName(); 161 242 if (ShadowboxWrapper::isInstalled() === true) $libs[] = ShadowboxWrapper::getName(); 162 243 return $libs; … … 175 256 if (0 === strcmp($libName, MediaboxAdvancedWrapper::getName())) { 176 257 return new MediaboxAdvancedWrapper(); 258 } else if (0 === strcmp($libName, MediaboxAdvanced15Wrapper::getName())) { 259 return new MediaboxAdvanced15Wrapper(); 177 260 } else if (0 === strcmp($libName, ShadowboxWrapper::getName())) { 178 261 return new ShadowboxWrapper();
Note: See TracChangeset
for help on using the changeset viewer.