summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-01-01 12:26:08 +0000
committeralecpl <alec@alec.pl>2012-01-01 12:26:08 +0000
commit89c30a00a71988c8db632f8f3cc94ed241bdaa1f (patch)
tree3c63912f3f23a9ba9fa761c32541918e92ada21f /program/steps/addressbook/func.inc
parent5b5ed46815b48590d96ee0a2ec1e6b39ca9c413d (diff)
- Don't load jqueryui plugin, it's required now by default
- Move datepicker's date format setting to the plugin
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r--program/steps/addressbook/func.inc14
1 files changed, 5 insertions, 9 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index e7d3eaebe..99746a3aa 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -434,7 +434,6 @@ function rcmail_get_type_label($type)
function rcmail_contact_form($form, $record, $attrib = null)
{
global $RCMAIL, $CONFIG;
- static $jqueryui_loaded = 0;
// Allow plugins to modify contact form content
$plugin = $RCMAIL->plugins->exec_hook('contact_form', array(
@@ -447,6 +446,10 @@ function rcmail_contact_form($form, $record, $attrib = null)
unset($attrib['deleteicon']);
$out = '';
+ $RCMAIL->output->set_env('date_format',
+ strtr($RCMAIL->config->get('date_format', 'Y-m-d'),
+ array('y'=>'y', 'Y'=>'yy', 'm'=>'mm', 'n'=>'m', 'd'=>'dd', 'j'=>'d')));
+
// get default coltypes
$coltypes = $GLOBALS['CONTACT_COLTYPES'];
$coltype_labels = array();
@@ -623,15 +626,8 @@ function rcmail_contact_form($form, $record, $attrib = null)
// load jquery UI datepickert for date fields
if ($colprop['type'] == 'date') {
- if (!$jqueryui_loaded++) {
- $RCMAIL->plugins->load_plugin('jqueryui');
- $RCMAIL->output->set_env('date_format', strtr($RCMAIL->config->get('date_format', 'Y-m-d'), array('y'=>'y', 'Y'=>'yy', 'm'=>'mm', 'n'=>'m', 'd'=>'dd', 'j'=>'d')));
- foreach (array('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec') as $month)
- $month_names[] = rcube_label($month);
- $RCMAIL->output->set_env('month_names', $month_names);
- }
$colprop['class'] .= ($colprop['class'] ? ' ' : '') . 'datepicker';
- $val = format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'), false);
+ $val = rcmail_format_date_col($val);
}
$val = rcmail_get_edit_field($col, $val, $colprop, $colprop['type']);