From 754d2899b3ba292f927b361e3a76e994c5931e6e Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Wed, 23 Sep 2009 12:57:10 +0000 Subject: [PATCH] various changes in how dates are handled in config panels. added a new lang string. added a new fp_config field, new blogs will need a reinstall or customizing by hand the option panel --- admin/panels/config/admin.config.php | 2 ++ admin/panels/config/admin.config.tpl | 7 +++++++ admin/panels/entry/admin.entry.list.tpl | 2 +- fp-defaults/settings-defaults.php | 1 + fp-interface/lang/en-us/lang.admin.config.php | 1 + fp-interface/themes/leggero/preview.tpl | 2 +- fp-interface/themes/leggero/previewstatic.tpl | 2 +- 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/admin/panels/config/admin.config.php b/admin/panels/config/admin.config.php index e6ec721..8abc1e6 100755 --- a/admin/panels/config/admin.config.php +++ b/admin/panels/config/admin.config.php @@ -20,6 +20,7 @@ array('timeoffset', 'timeoffset', 'isNumber', false, false, 'trim'), array('timeformat', 'timeformat', 'notEmpty', false, false, 'trim'), array('dateformat', 'dateformat', 'notEmpty', false, false, 'trim'), + array('dateformatshort', 'dateformatshort', 'notEmpty', false, false, 'trim'), array('lang', 'lang', 'notEmpty', false, false, 'trim'), array('charset', 'charset', 'notEmpty', false, false, 'trim'), @@ -73,6 +74,7 @@ 'timeoffset' => $_POST['timeoffset'], 'timeformat' => $_POST['timeformat'], 'dateformat' => $_POST['dateformat'], + 'dateformatshort' => $_POST['dateformatshort'], 'charset' => $_POST['charset'], 'lang' => $_POST['lang'] ); diff --git a/admin/panels/config/admin.config.tpl b/admin/panels/config/admin.config.tpl index c5920fa..2bdffb7 100755 --- a/admin/panels/config/admin.config.tpl +++ b/admin/panels/config/admin.config.tpl @@ -103,6 +103,13 @@

{$panelstrings.output}: {$smarty.now|date_format:$fp_config.locale.dateformat}

+
+

+

{$panelstrings.output}: {$smarty.now|date_format:$fp_config.locale.dateformatshort}

+
+

{entry} -{$id|entry_idtotime|date_format:"%D, %T"} +{$id|entry_idtotime|date_format:"`$fp_config.locale.dateformatshort`, `$fp_config.locale.timeformat`"} {if in_array('draft',$categories)} ({$lang.entry.flags.short.draft}) diff --git a/fp-defaults/settings-defaults.php b/fp-defaults/settings-defaults.php index 1f8b6c7..12f50a0 100755 --- a/fp-defaults/settings-defaults.php +++ b/fp-defaults/settings-defaults.php @@ -22,6 +22,7 @@ $fp_config = array ( 'timeoffset' => '2', 'timeformat' => '%H:%M:%S', 'dateformat' => '%A, %B %e, %Y', + 'dateformatshort' => '%Y-%m-%d', 'charset' => 'utf-8', 'lang' => 'en-us', ), diff --git a/fp-interface/lang/en-us/lang.admin.config.php b/fp-interface/lang/en-us/lang.admin.config.php index e33a79b..847bf01 100755 --- a/fp-interface/lang/en-us/lang.admin.config.php +++ b/fp-interface/lang/en-us/lang.admin.config.php @@ -39,6 +39,7 @@ 'hours' => 'hours', 'timeformat' => 'Default format for time', 'dateformat' => 'Default format for date', + 'dateformatshort' => 'Default format for date (short)', 'output' => 'Output', 'charset' => 'Character set', 'charsettip' => 'The character set you write your blog in (UTF-8 is '. diff --git a/fp-interface/themes/leggero/preview.tpl b/fp-interface/themes/leggero/preview.tpl index 54256bd..bcafea8 100755 --- a/fp-interface/themes/leggero/preview.tpl +++ b/fp-interface/themes/leggero/preview.tpl @@ -1,7 +1,7 @@ {entry content=$entry}

{$subject|tag:the_title}

-

Published by {$author} on {$date|date_format:"%A, %B %e, %Y - %H:%M:%S"}

+

Published by {$author} on {$date|date_format:$fp_config.locale.dateformat}

{$content|tag:the_content}
{/entry} diff --git a/fp-interface/themes/leggero/previewstatic.tpl b/fp-interface/themes/leggero/previewstatic.tpl index 25e06f6..286a650 100755 --- a/fp-interface/themes/leggero/previewstatic.tpl +++ b/fp-interface/themes/leggero/previewstatic.tpl @@ -1,7 +1,7 @@ {static content=$entry}

{$subject}

-

Published by {$author} on {$date|date_format:"%A, %B %e, %Y - %H:%M:%S"}

+

Published by {$author} on {$date|date_format:$fp_config.locale.dateformat}

{$content}
{/static}