Ignore:
Timestamp:
Mar 3, 2006, 2:57:39 AM (18 years ago)
Author:
rvelices
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/calendar_monthly.class.php

    r1061 r1062  
    9494    {//case C: year+month given - display a nice month calendar
    9595      $this->build_month_calendar();
     96      //$this->build_nav_bar(CYEAR); // years
     97      //$this->build_nav_bar(CMONTH); // month
     98      $this->build_next_prev();
     99      return true;
     100    }
     101  }
     102
     103  if ($view_type==CAL_VIEW_LIST or count($this->date_components)==3)
     104  {
     105    $has_nav_bar = false;
     106    if ( count($this->date_components)==0 )
     107    {
    96108      $this->build_nav_bar(CYEAR); // years
     109    }
     110    if ( count($this->date_components)==1)
     111    {
    97112      $this->build_nav_bar(CMONTH); // month
    98       return true;
    99     }
    100   }
    101 
    102   if ($view_type==CAL_VIEW_LIST or count($this->date_components)==3)
    103   {
    104     if ( count($this->date_components)>=0 )
    105     {
    106       $this->build_nav_bar(CYEAR); // years
    107     }
    108     if ( count($this->date_components)>=1)
    109     {
    110       $this->build_nav_bar(CMONTH); // month
    111     }
    112     if ( count($this->date_components)>=2 )
    113     {
    114       $this->build_nav_bar(
    115           CDAY,
    116           range( 1, $this->get_all_days_in_month(
    117               $this->date_components[CYEAR] ,$this->date_components[CMONTH] )
    118               )
    119         ); // days
    120     }
     113    }
     114    if ( count($this->date_components)==2 )
     115    {
     116      $day_labels = range( 1, $this->get_all_days_in_month(
     117              $this->date_components[CYEAR] ,$this->date_components[CMONTH] ) );
     118      array_unshift($day_labels, 0);
     119      unset( $day_labels[0] );
     120      $this->build_nav_bar( CDAY, $day_labels ); // days
     121    }
     122    $this->build_next_prev();
    121123  }
    122124  return false;
     
    294296    list($m) = array_keys($items);
    295297    $this->date_components[CMONTH] = $m;
    296     if (count($items[$m]['children'])==1)
    297     { // or even to day view if everything occured in one day
    298       list($d) = array_keys($items[$m]['children']);
    299       $this->date_components[CDAY] = $d;
    300     }
    301298    return false;
    302299  }
Note: See TracChangeset for help on using the changeset viewer.