diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-03-03 01:57:39 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-03-03 01:57:39 +0000 |
commit | 2a3d5012138715952add2f69e9b3253353ea419d (patch) | |
tree | 0edda816004ca51c4781bf12517f0c95ad422eae /include/calendar_monthly.class.php | |
parent | 8f33338fed3809c2b964cbe610658b143c96b6c9 (diff) |
improvement: calendar navigation now uses at maximum one navigation bar
together with a next/previous date links
improvement: calendar view styles now shown in DIV.titrePage (I still need
to move padding from H2 to DIV.titrePage ...)
fix: moved all calendar css colors from template to the theme
git-svn-id: http://piwigo.org/svn/trunk@1062 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/calendar_monthly.class.php')
-rw-r--r-- | include/calendar_monthly.class.php | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php index 107c98634..81978f963 100644 --- a/include/calendar_monthly.class.php +++ b/include/calendar_monthly.class.php @@ -93,31 +93,33 @@ function generate_category_content($url_base, $view_type) if ( count($this->date_components)==2 ) {//case C: year+month given - display a nice month calendar $this->build_month_calendar(); - $this->build_nav_bar(CYEAR); // years - $this->build_nav_bar(CMONTH); // month + //$this->build_nav_bar(CYEAR); // years + //$this->build_nav_bar(CMONTH); // month + $this->build_next_prev(); return true; } } if ($view_type==CAL_VIEW_LIST or count($this->date_components)==3) { - if ( count($this->date_components)>=0 ) + $has_nav_bar = false; + if ( count($this->date_components)==0 ) { $this->build_nav_bar(CYEAR); // years } - if ( count($this->date_components)>=1) + if ( count($this->date_components)==1) { $this->build_nav_bar(CMONTH); // month } - if ( count($this->date_components)>=2 ) + if ( count($this->date_components)==2 ) { - $this->build_nav_bar( - CDAY, - range( 1, $this->get_all_days_in_month( - $this->date_components[CYEAR] ,$this->date_components[CMONTH] ) - ) - ); // days + $day_labels = range( 1, $this->get_all_days_in_month( + $this->date_components[CYEAR] ,$this->date_components[CMONTH] ) ); + array_unshift($day_labels, 0); + unset( $day_labels[0] ); + $this->build_nav_bar( CDAY, $day_labels ); // days } + $this->build_next_prev(); } return false; } @@ -293,11 +295,6 @@ function build_year_calendar() { // only one month exists so bail out to month view list($m) = array_keys($items); $this->date_components[CMONTH] = $m; - if (count($items[$m]['children'])==1) - { // or even to day view if everything occured in one day - list($d) = array_keys($items[$m]['children']); - $this->date_components[CDAY] = $d; - } return false; } global $lang, $template; |