Changeset 3168 for trunk/include
- Timestamp:
- Mar 3, 2009, 3:05:35 AM (15 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_base.class.php
r3049 r3168 128 128 * @param array date_components 129 129 * @param array items - hash of items to put in the bar (e.g. 2005,2006) 130 * @param string class_prefix - html class attribute prefix for span elements131 130 * @param bool show_any - adds any link to the end of the bar 132 131 * @param bool show_empty - shows all labels even those without items … … 135 134 */ 136 135 function get_nav_bar_from_items($date_components, $items, 137 $ class_prefix, $show_any,136 $show_any, 138 137 $show_empty=false, $labels=null) 139 138 { … … 164 163 { 165 164 $tmp_datas=array( 166 'classname' => $class_prefix."Empty", 167 'label'=> $label 165 'LABEL'=> $label 168 166 ); 169 167 } … … 175 173 ); 176 174 $tmp_datas=array( 177 'classname' => $class_prefix, 178 'label'=> $label, 179 'url' => $url 175 'LABEL'=> $label, 176 'URL' => $url 180 177 ); 181 178 } 182 179 if ($nb_images > 0) 183 180 { 184 $tmp_datas[' nb_images']=$nb_images;181 $tmp_datas['NB_IMAGES']=$nb_images; 185 182 } 186 183 $nav_bar_datas[]=$tmp_datas; 187 184 188 185 } 189 186 … … 196 193 ); 197 194 $nav_bar_datas[]=array( 198 'label' => l10n('calendar_any'), 199 'classname' => $class_prefix, 200 'url' => $url 195 'LABEL' => l10n('calendar_any'), 196 'URL' => $url 201 197 ); 202 198 } 203 199 204 $template->set_filenames( array( 'nav_bar' => 'calendar_navbar.tpl',)); 205 $template->assign('datas', $nav_bar_datas); 206 return($template->parse('nav_bar', true)); 200 return $nav_bar_datas; 207 201 } 208 202 … … 218 212 219 213 $query = ' 220 SELECT DISTINCT('.$this->calendar_levels[$level]['sql'] 221 .') as period'; 222 $query.= $this->inner_sql; 223 $query.= $this->get_date_where($level); 224 $query.= ' 214 SELECT DISTINCT('.$this->calendar_levels[$level]['sql'].') as period, 215 COUNT(DISTINCT id) as nb_images'. 216 $this->inner_sql. 217 $this->get_date_where($level).' 225 218 GROUP BY period 226 219 ;'; 227 220 228 $level_items = array(); 229 $result = pwg_query($query); 230 while ($row = mysql_fetch_array($result)) 231 { 232 $level_items[$row['period']] = 0; 233 } 221 $level_items = simple_hash_from_query($query, 'period', 'nb_images'); 234 222 235 223 if ( count($level_items)==1 and … … 258 246 $dates, 259 247 $level_items, 260 'calItem',261 248 true, 262 249 true, … … 267 254 'chronology_navigation_bars', 268 255 array( 269 ' CONTENT' => $nav_bar,256 'items' => $nav_bar, 270 257 ) 271 258 ); … … 313 300 314 301 $tpl_var = array(); 315 302 316 303 if ( $current_rank>0 ) 317 304 { // has previous … … 326 313 ); 327 314 } 328 315 329 316 if ( $current_rank < count($upper_items)-1 ) 330 317 { // has next … … 339 326 ); 340 327 } 341 328 342 329 if ( !empty($tpl_var) ) 343 330 { -
trunk/include/calendar_monthly.class.php
r3049 r3168 258 258 259 259 $nav_bar = $this->get_nav_bar_from_items( $chronology_date, 260 $year_data['children'], 'calCal',false, false, $lang['month'] );260 $year_data['children'], false, false, $lang['month'] ); 261 261 262 262 $tpl_var['calendar_bars'][] = … … 265 265 'NB_IMAGES' => $year_data['nb_images'], 266 266 'HEAD_LABEL' => $year, 267 ' NAV_BAR' => $nav_bar,267 'items' => $nav_bar, 268 268 ); 269 269 } … … 308 308 309 309 $nav_bar = $this->get_nav_bar_from_items( $chronology_date, 310 $month_data['children'], 'calCal',false );310 $month_data['children'], false ); 311 311 312 312 $tpl_var['calendar_bars'][] = … … 315 315 'NB_IMAGES' => $month_data['nb_images'], 316 316 'HEAD_LABEL' => $lang['month'][$month], 317 ' NAV_BAR' => $nav_bar,317 'items' => $nav_bar, 318 318 ); 319 319 }
Note: See TracChangeset
for help on using the changeset viewer.