Changeset 216
- Timestamp:
- 05/28/07 16:01:17 (1 year ago)
- Files:
-
- trunk/api/inc/dispatcher.php (modified) (1 diff)
- trunk/api/process/commongallery.php (modified) (1 diff)
- trunk/api/process/luxbumgallery.php (modified) (1 diff)
- trunk/api/ui/link.php (modified) (1 diff)
- trunk/api/ui/public/Display.php (modified) (3 diffs)
- trunk/index.php (modified) (1 diff)
- trunk/templates/public/photoblog/display.html (modified) (2 diffs)
- trunk/templates/public/photoblog/error.html (added)
- trunk/templates/public/photoblog/gallery.html (modified) (1 diff)
- trunk/templates/public/photoblog/index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/api/inc/dispatcher.php
r212 r216 136 136 } 137 137 } 138 //return new Pluf_HTTP_Response_NotFound("No Matching view");139 138 $view = new ui_public_Error("No Matching view"); 140 139 return $view->aclError($req, $match); trunk/api/process/commongallery.php
r212 r216 265 265 266 266 /** 267 * @return string the link url to select all images in the current gallery268 */269 public function getLinkSelectAll() {270 return link::selectall($this->dir);271 }272 273 /**274 * @return string the link url to select all images in the current gallery275 */276 public function getLinkUnselectAll() {277 return link::unselectall($this->dir);278 }279 280 /**281 267 * Retourne le lien de la vignette de l'image vers le script qui génére 282 268 * l'image trunk/api/process/luxbumgallery.php
r212 r216 473 473 } 474 474 } 475 476 477 /** 478 * @return string the link url to select all images in the current gallery 479 */ 480 public function getLinkSelectAll() { 481 return link::selectall($this->dir); 482 } 483 484 /** 485 * @return string the link url to select all images in the current gallery 486 */ 487 public function getLinkUnselectAll() { 488 return link::unselectall($this->dir); 489 } 475 490 476 491 function __toString() { trunk/api/ui/link.php
r215 r216 139 139 $dir = link::encode($dir); 140 140 $img = link::encode($img); 141 return link::prefix().'display/'.$dir.$img; 142 141 if ($GLOBALS['isSelection']) { 142 return link::prefix().'selectiond/'.$dir.$img; 143 } 144 else { 145 return link::prefix().'display/'.$dir.$img; 146 } 143 147 } 144 148 } trunk/api/ui/public/Display.php
r209 r216 5 5 */ 6 6 class ui_public_Display extends ui_CommonView { 7 8 private $gallery; 9 private $dir; 10 private $file; 7 11 8 12 … … 13 17 */ 14 18 function view($request, $match) { 15 $ dir = files::addTailSlash($match[1]);16 $ file = $match[2];19 $this->dir = files::addTailSlash($match[1]); 20 $this->file = $match[2]; 17 21 18 22 // Check if the gallery is private 19 $this->checkFile($ dir, $file);20 $this->checkPrivate($ dir);23 $this->checkFile($this->dir, $this->file); 24 $this->checkPrivate($this->dir); 21 25 22 26 23 $gallery = new luxBumGallery($dir); 24 $imgIndex = $gallery->getImageIndex($file); 25 $gallery->setDefaultIndex($imgIndex); 27 $GLOBALS['isSelection'] = false; 28 $this->gallery = new luxBumGallery($this->dir); 29 $imgIndex = $this->gallery->getImageIndex($this->file); 30 $this->gallery->setDefaultIndex($imgIndex); 31 32 return $this->common(); 33 } 34 35 /** 36 * 37 * @param Pluf_HTTP_Request $request 38 * @param array $match 39 */ 40 function selection($request, $match) { 41 $this->dir = files::addTailSlash($match[1]); 42 $this->file = $match[2]; 26 43 27 if (files::isPhotoFile($dir, $file)) { 28 $cFile = new luxBumImage($dir, $file); 44 // Check if the gallery is private 45 $this->checkFile($this->dir, $this->file); 46 $this->checkPrivate($this->dir); 47 48 49 $GLOBALS['isSelection'] = true; 50 $this->gallery = new LuxbumSelectionGallery(Selection::getInstance()); 51 52 if ($this->gallery->getTotalCount() == 0) { 53 return new Pluf_HTTP_Response_Redirect(Pluf::f('url_base')); 54 } 55 56 $imgIndex = $this->gallery->getImageIndex($this->file); 57 if ($imgIndex == -1) { 58 $imgIndex = 0; 59 $this->dir = $this->gallery->f()->getDir(); 60 $this->file = $this->gallery->f()->getFile(); 61 } 62 $this->gallery->setDefaultIndex($imgIndex); 63 64 return $this->common(); 65 } 66 67 private function common() { 68 if (files::isPhotoFile($this->dir, $this->file)) { 69 $cFile = new luxBumImage($this->dir, $this->file); 29 70 if (!Pluf::f('show_meta')) { 30 71 $metas = null; 31 72 } 32 73 else { 33 $cFile->metaInit();34 $metas = $cFile->getMeta();74 $cFile->metaInit(); 75 $metas = $cFile->getMeta(); 35 76 } 36 77 } 37 else if (files::isFlvFile($ dir, $file)) {38 $cFile = new LuxbumFlv($ dir, $file);78 else if (files::isFlvFile($this->dir, $this->file)) { 79 $cFile = new LuxbumFlv($this->dir, $this->file); 39 80 $metas = null; 40 81 } … … 51 92 } 52 93 53 $context = new Pluf_Template_Context(array('gallery' => $gallery, 54 'metas' => $metas, 55 'comments' => $comments, 56 'ctPost' => $ctPost, 57 'cFile' => $cFile, 58 'cfg' => $GLOBALS['_PX_config'])); 94 $context = new Pluf_Template_Context(array('gallery' => $this->gallery, 95 'metas' => $metas, 96 'isSelection' => $GLOBALS['isSelection'], 97 'comments' => $comments, 98 'ctPost' => $ctPost, 99 'cFile' => $cFile, 100 'cfg' => $GLOBALS['_PX_config'])); 59 101 60 102 $tmpl = new Pluf_Template('display.html'); trunk/index.php
r212 r216 77 77 $dispatcher->registerController('ui_public_Selection', 'downloadSelection', '#^/downloadselection/$#i'); 78 78 $dispatcher->registerController('ui_public_Gallery', 'selection', '#^/selectiong/(.*)/(.*)$#i'); 79 $dispatcher->registerController('ui_public_Display', 'selection', '#^/selectiond/(.*)/(.*)$#i'); 79 80 80 81 // Private views trunk/templates/public/photoblog/display.html
r215 r216 19 19 <h2> 20 20 <a href="{$cfg['url_index']}"><strong>{i18n 'Home'}</strong></a> 21 {NavigationMenu $gallery, '%s', ' | ', $gallery.linkGallery} | {$cFile.file} 21 {NavigationMenu $gallery, '%s', ' | ', $gallery.linkGallery} 22 {if $isSelection} 23 | <a href="{$gallery.linkConsult}">{i18n 'My selection'}</a> 24 {/if} 25 | {$cFile.file} 22 26 </h2> 23 27 … … 40 44 41 45 <div id="narrow"> 46 {if $cfg['show_selection']} 47 {if $cFile->isSelected()} 48 + <a href="{$cFile.linkUnselect}">{i18n 'Unselect file'}</a> 49 {else} 50 + <a href="{$cFile.linkSelect}">{i18n 'Select file'}</a> 51 {/if} 52 {if !$isSelection} 53 + {i18n 'Select'} <a href="{$gallery.linkSelectAll}">{i18n 'all'}</a> / <a href="{$gallery.linkUnselectAll}">{i18n 'none'}</a> 54 {/if} 55 {/if} 42 56 {if $cFile->isImage() && $cfg['show_meta']} 43 57 <div id="metaData"> trunk/templates/public/photoblog/gallery.html
r215 r216 6 6 <a href="{$cfg['url_index']}"><strong>{i18n 'Home'}</strong></a> 7 7 {NavigationMenu $gallery, '%s', ' | '} 8 {if $isSelection} 9 | {i18n 'My selection'} 10 {/if} 8 11 </h2> 9 12 trunk/templates/public/photoblog/index.html
r215 r216 57 57 </div> 58 58 59 {if $index && $cfg['show_selection'] && $selection.totalCount > 0} 60 <h2> 61 {i18n 'My selection'} 62 </h2> 63 <div class="album"> 64 <a href="{$selection.linkConsult}"><img src="{$selection.defaultImage}" alt=""/></a> 65 <div class="albumdesc"> 66 <h3><a href="{$selection.linkConsult}">{i18n 'Consult'}</a></h3> 67 <h3><a href="{$selection.linkDelete}">{i18n 'Delete'}</a></h3> 68 <h3><a href="{$selection.linkDownload}">{i18n 'Download'}</a></h3> 69 </div> 70 </div> 71 <p style="clear:both;"></p> 72 {/if} 73 59 74 {include '_footer.html'}
