Changeset 222
- Timestamp:
- 05/28/07 18:20:15 (1 year ago)
- Files:
-
- trunk/api/process/commonfile.php (modified) (1 diff)
- trunk/api/process/luxbumgallery.php (modified) (5 diffs)
- trunk/api/ui/public/Gallery.php (modified) (1 diff)
- trunk/api/ui/public/SlideShow.php (modified) (2 diffs)
- trunk/templates/common/slideshow/slideshow.js (modified) (1 diff)
- trunk/templates/public/luxbum/slideshow.html (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/api/process/commonfile.php
r201 r222 1 1 <?php 2 2 3 // 1,2,4,8,16 etc, so can define masks 3 4 define('TYPE_IMAGE_FILE', 1); 4 5 define('TYPE_FLV_FILE', 2); 6 5 7 6 8 /** trunk/api/process/luxbumgallery.php
r221 r222 31 31 * Default constructor 32 32 * @param String $dir Dossier de la galerie 33 * @param integer $fileType Type de fichiers souhaités dans la galerie 33 34 * @return luxBumGallery 34 35 */ 35 function __construct($dir, $ preview= '') {36 function __construct($dir, $fileType = '') { 36 37 parent::__construct(); 37 $this->preview = $preview;38 $this->preview = ''; 38 39 39 40 $this->dir = files::addTailSlash($dir); … … 42 43 $this->name = $list[count($list) - 1]; 43 44 44 $this->addAll Images();45 $this->addAllFiles($fileType); 45 46 $this->_completeInfos (); 46 47 $this->_loadPrivate(); … … 278 279 * They have all their date / description correctly filled in. 279 280 */ 280 function addAllImages() { 281 private function addAllFiles($fileType) { 282 283 if ($fileType == '') { 284 $fileType = TYPE_IMAGE_FILE | TYPE_FLV_FILE; 285 } 281 286 282 287 // Ouverture du dossier des photos … … 291 296 292 297 // Add an image file 293 if (files::isPhotoFile ($this->dir, $current_file) ) {298 if (files::isPhotoFile ($this->dir, $current_file) && ($fileType & TYPE_IMAGE_FILE)) { 294 299 $imageTemp = new luxBumImage ($this->dir, $current_file); 295 300 … … 308 313 309 314 // Add a flash video file 310 else if (files::isFlvFile($this->dir, $current_file) ) {315 else if (files::isFlvFile($this->dir, $current_file) && ($fileType & TYPE_FLV_FILE)) { 311 316 $object = new LuxbumFlv($this->dir, $current_file); 312 317 $this->addToList($object); trunk/api/ui/public/Gallery.php
r221 r222 36 36 $gallery = new luxBumGallery($dir); 37 37 $gallery->createOrMajDescriptionFile(); 38 $gallery->getDescriptions();39 38 40 39 $imgIndex = $gallery->getImageIndex($defaultImage); trunk/api/ui/public/SlideShow.php
r221 r222 21 21 */ 22 22 function action($request, $match) { 23 $dir = $match[1]; 23 $dir = files::addTailSlash($match[1]); 24 $defaultImage = $match[2]; 24 25 25 26 // Check if the gallery is private 26 $this->check Dir($dir);27 $this->checkFile($dir, $defaultImage); 27 28 $this->checkPrivate($dir); 28 29 … … 30 31 $GLOBALS['LB']['title'] = ' - '.NOM_GALERIE; 31 32 32 $GLOBALS['_LB_render']['res'] = new luxBumGallery($dir); 33 $res =& $GLOBALS['_LB_render']['res']; 33 $gallery = new luxBumGallery($dir, TYPE_IMAGE_FILE); 34 $imgIndex = $gallery->getImageIndex($defaultImage); 35 $gallery->setDefaultIndex($imgIndex); 36 34 37 35 // Add comment form valid 36 lbPostAction::comment(); 37 38 header('Content-Type: text/html; charset=UTF-8'); 39 include (TEMPLATE_DIR.TEMPLATE.'/slideshow.php'); 40 return 200; 41 38 $context = new Pluf_Template_Context(array('gallery' => $gallery, 39 'cfg' => $GLOBALS['_PX_config'])); 40 41 $tmpl = new Pluf_Template('slideshow.html'); 42 return new Pluf_HTTP_Response($tmpl->render($context)); 42 43 } 43 44 } trunk/templates/common/slideshow/slideshow.js
r175 r222 339 339 } 340 340 341 /* XmlHTTPRequestfunction to get the next Photo Path */341 /*function to get the next Photo Path */ 342 342 function getCurrentPhoto(index, pos) { 343 // var xmlhttp = getHTTPObject('photo'); 344 // xmlhttp.open("POST", "slideshow.php", true); 345 // xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 346 // xmlhttp.send("action=photo&dir="+currentDir+"&file="+photosURL[index]); 347 348 // if (xmlhttp) { 349 // /* we define what should be done once the server has answered */ 350 // xmlhttp.onreadystatechange=function() { 351 // /* 4 : "complete" */ 352 // if (xmlhttp.readyState == 4) { 353 // /* HTTP Code 200 "Ok" */ 354 // if (xmlhttp.status == 200) { 355 if (pos == "fg") { 356 document.getElementById(foreImage).src = photosURL[index]; 357 } 358 else if (pos == "bg") { 359 document.getElementById(backImage).src = photosURL[index]; 360 } 361 // } 362 // } 363 // } 364 // } 343 if (pos == "fg") { 344 document.getElementById(foreImage).src = photosURL[index]; 345 } 346 else if (pos == "bg") { 347 document.getElementById(backImage).src = photosURL[index]; 348 } 365 349 } 366 350 trunk/templates/public/luxbum/slideshow.html
r201 r222 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 6 <meta name="MSSmartTagsPreventParsing" content="TRUE" /> 7 < script type="text/javascript" src="http://localhost/luxbum/trunk/common_templates/slideshow/slideshow.js"></script>8 < title><?php lb::pageTitle(); ?></title>7 <title>{$cfg['gallery_name']}</title> 8 <script type="text/javascript" src="{$cfg['url_base']}templates/common/slideshow/slideshow.js"></script> 9 9 10 <?php lbconf::favicon();?> 11 <?php lbconf::pageStyle();?> 10 {style} 11 12 </head> 12 13 13 14 {literal} … … 132 133 <script type="text/javascript"> 133 134 <!-- 134 var photosDir = "<?php lbslide::photoDir();?>"; 135 var currentDir = "<?php lbslide::slideshowDir();?>"; 136 var photosURL = new Array(); 135 var photosURL = new Array(); 137 136 138 <?php while (!$res->EOF()):?> 139 photosURL[<?php echo (lbpage::resPosition(true)-1);?>] = "<?php lb::displayApercu("%s"); ?>"; 140 <?php $res->moveNext(); 141 endwhile;?> 137 {assign $cpt =0} 138 {foreach $gallery as $img} 139 photosURL[{$cpt}] = "{$img.previewUrl}"; 140 {assign $cpt=$cpt+1} 141 {/foreach} 142 142 143 var smoothtrans = <?php lbslide::slideshowFadingText();?>; // Set this to false to prevent any fading effect144 var slide_speed = <?php lbslide::slideshowTime();?>;145 -->143 var smoothtrans = {$cfg['slideshow_fading']}; // Set this to false to prevent any fading effect 144 var slide_speed = {$cfg['slideshow_time']}; 145 --> 146 146 </script> 147 147 … … 152 152 153 153 <div id="controle"> 154 <div id="s_next"> »</div>155 <div id="s_prev"> «</div>154 <div id="s_next"><img src="{$cfg['color_theme_path']}/images/next.png" alt="{i18n next}"/></div> 155 <div id="s_prev"><img src="{$cfg['color_theme_path']}/images/previous.png" alt="{i18n previous}"/></div> 156 156 <div id="s_play">Démarrer</div> 157 157 <div id="s_pause">Pause</div> … … 182 182 </div> 183 183 </body> 184 <?php include ('footer.php');?> 184 {include '_footer.html'}
