From 89c30a00a71988c8db632f8f3cc94ed241bdaa1f Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 01 Jan 2012 07:26:08 -0500
Subject: [PATCH] - Don't load jqueryui plugin, it's required now by default - Move datepicker's date format setting to the plugin

---
 program/steps/mail/compose.inc     |    3 ---
 program/steps/addressbook/func.inc |   14 +++++---------
 program/js/app.js                  |    1 -
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 5e51cbb..be6ca8d 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4200,7 +4200,6 @@
         yearRange: '-100:+10',
         showOtherMonths: true,
         selectOtherMonths: true,
-        monthNamesShort: this.env.month_names,
         onSelect: function(dateText) { $(this).focus().val(dateText) }
       });
       $('input.datepicker').datepicker();
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index e7d3eae..99746a3 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -434,7 +434,6 @@
 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(
@@ -446,6 +445,10 @@
     $del_button = $attrib['deleteicon'] ? html::img(array('src' => $CONFIG['skin_path'] . $attrib['deleteicon'], 'alt' => rcube_label('delete'))) : rcube_label('delete');
     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'];
@@ -623,15 +626,8 @@
 
                         // 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']);
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index b7a4fcb..c23c606 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -139,9 +139,6 @@
 $OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false));
 $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
 
-// use jquery UI for showing prompt() dialogs
-$RCMAIL->plugins->load_plugin('jqueryui');
-
 // default font for HTML editor
 $font = rcube_fontdefs($RCMAIL->config->get('default_font', 'Verdana'));
 if ($font && !is_array($font)) {

--
Gitblit v1.9.1