Dotclear

Changeset 2684


Ignore:
Timestamp:
09/30/10 09:41:55 (12 years ago)
Author:
Tomtom33
Message:

lunarPhase 1.1-RC2 :

  • Added title for each item of previsions
  • Added comments
Location:
plugins/lunarPhase/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/lunarPhase/trunk/_define.php

    r2683 r2684  
    1717          /* Description */        'Display the moon phases', 
    1818          /* Author */             'Tomtom (http://blog.zenstyle.fr)', 
    19           /* Verion */             '1.1-RC1', 
     19          /* Verion */             '1.1-RC2', 
    2020          /* Premission */         'usage,contentadmin' 
    2121); 
  • plugins/lunarPhase/trunk/_public.php

    r2683 r2684  
    3535     Displays lunarphase widget 
    3636      
    37      @param    object    w 
    38      @return   string 
     37     @param    w    <b>dcWidget</b>     dcWidget object 
     38     @return   <b>string</b>  HTML code of widget 
    3939     */ 
    4040     public static function widget($w) 
     
    4343           
    4444          $lp = new lunarPhase(); 
    45            
    46           $ul_mask = '<ul class="%2$s">%1$s</ul>'; 
    47           $li_mask = '<li class="%2$s">%1$s</li>'; 
    4845           
    4946          if ($w->homeonly && $core->url->type != 'default') { 
     
    6461     } 
    6562      
     63     /** 
     64     Returns "live" part of lunarphase widget 
     65      
     66     @param    w    <b>dcWidget</b>     dcWidget object 
     67     @param    lp   <b>lunarPhaset</b>  lunarPhase object 
     68     @return   <b>string</b>  Live HTML part 
     69     */ 
    6670     public static function getLive($w,$lp) 
    6771     { 
     
    132136     } 
    133137      
     138     /** 
     139     Returns "previsions" part of lunarphase widget 
     140      
     141     @param    w    <b>dcWidget</b>     dcWidget object 
     142     @param    lp   <b>lunarPhaset</b>  lunarPhase object 
     143     @return   <b>string</b>  previsions HTML part 
     144     */ 
    134145     public static function getPrevisions($w,$lp) 
    135146     { 
    136147          $ul_mask = '<ul class="%2$s">%1$s</ul>'; 
    137           $li_mask = '<li class="%2$s">%1$s</li>'; 
     148          $li_mask = '<li class="%2$s" title="%3$s">%1$s</li>'; 
    138149          $res = ''; 
    139150           
    140151          if ($w->previsions) { 
    141152               foreach ($lp->getPrevisions() as $k => $v) { 
    142                     $res .= sprintf($li_mask,lunarPhasePublic::formatValue('date',$v),$k); 
     153                    $res .= sprintf($li_mask,lunarPhasePublic::formatValue('date',$v['date']),$k,$v['name']); 
    143154               } 
    144155          } 
     
    151162     } 
    152163      
     164     /** 
     165     Returns value passed in argument with a correct format 
     166      
     167     @param    type      <b>string</b>  Type of convertion 
     168     @param    value     <b>mixed</b>   Value to convert 
     169     @return   <b>mixed</b>   Converted value 
     170     */ 
    153171     public static function formatValue($type = '',$value) 
    154172     { 
  • plugins/lunarPhase/trunk/inc/class.lunarphase.php

    r2683 r2684  
    143143          $start = time() - $this->live['age'] * $ts_day; 
    144144           
    145           $this->previsions = new ArrayObject; 
    146           $this->previsions['waxing_crescent_moon'] = $start + $ts_synodic / 8; 
    147           $this->previsions['first_quarter_moon'] = $start + $ts_synodic / 4; 
    148           $this->previsions['waxing_gibbous_moon'] = $start + $ts_synodic * 3 / 8; 
    149           $this->previsions['full_moon'] = $start + $ts_synodic / 2; 
    150           $this->previsions['waning_gibbous_moon'] = $start + $ts_synodic * 5 / 8; 
    151           $this->previsions['last_quarter_moon'] = $start + $ts_synodic * 3 / 4; 
    152           $this->previsions['waning_crescent_moon'] = $start + $ts_synodic * 7 / 8; 
    153           $this->previsions['new_moon'] = $start + $ts_synodic; 
    154            
     145          $this->previsions['waxing_crescent_moon'] = array( 
     146               'name' => __('Waxing crescent moon'), 
     147               'date' => $start + $ts_synodic / 8 
     148          ); 
     149          $this->previsions['first_quarter_moon'] = array( 
     150               'name' => __('First quarter moon'), 
     151               'date' => $start + $ts_synodic / 4 
     152          ); 
     153          $this->previsions['waxing_gibbous_moon'] = array( 
     154               'name' => __('Waxing gibbous moon'), 
     155               'date' => $start + $ts_synodic * 3 / 8 
     156          ); 
     157          $this->previsions['full_moon'] = array( 
     158               'name' => __('Full moon'), 
     159               'date' => $start + $ts_synodic / 2 
     160          ); 
     161          $this->previsions['waning_gibbous_moon'] = array( 
     162               'name' => __('Waning gibbous moon'), 
     163               'date' => $start + $ts_synodic * 5 / 8 
     164          ); 
     165          $this->previsions['last_quarter_moon'] = array( 
     166               'name' => __('Last qurter moon'), 
     167               'date' => $start + $ts_synodic * 3 / 4 
     168          ); 
     169          $this->previsions['waning_crescent_moon'] = array( 
     170               'name' => __('Waning crescent moon'), 
     171               'date' => $start + $ts_synodic * 7 / 8 
     172          ); 
     173          $this->previsions['new_moon'] = array( 
     174               'name' => __('New moon'), 
     175               'date' =>$start + $ts_synodic 
     176          ); 
    155177     } 
    156178      
Note: See TracChangeset for help on using the changeset viewer.

Sites map