Changeset 263
- Timestamp:
- 02/11/08 21:53:56 (9 months ago)
- Files:
-
- branches/trunk-newurl/api/process/commongallery.php (modified) (9 diffs)
- branches/trunk-newurl/api/process/luxbum.php (modified) (1 diff)
- branches/trunk-newurl/api/ui/views_manager/gallery.php (modified) (1 diff)
- branches/trunk-newurl/templates/public/luxbum/index.html (modified) (1 diff)
- branches/trunk-newurl/templates/public/photoblog/index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/trunk-newurl/api/process/commongallery.php
r259 r263 10 10 protected $name; 11 11 protected $preview; 12 12 13 13 protected $flvCount = 0; 14 14 protected $imageCount = 0; 15 15 protected $totalCount = 0; 16 16 17 17 protected $flvSize = 0; 18 18 protected $imageSize = 0; 19 19 protected $totalSize = 0; 20 20 21 21 22 22 /** 23 23 * Set the gallery name … … 34 34 function getName() { 35 35 return $this->name; 36 }37 38 /**39 * Retourne le "beau" nom de la galerie40 * @return String Beau nom de la galerie41 */42 function getNiceName() {43 return luxbum::niceName($this->name);44 36 } 45 37 … … 77 69 78 70 /** 79 * Retourne la taille affichable des photos de la galerie80 * @return int Taille affichable des photos de la galerie81 */82 function getImageNiceSize() {83 return luxbum::niceSize($this->imageSize);84 }85 86 /**87 * Retourne la taille affichable des photos de la galerie88 * @return int Taille affichable des photos de la galerie89 */90 function getFlvNiceSize() {91 return luxbum::niceSize($this->flvSize);92 }93 94 /**95 * Retourne la taille affichable des photos de la galerie96 * @return int Taille affichable des photos de la galerie97 */98 function getTotalNiceSize() {99 return luxbum::niceSize($this->totalSize);100 }101 102 /**103 71 * Retourne le nombre de photos de la galerie 104 72 * @return int Nombre de photos de la galerie … … 131 99 $this->sortPosition = $sortPosition; 132 100 } 133 101 134 102 /** 135 103 * Retourne la position de la galerie dans l'index … … 139 107 return $this->sortPosition; 140 108 } 141 109 142 110 /** 143 111 * Retourne la position d'une image $imgName dans la galerie … … 166 134 } 167 135 136 /** 137 * 138 * @return String 139 */ 168 140 public function getFile() { 169 141 return $this->f()->getFile(); 170 142 } 171 143 144 /** 145 * 146 * @return String 147 */ 172 148 public function getPreviousFile() { 173 149 $this->move($this->getDefaultIndex()); … … 175 151 return $this->f()->getFile(); 176 152 } 177 178 public function getNetFile() { 153 154 /** 155 * 156 * @return String 157 */ 158 public function getNextFile() { 179 159 $this->move($this->getDefaultIndex()); 180 160 $this->moveNext(); … … 182 162 } 183 163 184 164 185 165 /**-----------------------------------------------------------------------**/ 186 166 /** UI Functions */ 187 167 /**-----------------------------------------------------------------------**/ 188 168 189 /**190 * Return the link to the script that generates the index image.191 * @return String Link to the script that generates the index image192 */193 protected function getIndexLink() {194 195 $this->_completeDefaultImage();196 197 // La galerie contient des photos198 return Pluf::f('url_base').Pluf_HTTP_URL_urlForView("ui_public_FileDownload::image", array('index',$this->dir, $this->preview));199 }200 201 169 /** 202 170 * … … 221 189 222 190 // default gallery image 223 return $this->getIndexLink(); 191 $this->_completeDefaultImage(); 192 return Pluf::f('url_base').Pluf_HTTP_URL_urlForView("ui_public_FileDownload::image", array('index', $this->dir, $this->preview)); 224 193 } 225 194 } branches/trunk-newurl/api/process/luxbum.php
r256 r263 10 10 */ 11 11 class luxBum { 12 13 /**-----------------------------------------------------------------------**/14 /* Fonctions utilitaires */15 /**-----------------------------------------------------------------------**/16 17 /**18 * @TODO: create a Pluf tag19 * Show a size in byte in a nice way20 */21 function niceSize ($size) {22 if ($size >= 1073741824) {23 $size = (round ($size / 1073741824 * 100) / 100).' Go';24 }25 26 elseif ($size >= 1048576) {27 $size = (round ($size / 1048576 * 100) / 100).' Mo';28 }29 30 elseif ($size >= 1024) {31 $size = (round ($size / 1024 * 100) / 100).' Ko';32 }33 34 else {35 $size = $size.' octets';36 }37 38 if ($size == 0) {39 $size = '0 Ko';40 }41 //sprintf('%01.2f', $size/$mb)42 43 return $size;44 }45 46 47 /**48 * @TODO: create a Pluf tag49 *50 */51 function niceName ($name) {52 $pattern = array ('_', '-');53 $repl = array (' ', ' ');54 return str_replace ($pattern, $repl, $name);55 }56 57 58 12 /**-----------------------------------------------------------------------**/ 59 13 /* Functions for directories name */ branches/trunk-newurl/api/ui/views_manager/gallery.php
r189 r263 25 25 $galleryCount = $res->getTotalCount (); 26 26 27 $niceDir = ucfirst (luxBum::niceName($res->getName()));27 $niceDir = ucfirst(Pluf_Template_Modifier_niceName($res->getName())); 28 28 $GLOBALS['LB']['title'] = $niceDir.' - '.NOM_GALERIE; 29 29 $res->createOrMajDescriptionFile (); branches/trunk-newurl/templates/public/luxbum/index.html
r253 r263 35 35 </div> 36 36 <div class="ld"> 37 <h2>{$gallery.n iceName}</h2>37 <h2>{$gallery.name|niceName}</h2> 38 38 39 39 {if $gallery.totalCount > 0 && !$gallery->isPrivateAndLocked()} 40 40 <span class="infos"> 41 41 {if $gallery.imageCount > 0} 42 {$gallery.imageCount} {trans ' pictures - '} {$gallery.image NiceSize}42 {$gallery.imageCount} {trans ' pictures - '} {$gallery.imageSize|nicesize} 43 43 {/if} 44 44 {if $gallery.flvCount > 0} 45 45 {if $gallery.imageCount > 0} <br/>{/if} 46 {$gallery.flvCount} {trans ' videos - '} {$gallery.flv NiceSize}46 {$gallery.flvCount} {trans ' videos - '} {$gallery.flvSize|nicesize} 47 47 {/if} 48 48 </span> branches/trunk-newurl/templates/public/photoblog/index.html
r253 r263 33 33 {else} 34 34 {if $gallery.totalCount > 0} 35 <h3><a href="{$gallery.linkConsult}">{$gallery.n iceName}</a></h3>35 <h3><a href="{$gallery.linkConsult}">{$gallery.name|nicename}</a></h3> 36 36 {/if} 37 37 38 38 {if $gallery->hasSubGallery()} 39 39 {if $gallery.totalCount == 0} 40 <h3><a href="{$gallery.linkSubGallery}">{$gallery.n iceName}</a></h3>40 <h3><a href="{$gallery.linkSubGallery}">{$gallery.name|nicename}</a></h3> 41 41 {/if} 42 42 {/if}
