Luxbum.net - Script de galerie photo

Changeset 263

Show
Ignore:
Timestamp:
02/11/08 21:53:56 (9 months ago)
Author:
nicolas
Message:

utilisation des modifiers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/trunk-newurl/api/process/commongallery.php

    r259 r263  
    1010    protected $name; 
    1111    protected $preview; 
    12     
     12 
    1313    protected $flvCount = 0; 
    1414    protected $imageCount = 0; 
    1515    protected $totalCount = 0; 
    16     
     16 
    1717    protected $flvSize = 0; 
    1818    protected $imageSize = 0; 
    1919    protected $totalSize = 0; 
    2020 
    21     
     21 
    2222    /** 
    2323     * Set the gallery name 
     
    3434    function getName() { 
    3535        return $this->name; 
    36     } 
    37  
    38     /** 
    39      * Retourne le "beau" nom de la galerie 
    40      * @return String Beau nom de la galerie 
    41      */ 
    42     function getNiceName() { 
    43         return luxbum::niceName($this->name); 
    4436    } 
    4537 
     
    7769 
    7870    /** 
    79      * Retourne la taille affichable des photos de la galerie 
    80      * @return int Taille affichable des photos de la galerie 
    81      */ 
    82     function getImageNiceSize() { 
    83         return luxbum::niceSize($this->imageSize); 
    84     } 
    85  
    86     /** 
    87      * Retourne la taille affichable des photos de la galerie 
    88      * @return int Taille affichable des photos de la galerie 
    89      */ 
    90     function getFlvNiceSize() { 
    91         return luxbum::niceSize($this->flvSize); 
    92     } 
    93  
    94     /** 
    95      * Retourne la taille affichable des photos de la galerie 
    96      * @return int Taille affichable des photos de la galerie 
    97      */ 
    98     function getTotalNiceSize() { 
    99         return luxbum::niceSize($this->totalSize); 
    100     } 
    101  
    102     /** 
    10371     * Retourne le nombre de photos de la galerie 
    10472     * @return int Nombre de photos de la galerie 
     
    13199        $this->sortPosition = $sortPosition; 
    132100    } 
    133     
     101 
    134102    /** 
    135103     * Retourne la position de la galerie dans l'index 
     
    139107        return $this->sortPosition; 
    140108    } 
    141     
     109 
    142110    /** 
    143111     * Retourne la position d'une image $imgName dans la galerie 
     
    166134    } 
    167135 
     136    /** 
     137     * 
     138     * @return String 
     139     */ 
    168140    public function getFile() { 
    169141        return $this->f()->getFile(); 
    170142    } 
    171143 
     144    /** 
     145     * 
     146     * @return String 
     147     */ 
    172148    public function getPreviousFile() { 
    173149        $this->move($this->getDefaultIndex()); 
     
    175151        return $this->f()->getFile(); 
    176152    } 
    177     
    178     public function getNetFile() { 
     153 
     154    /** 
     155     * 
     156     * @return String 
     157     */ 
     158    public function getNextFile() { 
    179159        $this->move($this->getDefaultIndex()); 
    180160        $this->moveNext(); 
     
    182162    } 
    183163 
    184     
     164 
    185165    /**-----------------------------------------------------------------------**/ 
    186166    /** UI Functions */ 
    187167    /**-----------------------------------------------------------------------**/ 
    188168 
    189     /** 
    190      * Return the link to the script that generates the index image. 
    191      * @return String Link to the script that generates the index image 
    192      */ 
    193     protected function getIndexLink() { 
    194  
    195         $this->_completeDefaultImage();       
    196  
    197         // La galerie contient des photos 
    198         return Pluf::f('url_base').Pluf_HTTP_URL_urlForView("ui_public_FileDownload::image", array('index',$this->dir, $this->preview)); 
    199     } 
    200     
    201169    /** 
    202170     * 
     
    221189 
    222190        // 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)); 
    224193    } 
    225194  } 
  • branches/trunk-newurl/api/process/luxbum.php

    r256 r263  
    1010   */ 
    1111class luxBum { 
    12  
    13     /**-----------------------------------------------------------------------**/ 
    14     /* Fonctions utilitaires */ 
    15     /**-----------------------------------------------------------------------**/ 
    16  
    17     /** 
    18      * @TODO: create a Pluf tag 
    19      * Show a size in byte in a nice way 
    20      */ 
    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 tag 
    49      *  
    50      */ 
    51     function niceName ($name) { 
    52         $pattern = array ('_', '-'); 
    53         $repl = array (' ', ' '); 
    54         return str_replace ($pattern, $repl, $name); 
    55     } 
    56  
    57  
    5812    /**-----------------------------------------------------------------------**/ 
    5913    /* Functions for directories name */ 
  • branches/trunk-newurl/api/ui/views_manager/gallery.php

    r189 r263  
    2525      $galleryCount = $res->getTotalCount (); 
    2626       
    27       $niceDir = ucfirst (luxBum::niceName ($res->getName())); 
     27      $niceDir = ucfirst(Pluf_Template_Modifier_niceName($res->getName())); 
    2828      $GLOBALS['LB']['title'] =  $niceDir.' - '.NOM_GALERIE; 
    2929      $res->createOrMajDescriptionFile (); 
  • branches/trunk-newurl/templates/public/luxbum/index.html

    r253 r263  
    3535      </div> 
    3636      <div class="ld"> 
    37         <h2>{$gallery.niceName}</h2> 
     37        <h2>{$gallery.name|niceName}</h2> 
    3838         
    3939        {if $gallery.totalCount > 0 && !$gallery->isPrivateAndLocked()} 
    4040        <span class="infos"> 
    4141          {if $gallery.imageCount > 0} 
    42           {$gallery.imageCount} {trans ' pictures - '} {$gallery.imageNiceSize} 
     42          {$gallery.imageCount} {trans ' pictures - '} {$gallery.imageSize|nicesize} 
    4343          {/if} 
    4444          {if $gallery.flvCount > 0} 
    4545          {if $gallery.imageCount > 0} <br/>{/if} 
    46           {$gallery.flvCount} {trans ' videos - '} {$gallery.flvNiceSize} 
     46          {$gallery.flvCount} {trans ' videos - '} {$gallery.flvSize|nicesize} 
    4747          {/if} 
    4848        </span> 
  • branches/trunk-newurl/templates/public/photoblog/index.html

    r253 r263  
    3333      {else} 
    3434        {if $gallery.totalCount > 0} 
    35           <h3><a href="{$gallery.linkConsult}">{$gallery.niceName}</a></h3> 
     35          <h3><a href="{$gallery.linkConsult}">{$gallery.name|nicename}</a></h3> 
    3636        {/if} 
    3737         
    3838        {if $gallery->hasSubGallery()} 
    3939          {if $gallery.totalCount == 0} 
    40             <h3><a href="{$gallery.linkSubGallery}">{$gallery.niceName}</a></h3> 
     40            <h3><a href="{$gallery.linkSubGallery}">{$gallery.name|nicename}</a></h3> 
    4141          {/if} 
    4242        {/if}