diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-02-20 04:39:37 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-02-20 04:39:37 +0000 |
commit | d62ce7376079a7435317fc843eb04f3927e4adad (patch) | |
tree | f0c689b50fa7107cdb280b21e1e9309b835ee802 /category.php | |
parent | 08b63815640b2fc8059c243a4f9feaf865801a25 (diff) |
calendar redesign: step 1
git-svn-id: http://piwigo.org/svn/trunk@1047 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | category.php | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/category.php b/category.php index 0f0a370b5..d8e93d1d5 100644 --- a/category.php +++ b/category.php @@ -77,25 +77,37 @@ if (isset($page['cat']) and is_numeric($page['cat'])) check_restrictions($page['cat']); } -if (isset($page['cat']) +if ( isset($page['cat_nb_images']) and $page['cat_nb_images'] > $user['nb_image_page']) { // $nav_url is used to create the navigation bar - $nav_url = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat']; + $nav_url = PHPWG_ROOT_PATH.'category.php?'; + if ( isset($page['cat']) ) + { + $nav_url .= 'cat='.$page['cat'].'&'; + } switch ($page['cat']) { case 'search': { - $nav_url.= '&search='.$_GET['search']; + $nav_url.= 'search='.$_GET['search'].'&'; break; } case 'list': { - $nav_url.= '&list='.$_GET['list']; + $nav_url.= 'list='.$_GET['list'].'&'; break; } } + if ( isset($_GET['calendar']) ) + { + $nav_url.= 'calendar='.$_GET['calendar']; + } + else + { + $nav_url = preg_replace('/&$/', '', $nav_url); + } $page['navigation_bar'] = create_navigation_bar( $nav_url, @@ -144,6 +156,13 @@ if ( isset( $page['cat_nb_images'] ) and $page['cat_nb_images'] > 0 ) $icon_recent = get_icon(date('Y-m-d')); +$calendar_view_link = PHPWG_ROOT_PATH.'category.php' + .get_query_string_diff(array('start','calendar')); +if ( ! isset($_GET['calendar']) ) +{ + $calendar_view_link .= (empty($_GET)? '?':'&' ) . 'calendar='; +} + $template->assign_vars( array( 'NB_PICTURE' => count_user_total_images(), @@ -180,7 +199,8 @@ $template->assign_vars( 'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php', 'U_LOGOUT' => PHPWG_ROOT_PATH.'category.php?act=logout', 'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php', - 'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php' + 'U_PROFILE'=> PHPWG_ROOT_PATH.'profile.php', + 'U_CALENDAR' => $calendar_view_link ) ); @@ -352,8 +372,24 @@ if (isset($page['cat']) } //------------------------------------------------------ main part : thumbnails -include(PHPWG_ROOT_PATH.$page['thumbnails_include']); +if ( isset($page['thumbnails_include']) ) +{ + include(PHPWG_ROOT_PATH.$page['thumbnails_include']); +} //------------------------------------------------------- category informations +if ( $page['navigation_bar'] != '' + or ( isset( $page['comment'] ) and $page['comment'] != '' ) ) +{ + $template->assign_block_vars('cat_infos',array()); +} +// navigation bar +if ( $page['navigation_bar'] != '' ) +{ + $template->assign_block_vars( + 'cat_infos.navigation', + array('NAV_BAR' => $page['navigation_bar']) + ); +} if ( isset ( $page['cat'] ) ) { // upload a picture in the category @@ -368,21 +404,6 @@ if ( isset ( $page['cat'] ) ) array('U_UPLOAD'=> $url ) ); } - - if ( $page['navigation_bar'] != '' - or ( isset( $page['comment'] ) and $page['comment'] != '' ) ) - { - $template->assign_block_vars('cat_infos',array()); - } - - // navigation bar - if ( $page['navigation_bar'] != '' ) - { - $template->assign_block_vars( - 'cat_infos.navigation', - array('NAV_BAR' => $page['navigation_bar']) - ); - } // category comment if ( isset( $page['comment'] ) and $page['comment'] != '' ) { |