aboutsummaryrefslogtreecommitdiffstats
path: root/admin/history.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-05-17 22:04:36 +0000
committermistic100 <mistic@piwigo.org>2014-05-17 22:04:36 +0000
commit914b6d96d2cae67507ef848a7a229fd5319d7968 (patch)
tree97d0c9f0741ddb6ddee8cfbb20717b6b0fd9b75e /admin/history.php
parentce8a29810abe6f7fdf82043b32ca87ba0f14220c (diff)
feature 3080 : simpler date inputs (one input + fontello + picker selects)
git-svn-id: http://piwigo.org/svn/trunk@28497 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/history.php')
-rw-r--r--admin/history.php50
1 files changed, 9 insertions, 41 deletions
diff --git a/admin/history.php b/admin/history.php
index aaf0159c5..29f59b6b2 100644
--- a/admin/history.php
+++ b/admin/history.php
@@ -73,24 +73,14 @@ $search = array();
if (isset($_POST['submit']))
{
// dates
- if (!empty($_POST['start_year']))
+ if (!empty($_POST['start']))
{
- $search['fields']['date-after'] = sprintf(
- '%d-%02d-%02d',
- $_POST['start_year'],
- $_POST['start_month'],
- $_POST['start_day']
- );
+ $search['fields']['date-after'] = $_POST['start'];
}
- if (!empty($_POST['end_year']))
+ if (!empty($_POST['end']))
{
- $search['fields']['date-before'] = sprintf(
- '%d-%02d-%02d',
- $_POST['end_year'],
- $_POST['end_month'],
- $_POST['end_day']
- );
+ $search['fields']['date-before'] = $_POST['end'];
}
if (empty($_POST['types']))
@@ -551,20 +541,12 @@ if (isset($page['search']))
{
if (isset($page['search']['fields']['date-after']))
{
- $tokens = explode('-', $page['search']['fields']['date-after']);
-
- $form['start_year'] = (int)$tokens[0];
- $form['start_month'] = (int)$tokens[1];
- $form['start_day'] = (int)$tokens[2];
+ $form['start'] = $page['search']['fields']['date-after'];
}
if (isset($page['search']['fields']['date-before']))
{
- $tokens = explode('-', $page['search']['fields']['date-before']);
-
- $form['end_year'] = (int)$tokens[0];
- $form['end_month'] = (int)$tokens[1];
- $form['end_day'] = (int)$tokens[2];
+ $form['end'] = $page['search']['fields']['date-before'];
}
$form['types'] = $page['search']['fields']['types'];
@@ -588,9 +570,7 @@ else
{
// by default, at page load, we want the selected date to be the current
// date
- $form['start_year'] = $form['end_year'] = date('Y');
- $form['start_month'] = $form['end_month'] = date('n');
- $form['start_day'] = $form['end_day'] = date('j');
+ $form['start'] = $form['end'] = date('Y-n-j');
$form['types'] = $types;
// Hoverbox by default
$form['display_thumbnail'] =
@@ -598,25 +578,13 @@ else
}
-$month_list = $lang['month'];
-$month_list[0]='------------';
-ksort($month_list);
-
$template->assign(
array(
'IMAGE_ID' => @$form['image_id'],
'FILENAME' => @$form['filename'],
'IP' => @$form['ip'],
-
- 'month_list' => $month_list,
-
- 'START_DAY_SELECTED' => @$form['start_day'],
- 'START_MONTH_SELECTED' => @$form['start_month'],
- 'START_YEAR' => @$form['start_year'],
-
- 'END_DAY_SELECTED' => @$form['end_day'],
- 'END_MONTH_SELECTED' => @$form['end_month'],
- 'END_YEAR' => @$form['end_year'],
+ 'START' => @$form['start'],
+ 'END' => @$form['end'],
)
);