Changeset 250
- Timestamp:
- 02/07/08 19:01:33 (10 months ago)
- Files:
-
- trunk/api/ui/public/Index.php (modified) (1 diff)
- trunk/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/api/ui/public/Index.php
r209 r250 14 14 * @param Pluf_HTTP_Request $request 15 15 * @param array $match 16 * @return Pluf_Template_Context 16 17 */ 17 18 public function index($request, $match) { 18 19 if (count($match) == 1) { 20 $dir = ''; 21 $index = true; 22 } 23 else if (count($match) == 2) { 24 $dir = files::removeTailSlash($match[1]); 25 $index = false; 26 } 27 else { 28 throw new Exception("Unable to find the selected gallery"); 29 } 30 31 19 $dir = ''; 20 $index = true; 21 return $this->common($dir, $index); 22 } 23 24 /** 25 * 26 * @param Pluf_HTTP_Request $request 27 * @param array $match 28 * @return Pluf_Template_Context 29 */ 30 public function folder($request, $match) { 31 $dir = files::removeTailSlash($match[1]); 32 $index = false; 33 return $this->common($dir, $index); 34 } 35 36 /** 37 * Common function that display an index or folder page 38 * 39 * @param String $dir 40 * @param boolean $index 41 * @return Pluf_Template_Context 42 */ 43 private function common($dir, $index) { 44 32 45 // Check if the gallery is private 33 $this->checkDir($dir);46 $this->checkDir($dir); 34 47 $this->checkPrivate($dir); 35 48 36 $galleries = new luxBumIndex ($dir);49 $galleries = new luxBumIndex($dir); 37 50 $galleries->addAllGallery (); 38 51 trunk/index.php
r227 r250 63 63 // Index views 64 64 $dispatcher->registerController('ui_public_Index', 'index', '#^/$#i'); 65 $dispatcher->registerController('ui_public_Index', ' index', '#^/folder/(.*)/$#i');65 $dispatcher->registerController('ui_public_Index', 'folder', '#^/folder/(.*)/$#i'); 66 66 67 67 // View files (image & flv) … … 81 81 // Private views 82 82 $dispatcher->registerController('ui_public_Private', 'action', '#^/private/(.*)/$#i'); 83 $dispatcher->registerController('ui_public_Private', 'action', '#^/private/(.*)/(.*)$#i');84 83 85 84 // Gallery views 86 $dispatcher->registerController('ui_public_Gallery', 'view', '#^/gallery/(.*)/$#i');87 85 $dispatcher->registerController('ui_public_Gallery', 'view', '#^/gallery/(.*)/(.*)$#i'); 88 $dispatcher->registerController('ui_public_Gallery', 'view', '#^/gallery/(.+)/(.+\.flv)$#i');89 86 90 87 // File display view
