Changeset 2684
- Timestamp:
- 09/30/10 09:41:55 (12 years ago)
- Location:
- plugins/lunarPhase/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/lunarPhase/trunk/_define.php
r2683 r2684 17 17 /* Description */ 'Display the moon phases', 18 18 /* Author */ 'Tomtom (http://blog.zenstyle.fr)', 19 /* Verion */ '1.1-RC 1',19 /* Verion */ '1.1-RC2', 20 20 /* Premission */ 'usage,contentadmin' 21 21 ); -
plugins/lunarPhase/trunk/_public.php
r2683 r2684 35 35 Displays lunarphase widget 36 36 37 @param object w38 @return string37 @param w <b>dcWidget</b> dcWidget object 38 @return <b>string</b> HTML code of widget 39 39 */ 40 40 public static function widget($w) … … 43 43 44 44 $lp = new lunarPhase(); 45 46 $ul_mask = '<ul class="%2$s">%1$s</ul>';47 $li_mask = '<li class="%2$s">%1$s</li>';48 45 49 46 if ($w->homeonly && $core->url->type != 'default') { … … 64 61 } 65 62 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 */ 66 70 public static function getLive($w,$lp) 67 71 { … … 132 136 } 133 137 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 */ 134 145 public static function getPrevisions($w,$lp) 135 146 { 136 147 $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>'; 138 149 $res = ''; 139 150 140 151 if ($w->previsions) { 141 152 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']); 143 154 } 144 155 } … … 151 162 } 152 163 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 */ 153 171 public static function formatValue($type = '',$value) 154 172 { -
plugins/lunarPhase/trunk/inc/class.lunarphase.php
r2683 r2684 143 143 $start = time() - $this->live['age'] * $ts_day; 144 144 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 ); 155 177 } 156 178
Note: See TracChangeset
for help on using the changeset viewer.