Changeset 1047


Ignore:
Timestamp:
Feb 20, 2006, 5:39:37 AM (18 years ago)
Author:
rvelices
Message:

calendar redesign: step 1

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/category.php

    r1036 r1047  
    7878}
    7979
    80 if (isset($page['cat'])
     80if ( isset($page['cat_nb_images'])
    8181    and $page['cat_nb_images'] > $user['nb_image_page'])
    8282{
    8383  // $nav_url is used to create the navigation bar
    84   $nav_url = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat'];
     84  $nav_url = PHPWG_ROOT_PATH.'category.php?';
     85  if ( isset($page['cat']) )
     86  {
     87    $nav_url .= 'cat='.$page['cat'].'&';
     88  }
    8589
    8690  switch ($page['cat'])
     
    8892    case 'search':
    8993    {
    90       $nav_url.= '&search='.$_GET['search'];
     94      $nav_url.= 'search='.$_GET['search'].'&';
    9195      break;
    9296    }
    9397    case 'list':
    9498    {
    95       $nav_url.= '&list='.$_GET['list'];
     99      $nav_url.= 'list='.$_GET['list'].'&';
    96100      break;
    97101    }
     102  }
     103  if ( isset($_GET['calendar']) )
     104  {
     105    $nav_url.= 'calendar='.$_GET['calendar'];
     106  }
     107  else
     108  {
     109    $nav_url = preg_replace('/&$/', '', $nav_url);
    98110  }
    99111 
     
    144156
    145157$icon_recent = get_icon(date('Y-m-d'));
     158
     159$calendar_view_link = PHPWG_ROOT_PATH.'category.php'
     160                        .get_query_string_diff(array('start','calendar'));
     161if ( ! isset($_GET['calendar']) )
     162{
     163  $calendar_view_link .= (empty($_GET)? '?':'&' ) . 'calendar=';
     164}
    146165
    147166$template->assign_vars(
     
    181200  'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout',
    182201  'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
    183   'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php'
     202  'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php',
     203  'U_CALENDAR' => $calendar_view_link
    184204  )
    185205);
     
    353373
    354374//------------------------------------------------------ main part : thumbnails
    355 include(PHPWG_ROOT_PATH.$page['thumbnails_include']);
     375if ( isset($page['thumbnails_include']) )
     376{
     377  include(PHPWG_ROOT_PATH.$page['thumbnails_include']);
     378}
    356379//------------------------------------------------------- category informations
     380if ( $page['navigation_bar'] != ''
     381     or ( isset( $page['comment'] ) and $page['comment'] != '' ) )
     382{
     383  $template->assign_block_vars('cat_infos',array());
     384}
     385// navigation bar
     386if ( $page['navigation_bar'] != '' )
     387{
     388  $template->assign_block_vars(
     389    'cat_infos.navigation',
     390    array('NAV_BAR' => $page['navigation_bar'])
     391    );
     392}
    357393if ( isset ( $page['cat'] ) )
    358394{
     
    367403      'upload',
    368404      array('U_UPLOAD'=> $url )
    369       );
    370   }
    371 
    372   if ( $page['navigation_bar'] != ''
    373        or ( isset( $page['comment'] ) and $page['comment'] != '' ) )
    374   {
    375     $template->assign_block_vars('cat_infos',array());
    376   }
    377  
    378   // navigation bar
    379   if ( $page['navigation_bar'] != '' )
    380   {
    381     $template->assign_block_vars(
    382       'cat_infos.navigation',
    383       array('NAV_BAR' => $page['navigation_bar'])
    384405      );
    385406  }
  • trunk/include/category_default.inc.php

    r1036 r1047  
    8181  }
    8282  // url link on picture.php page
    83   $url_link = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'];
    84   $url_link.= '&image_id='.$row['id'];
     83  $url_link = PHPWG_ROOT_PATH.'picture.php?';
     84  if ( isset($page['cat']) )
     85  {
     86    $url_link .= 'cat='.$page['cat'].'&';
     87  }
     88  $url_link.= 'image_id='.$row['id'];
    8589  if ($page['cat'] == 'search')
    8690  {
     
    9094  {
    9195    $url_link.= '&list='.$_GET['list'];
     96  }
     97  if ( isset($_GET['calendar']) )
     98  {
     99    $url_link.= '&calendar='.$_GET['calendar'];
    92100  }
    93101   
  • trunk/include/section_init.inc.php

    r1041 r1047  
    9494}
    9595
     96// $page['nb_image_page'] is the number of picture to display on this page
     97// By default, it is the same as the $user['nb_image_page']
     98$page['nb_image_page'] = $user['nb_image_page'];
    9699
    97100if (isset($page['cat']))
    98101{
    99   // $page['nb_image_page'] is the number of picture to display on this page
    100   // By default, it is the same as the $user['nb_image_page']
    101   $page['nb_image_page'] = $user['nb_image_page'];
    102 
    103102  if ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated')
    104103  {
     
    398397  $page['thumbnails_include'] = 'include/category_subcats.inc.php';
    399398}
     399
     400if ( isset($_GET['calendar']) )
     401{
     402  include_once( PHPWG_ROOT_PATH.'include/functions_calendar.inc.php' );
     403  initialize_calendar();
     404}
     405
    400406?>
  • trunk/template/yoga/category.tpl

    r1031 r1047  
    131131      </li>
    132132      <!-- END preferred_image_order -->
     133      <a href="{U_CALENDAR}">Toggle calendar</a>
    133134    </ul>
    134135   
     
    140141<div class="navigationBar">{calendar.YEARS_NAV_BAR}</div>
    141142<div class="navigationBar">{calendar.MONTHS_NAV_BAR}</div>
     143<!-- END calendar -->
     144
     145<!-- BEGIN calendar -->
     146<!-- BEGIN navbar -->
     147<div class="navigationBar">{calendar.navbar.BAR}</div>
     148<!-- END navbar -->
    142149<!-- END calendar -->
    143150
Note: See TracChangeset for help on using the changeset viewer.