diff options
author | mistic100 <mistic@piwigo.org> | 2014-05-17 22:04:36 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-05-17 22:04:36 +0000 |
commit | 914b6d96d2cae67507ef848a7a229fd5319d7968 (patch) | |
tree | 97d0c9f0741ddb6ddee8cfbb20717b6b0fd9b75e /admin/picture_modify.php | |
parent | ce8a29810abe6f7fdf82043b32ca87ba0f14220c (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/picture_modify.php')
-rw-r--r-- | admin/picture_modify.php | 53 |
1 files changed, 8 insertions, 45 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php index dc7d56211..d476c560f 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -108,23 +108,7 @@ if (isset($_GET['sync_metadata'])) } //--------------------------------------------------------- update informations - -// first, we verify whether there is a mistake on the given creation date -if (isset($_POST['date_creation_action']) - and 'set' == $_POST['date_creation_action']) -{ - if (!is_numeric($_POST['date_creation_year']) - or !checkdate( - $_POST['date_creation_month'], - $_POST['date_creation_day'], - $_POST['date_creation_year']) - ) - { - $page['errors'][] = l10n('wrong date'); - } -} - -if (isset($_POST['submit']) and count($page['errors']) == 0) +if (isset($_POST['submit'])) { $data = array(); $data['id'] = $_GET['image_id']; @@ -141,13 +125,9 @@ if (isset($_POST['submit']) and count($page['errors']) == 0) $data['comment'] = strip_tags(@$_POST['description']); } - if (!empty($_POST['date_creation_year'])) + if (!empty($_POST['date_creation'])) { - $data['date_creation'] = - $_POST['date_creation_year'] - .'-'.$_POST['date_creation_month'] - .'-'.$_POST['date_creation_day'] - .' '.$_POST['date_creation_time']; + $data['date_creation'] = $_POST['date_creation'].' '.$_POST['date_creation_time']; } else { @@ -339,37 +319,20 @@ $template->assign( // creation date unset($day, $month, $year); -if (isset($_POST['date_creation_action']) - and 'set' == $_POST['date_creation_action']) +if (!empty($row['date_creation'])) { - foreach (array('day', 'month', 'year', 'time') as $varname) - { - $$varname = $_POST['date_creation_'.$varname]; - } -} -else if (isset($row['date_creation']) and !empty($row['date_creation'])) -{ - list($year, $month, $day) = explode('-', substr($row['date_creation'],0,10)); - $time = substr($row['date_creation'],11); + list($date, $time) = explode(' ', $row['date_creation']); } else { - list($year, $month, $day) = array('', 0, 0); + $date = ''; $time = '00:00:00'; } - -$month_list = $lang['month']; -$month_list[0]='------------'; -ksort($month_list); - $template->assign( array( - 'DATE_CREATION_DAY_VALUE' => (int)$day, - 'DATE_CREATION_MONTH_VALUE' => (int)$month, - 'DATE_CREATION_YEAR_VALUE' => $year, - 'DATE_CREATION_TIME_VALUE' => $time, - 'month_list' => $month_list, + 'DATE_CREATION' => $date, + 'DATE_CREATION_TIME' => $time, ) ); |