aboutsummaryrefslogtreecommitdiffstats
path: root/category.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-03-17 04:13:19 +0000
committerrvelices <rv-github@modusoptimus.com>2006-03-17 04:13:19 +0000
commit97b681f1fa58e72bacff516ac51b35577181367b (patch)
treee3641755fa68efd8382c6305c2978a722881987f /category.php
parent9b521760af7639310742d7817c4fb91b88471c5c (diff)
URL rewrite for chronology: uses $page['chronology'] and
$page['chronology_date']. $page['chronology'] is an array with 'field', 'style' and 'view' keys. This is step 1. git-svn-id: http://piwigo.org/svn/trunk@1086 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--category.php67
1 files changed, 38 insertions, 29 deletions
diff --git a/category.php b/category.php
index 4aeaf0f36..437dc9749 100644
--- a/category.php
+++ b/category.php
@@ -131,26 +131,29 @@ if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0)
$icon_recent = get_icon(date('Y-m-d'));
-$calendar_view_link = duplicate_index_URL(
- array(), // nothing to redefine
- array('chronology_type', 'start') // what to remove ?
- );
-
-if (!isset($page['chronology_type']))
+if (!isset($page['chronology']))
{
- $calendar_view_link.= '/calendar-';
-
+ $chronology =
+ array(
+ 'chronology' =>
+ array(
+ 'field' => 'created',
+ 'style' => 'monthly',
+ 'view' => 'list',
+ )
+ );
$template->assign_block_vars(
'mode_created',
array(
- 'URL' => $calendar_view_link.'created'
+ 'URL' => duplicate_index_URL( $chronology, array('start') )
)
);
+ $chronology['chronology']['field'] = 'posted';
$template->assign_block_vars(
'mode_posted',
array(
- 'URL' => $calendar_view_link.'posted'
+ 'URL' => duplicate_index_URL( $chronology, array('start') )
)
);
}
@@ -159,29 +162,29 @@ else
$template->assign_block_vars(
'mode_normal',
array(
- 'URL' => $calendar_view_link
+ 'URL' => duplicate_index_URL( array(), array('chronology','start') )
)
);
- $calendar_view_link .= '/calendar-';
- if ($page['chronology_type'] == 'created')
+ $chronology = $page['chronology'];
+ if ($chronology['field'] == 'created')
{
- $template->assign_block_vars(
- 'mode_posted',
- array(
- 'URL' => $calendar_view_link.'posted'
- )
- );
+ $chronology['field'] = 'posted';
}
else
{
- $template->assign_block_vars(
- 'mode_created',
- array(
- 'URL' => $calendar_view_link.'created'
- )
- );
+ $chronology['field'] = 'created';
}
+ $url = duplicate_index_URL(
+ array(
+ 'chronology'=>$chronology
+ ),
+ array('chronology_date', 'start')
+ );
+ $template->assign_block_vars(
+ 'mode_'.$chronology['field'],
+ array('URL' => $url )
+ );
}
$template->assign_vars(
@@ -293,10 +296,16 @@ $template->assign_block_vars(
'special_cat',
array(
'URL' =>
- make_index_URL()
- .'/calendar-'
- .($conf['calendar_datefield'] == 'date_available' ? 'posted' : 'created')
- .'-monthly-c',
+ make_index_URL(
+ array(
+ 'chronology'=>
+ array(
+ 'field' => ($conf['calendar_datefield']=='date_available' ? 'posted' : 'created'),
+ 'style' => 'monthly',
+ 'view' => 'calendar'
+ )
+ )
+ ),
'TITLE' => $lang['calendar_hint'],
'NAME' => $lang['calendar']
)