aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-13 00:05:16 +0000
committerrub <rub@piwigo.org>2006-12-13 00:05:16 +0000
commit5046b3c2105bdfae23d6835c110606ea9e7ff055 (patch)
treea6b497463d1b83edfe7f53d90d356765a5d4d0fd /index.php
parent5e9a4b02be26994e7d49a7d1ece7595a50b28c4b (diff)
Feature Issue ID 0000601: Filter all public pages with only recent elements
Last draft before final development. There a icon for global mode and one other for local mode. Counters are not good, filter on images are not everywhere applied, moment to update cache are not optimized, ... Go to http://forum.phpwebgallery.net/viewtopic.php?id=9490 git-svn-id: http://piwigo.org/svn/trunk@1651 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'index.php')
-rw-r--r--index.php51
1 files changed, 42 insertions, 9 deletions
diff --git a/index.php b/index.php
index e6a184c5f..a7a05b60d 100644
--- a/index.php
+++ b/index.php
@@ -106,31 +106,64 @@ if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0)
$template_title.= ' ['.$page['cat_nb_images'].']';
}
-if (isset($_GET['filter_mode']))
+if (isset($_GET['filter_local_mode']))
{
- $page['filter_mode'] = ($_GET['filter_mode'] == 'start');
- pwg_set_session_var('filter_mode', $page['filter_mode']);
+ $page['filter_local_mode'] = ($_GET['filter_local_mode'] == 'start');
}
else
{
- $page['filter_mode'] = pwg_get_session_var('filter_mode', false);
+ $page['filter_local_mode'] = pwg_get_session_var('filter_local_mode', false);
}
-if ($page['filter_mode'])
+$page['filter_local_mode'] = (($page['filter_local_mode']) and
+ ($page['section'] == 'categories') and
+ (!isset($page['chronology_field'])));
+pwg_set_session_var('filter_local_mode', $page['filter_local_mode']);
+
+if ($page['filter_local_mode'])
+{
+ $template->assign_block_vars(
+ 'stop_filter_local_mode',
+ array(
+ 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_local_mode' => 'stop'))
+ )
+ );
+}
+else
+{
+ $template->assign_block_vars(
+ 'start_filter_local_mode',
+ array(
+ 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_local_mode' => 'start'))
+ )
+ );
+}
+
+if (isset($_GET['filter_global_mode']))
+{
+ $user['filter_global_mode'] = ($_GET['filter_global_mode'] == 'start');
+ pwg_set_session_var('filter_global_mode', $user['filter_global_mode']);
+}
+else
+{
+ $user['filter_global_mode'] = pwg_get_session_var('filter_global_mode', false);
+}
+
+if ($user['filter_global_mode'])
{
$template->assign_block_vars(
- 'stop_filter_mode',
+ 'stop_filter_global_mode',
array(
- 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_mode' => 'stop'))
+ 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_global_mode' => 'stop'))
)
);
}
else
{
$template->assign_block_vars(
- 'start_filter_mode',
+ 'start_filter_global_mode',
array(
- 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_mode' => 'start'))
+ 'URL' => add_url_params(duplicate_index_url(array(), array('start')), array('filter_global_mode' => 'start'))
)
);
}