plugins/kolab_activesync

Aleksander Machniak machniak at kolabsys.com
Wed Aug 29 15:48:30 CEST 2012


 plugins/kolab_activesync/kolab_activesync.js                      |  247 +++++-----
 plugins/kolab_activesync/kolab_activesync.php                     |   85 ++-
 plugins/kolab_activesync/kolab_activesync_ui.php                  |   38 +
 plugins/kolab_activesync/localization/en_US.inc                   |    3 
 plugins/kolab_activesync/package.xml                              |    8 
 plugins/kolab_activesync/skins/classic/config.css                 |   35 -
 plugins/kolab_activesync/skins/classic/templates/config.html      |   43 -
 plugins/kolab_activesync/skins/classic/templates/configedit.html  |   30 +
 plugins/kolab_activesync/skins/classic/templates/configempty.html |   19 
 plugins/kolab_activesync/skins/larry/config.css                   |   19 
 plugins/kolab_activesync/skins/larry/templates/config.html        |   40 -
 plugins/kolab_activesync/skins/larry/templates/configedit.html    |   31 +
 plugins/kolab_activesync/skins/larry/templates/configempty.html   |   21 
 13 files changed, 363 insertions(+), 256 deletions(-)

New commits:
commit 892f7a2fb8d83531a011fe244900ec70e410dff2
Author: Aleksander Machniak <alec at alec.pl>
Date:   Wed Aug 29 15:47:37 2012 +0200

    Greatly improved interface (use iframe for device form). Fixed layout/javascript issues.

diff --git a/plugins/kolab_activesync/kolab_activesync.js b/plugins/kolab_activesync/kolab_activesync.js
index b7ad998..c28a877 100644
--- a/plugins/kolab_activesync/kolab_activesync.js
+++ b/plugins/kolab_activesync/kolab_activesync.js
@@ -23,150 +23,153 @@
 
 function kolab_activesync_config()
 {
-    /* private members */
-    var me = this;
-    var http_lock = null;
-    var active_device = null;
+  /* private members */
+  var me = this,
+    http_lock = null,
+    active_device = null;
 
+  rcmail.register_command('plugin.save-config', save_config);
+  rcmail.register_command('plugin.delete-device', delete_device_config);
+  rcmail.addEventListener('plugin.activesync_save_complete', save_complete);
 
-    /* constructor */
+  if (rcmail.gui_objects.devicelist) {
     var devicelist = new rcube_list_widget(rcmail.gui_objects.devicelist,
-        { multiselect:true, draggable:false, keyboard:true });
+      { multiselect:true, draggable:false, keyboard:true });
     devicelist.addEventListener('select', select_device);
     devicelist.init();
 
-    rcmail.register_command('plugin.save-config', save_config);
-    rcmail.register_command('plugin.delete-device', delete_device_config);
-    rcmail.addEventListener('plugin.activesync_data_ready', device_data_ready);
-    rcmail.addEventListener('plugin.activesync_save_complete', save_complete);
-
-    $('input.alarm').change(function(e){ if (this.checked) $('#'+this.id.replace(/_alarm/, '')).prop('checked', this.checked); });
-    $('input.subscription').change(function(e){ if (!this.checked) $('#'+this.id+'_alarm').prop('checked', false); });
-    $(window).bind('resize', resize_ui);
-
-    $('.subscriptionblock thead td.subscription img, .subscriptionblock thead td.alarm img').click(function(e){
-      var $this = $(this);
-      var classname = $this.parent().get(0).className;
-      var check = !($this.data('checked') || false);
-      $this.css('cursor', 'pointer').data('checked', check)
-        .closest('table').find('input.'+classname).prop('checked', check).change();
+    // load frame if there are no devices
+    if (!rcmail.env.devicecount)
+      device_select();
+  }
+  else {
+    if (rcmail.env.active_device)
+      rcmail.enable_command('plugin.save-config', true);
+
+    $('input.alarm').change(function(e) {
+      if (this.checked)
+        $('#'+this.id.replace(/_alarm/, '')).prop('checked', this.checked);
     });
 
-    // select first device
-    if (rcmail.env.devicecount) {
-      for (var imei in rcmail.env.devices)
-        break;
-      devicelist.select(imei);
-    }
+    $('input.subscription').change(function(e) {
+      if (!this.checked)
+        $('#'+this.id+'_alarm').prop('checked', false);
+    });
 
-    /* private methods */
-    function select_device(list)
-    {
-        active_device = list.get_single_selection();
-        rcmail.enable_command('plugin.save-config', 'plugin.delete-device', true);
+    $('.subscriptionblock thead td.subscription img, .subscriptionblock thead td.alarm img').click(function(e) {
+      var $this = $(this),
+        classname = $this.parent().get(0).className,
+        list = $this.closest('table').find('input.'+classname),
+        check = list.not(':checked').length > 0;
 
-        if (active_device) {
-            http_lock = rcmail.set_busy(true, 'loading');
-            rcmail.http_request('plugin.activesyncjson', { cmd:'load', id:active_device }, http_lock);
-        }
+      list.prop('checked', check).change();
+    });
+  }
 
-        $('#introtext').hide();
-    }
+  /* private methods */
+  function select_device(list)
+  {
+    active_device = list.get_single_selection();
 
-    // callback from server after loading device data
-    function device_data_ready(data)
-    {
-        // reset form first
-        $('input.alarm:checked').prop('checked', false);
-        $('input.subscription:checked').prop('checked', false).change();
-
-        if (data.id && data.id == active_device) {
-            $('#config-device-alias').val(data.devicealias);
-//            $('#config-device-mode').val(data.syncmode);
-//            $('#config-device-laxpic').prop('checked', data.laxpic ? true : false);
-
-            $('input.subscription').each(function(i, elem){
-                var key = elem.value;
-                elem.checked = data.subscribed[key] ? true : false;
-            }).change();
-            $('input.alarm').each(function(i, elem){
-                var key = elem.value;
-                elem.checked = data.subscribed[key] == 2;
-            });
-
-            $('#configform, #prefs-box .boxtitle').show();
-            resize_ui();
-        }
-        else {
-            $('#configform, #prefs-box .boxtitle').hide();
-        }
-    }
+    if (active_device)
+      device_select(active_device);
+    else if (rcmail.env.contentframe)
+      rcmail.show_contentframe(false);
+  };
 
-    // submit current configuration form to server
-    function save_config()
-    {
-        // TODO: validate device info
-        var data = {
-            cmd: 'save',
-            id: active_device,
-            devicealias: $('#config-device-alias').val(),
-//            syncmode: $('#config-device-mode option:selected').val(),
-//            laxpic: $('#config-device-laxpic').get(0).checked ? 1 : 0
-        };
-
-        data.subscribed = {};
-        $('input.subscription:checked').each(function(i, elem){
-            data.subscribed[elem.value] = 1;
-        });
-        $('input.alarm:checked').each(function(i, elem){
-            if (data.subscribed[elem.value])
-                data.subscribed[elem.value] = 2;
-        });
-
-        http_lock = rcmail.set_busy(true, 'kolab_activesync.savingdata');
-        rcmail.http_post('plugin.activesyncjson', data, http_lock);
+  function device_select(id)
+  {
+    var win, target = window, url = '&_action=plugin.activesync-config';
+
+    if (id)
+      url += '&_id='+urlencode(id);
+    else if (!rcmail.env.devicecount)
+      url += '&_init=1';
+    else {
+      rcmail.show_contentframe(false);
+      return;
     }
 
-    // callback function when saving has completed
-    function save_complete(p)
-    {
-        if (p.success && p.devicealias) {
-            $('#devices-table tr.selected span.devicealias').html(p.devicealias);
-            rcmail.env.devices[p.id].ALIAS = p.devicealias;
-        }
+    if (win = rcmail.get_frame_window(rcmail.env.contentframe)) {
+      target = win;
+      url += '&_framed=1';
     }
 
-    // handler for delete commands
-    function delete_device_config()
-    {
-        if (active_device && confirm(rcmail.gettext('devicedeleteconfirm', 'kolab_activesync'))) {
-            http_lock = rcmail.set_busy(true, 'kolab_activesync.savingdata');
-            rcmail.http_post('plugin.activesyncjson', { cmd:'delete', id:active_device }, http_lock);
-        }
-    }
+    if (String(target.location.href).indexOf(url) >= 0)
+      rcmail.show_contentframe(true);
+    else
+      rcmail.location_href(rcmail.env.comm_path+url, target, true);
+  };
 
-    // handler for window resize events: sets max-height of folders list scroll container
-    function resize_ui()
-    {
-        if (active_device) {
-//@TODO: this doesn't work good with Larry
-            var h = $(window).height(), pos = $('#foldersubscriptions').offset();
-            $('#foldersubscriptions').css('max-height', (h - pos.top - 90) + 'px');
-        }
-    }
-}
+  // submit current configuration form to server
+  function save_config()
+  {
+    // TODO: validate device info
+    var data = {
+      cmd: 'save',
+      id: rcmail.env.active_device,
+      devicealias: $('#config-device-alias').val(),
+//      syncmode: $('#config-device-mode option:selected').val(),
+//      laxpic: $('#config-device-laxpic').get(0).checked ? 1 : 0
+    };
+
+    if (data.devicealias == data.id)
+      data.devicealias = '';
+
+    data.subscribed = {};
+    $('input.subscription:checked').each(function(i, elem) {
+      data.subscribed[elem.value] = 1;
+    });
+    $('input.alarm:checked').each(function(i, elem) {
+      if (data.subscribed[elem.value])
+        data.subscribed[elem.value] = 2;
+    });
 
+    http_lock = rcmail.set_busy(true, 'kolab_activesync.savingdata');
+    rcmail.http_post('plugin.activesync-json', data, http_lock);
+  };
 
-window.rcmail && rcmail.addEventListener('init', function(evt) {
-    var ACTION_CONFIG = 'plugin.activesyncconfig';
+  // callback function when saving has completed
+  function save_complete(p)
+  {
+    // device updated
+    if (p.success && p.alias)
+      parent.window.activesync_object.update_list(p.id, p.alias);
+
+    // device deleted
+    if (p.success && p.id && p.delete) {
+      active_device = null;
+      device_select();
+      devicelist.remove_row(p.id);
+      rcmail.enable_command('plugin.delete-device', false);
+    }
+  };
+  // handler for delete commands
+  function delete_device_config()
+  {
+    if (active_device && confirm(rcmail.gettext('devicedeleteconfirm', 'kolab_activesync'))) {
+      http_lock = rcmail.set_busy(true, 'kolab_activesync.savingdata');
+      rcmail.http_post('plugin.activesync-json', { cmd:'delete', id:active_device }, http_lock);
+    }
+  };
 
-    // add button to tabs list
-    var tab = $('<span>').attr('id', 'settingstabpluginactivesyncconfig').addClass('tablink');
-    var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.activesyncconfig').html(rcmail.gettext('tabtitle', 'kolab_activesync')).appendTo(tab);
-    rcmail.add_element(tab, 'tabs');
+  this.update_list = function(id, name)
+  {
+    $('#devices-table tr.selected span.devicealias').html(name);
+  }
+};
 
-    if (rcmail.env.action == ACTION_CONFIG)
-        new kolab_activesync_config();
+
+window.rcmail && rcmail.addEventListener('init', function(evt) {
+  // add button to tabs list
+  var tab = $('<span>').attr('id', 'settingstabpluginactivesync').addClass('tablink'),
+    button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.activesync')
+      .html(rcmail.gettext('tabtitle', 'kolab_activesync'))
+      .appendTo(tab);
+  rcmail.add_element(tab, 'tabs');
+
+  if (/^plugin.activesync/.test(rcmail.env.action))
+    activesync_object = new kolab_activesync_config();
 });
 
 
diff --git a/plugins/kolab_activesync/kolab_activesync.php b/plugins/kolab_activesync/kolab_activesync.php
index b93b104..c87e919 100644
--- a/plugins/kolab_activesync/kolab_activesync.php
+++ b/plugins/kolab_activesync/kolab_activesync.php
@@ -49,8 +49,9 @@ class kolab_activesync extends rcube_plugin
         $this->require_plugin('jqueryui');
         $this->require_plugin('libkolab');
 
-        $this->register_action('plugin.activesyncconfig', array($this, 'config_view'));
-        $this->register_action('plugin.activesyncjson', array($this, 'json_command'));
+        $this->register_action('plugin.activesync', array($this, 'config_view'));
+        $this->register_action('plugin.activesync-config', array($this, 'config_frame'));
+        $this->register_action('plugin.activesync-json', array($this, 'json_command'));
 
         $this->add_texts('localization/', true);
         $this->include_script('kolab_activesync.js');
@@ -65,33 +66,9 @@ class kolab_activesync extends rcube_plugin
         $imei = get_input_value('id', RCUBE_INPUT_GPC);
 
         switch ($cmd) {
-        case 'load':
-            $devices = $this->list_devices();
-
-            if ($device = $devices[$imei]) {
-                $result['id'] = $imei;
-                $result['devicealias'] = $device['ALIAS'];
-//                $result['syncmode'] = intval($device['MODE']);
-//                $result['laxpic'] = intval($device['LAXPIC']);
-                $result['subscribed'] = array();
-
-                foreach ($this->folder_meta() as $folder => $meta) {
-                    if ($meta['FOLDER'][$imei]['S']) {
-                        $result['subscribed'][$folder] = intval($meta['FOLDER'][$imei]['S']);
-                    }
-                }
-
-                $this->rc->output->command('plugin.activesync_data_ready', $result);
-            }
-            else {
-                $this->rc->output->show_message($this->gettext('devicenotfound'), 'error');
-            }
-            break;
-
         case 'save':
-            $devices      = $this->list_devices();
-            $device       = $devices[$imei];
-
+            $devices       = $this->list_devices();
+            $device        = $devices[$imei];
             $subscriptions = (array) get_input_value('subscribed', RCUBE_INPUT_POST);
             $devicealias   = get_input_value('devicealias', RCUBE_INPUT_POST, true);
 //            $syncmode     = intval(get_input_value('syncmode', RCUBE_INPUT_POST));
@@ -115,7 +92,7 @@ class kolab_activesync extends rcube_plugin
                 }
 
                 $this->rc->output->command('plugin.activesync_save_complete', array(
-                    'success' => !$err, 'id' => $imei, 'devicealias' => Q($devicealias)));
+                    'success' => !$err, 'id' => $imei, 'alias' => Q($devicealias)));
             }
 
             if ($err)
@@ -130,7 +107,8 @@ class kolab_activesync extends rcube_plugin
 
             if ($success) {
                 $this->rc->output->show_message($this->gettext('successfullydeleted'), 'confirmation');
-                $this->rc->output->redirect(array('action' => 'plugin.activesyncconfig'));  // reload UI
+                $this->rc->output->command('plugin.activesync_save_complete', array(
+                    'success' => true, 'id' => $imei, 'delete' => true));
             }
             else
                 $this->rc->output->show_message($this->gettext('savingerror'), 'error');
@@ -142,7 +120,7 @@ class kolab_activesync extends rcube_plugin
     }
 
     /**
-     * Render main UI for device configuration
+     * Render main UI for devices configuration
      */
     public function config_view()
     {
@@ -158,10 +136,47 @@ class kolab_activesync extends rcube_plugin
         $this->ui = new kolab_activesync_ui($this);
 
         $this->register_handler('plugin.devicelist', array($this->ui, 'device_list'));
+
+        $this->rc->output->send('kolab_activesync.config');
+    }
+
+    /**
+     * Render device configuration form
+     */
+    public function config_frame()
+    {
+        $storage = $this->rc->get_storage();
+
+        // checks if IMAP server supports any of METADATA, ANNOTATEMORE, ANNOTATEMORE2
+        if (!($storage->get_capability('METADATA') || $storage->get_capability('ANNOTATEMORE') || $storage->get_capability('ANNOTATEMORE2'))) {
+            $this->rc->output->show_message($this->gettext('notsupported'), 'error');
+        }
+
+        require_once $this->home . '/kolab_activesync_ui.php';
+
+        $this->ui = new kolab_activesync_ui($this);
+
+        if (!empty($_GET['_init'])) {
+            return $this->rc->output->send('kolab_activesync.configempty');
+        }
+
         $this->register_handler('plugin.deviceconfigform', array($this->ui, 'device_config_form'));
         $this->register_handler('plugin.foldersubscriptions', array($this->ui, 'folder_subscriptions'));
 
-        $this->rc->output->send('kolab_activesync.config');
+        $imei    = get_input_value('_id', RCUBE_INPUT_GPC);
+        $devices = $this->list_devices();
+
+        if ($device = $devices[$imei]) {
+            $this->ui->device        = $device;
+            $this->ui->device['_id'] = $imei;
+            $this->rc->output->set_env('active_device', $imei);
+            $this->rc->output->command('parent.enable_command','plugin.delete-device', true);
+        }
+        else {
+            $this->rc->output->show_message($this->gettext('devicenotfound'), 'error');
+        }
+
+        $this->rc->output->send('kolab_activesync.configedit');
     }
 
     /**
@@ -259,6 +274,10 @@ class kolab_activesync extends rcube_plugin
      */
     public function folder_set($name, $deviceid, $flag)
     {
+        if (empty($deviceid)) {
+            return false;
+        }
+
         // get folders activesync config
         $metadata = $this->folder_meta();
         $metadata = $metadata[$name];
@@ -415,7 +434,7 @@ class kolab_activesync extends rcube_plugin
     private function unserialize_metadata($str)
     {
         if (!empty($str)) {
-            $data = json_decode($str, true);
+            $data = @json_decode($str, true);
             return $data;
         }
 
diff --git a/plugins/kolab_activesync/kolab_activesync_ui.php b/plugins/kolab_activesync/kolab_activesync_ui.php
index 3deb136..9e4fe5c 100644
--- a/plugins/kolab_activesync/kolab_activesync_ui.php
+++ b/plugins/kolab_activesync/kolab_activesync_ui.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Z-Push configuration user interface builder
+ * ActiveSync configuration user interface builder
  *
  * @version @package_version@
  * @author Thomas Bruederli <bruederli at kolabsys.com>
@@ -27,6 +27,7 @@ class kolab_activesync_ui
 {
     private $rc;
     private $plugin;
+    public  $device = array();
 
     public function __construct($plugin)
     {
@@ -39,13 +40,12 @@ class kolab_activesync_ui
         $this->rc->output->include_script('list.js');
     }
 
-
     public function device_list($attrib = array())
     {
         $attrib += array('id' => 'devices-list');
 
         $devices = $this->plugin->list_devices();
-        $table = new html_table();
+        $table   = new html_table();
 
         foreach ($devices as $id => $device) {
             $name = $device['ALIAS'] ? $device['ALIAS'] : $id;
@@ -54,7 +54,6 @@ class kolab_activesync_ui
         }
 
         $this->rc->output->add_gui_object('devicelist', $attrib['id']);
-        $this->rc->output->set_env('devices', $devices);
         $this->rc->output->set_env('devicecount', count($devices));
 
         return $table->show($attrib);
@@ -68,7 +67,7 @@ class kolab_activesync_ui
         $field_id = 'config-device-alias';
         $input = new html_inputfield(array('name' => 'devicealias', 'id' => $field_id, 'size' => 40));
         $table->add('title', html::label($field_id, $this->plugin->gettext('devicealias')));
-        $table->add(null, $input->show());
+        $table->add(null, $input->show($this->device['ALIAS'] ? $this->device['ALIAS'] : $this->device['_id']));
 /*
         $field_id = 'config-device-mode';
         $select = new html_select(array('name' => 'syncmode', 'id' => $field_id));
@@ -81,8 +80,9 @@ class kolab_activesync_ui
         $table->add('title', $this->plugin->gettext('imageformat'));
         $table->add(null, html::label($field_id, $checkbox->show() . ' ' . $this->plugin->gettext('laxpiclabel')));
 */
-        if ($attrib['form'])
+        if ($attrib['form']) {
             $this->rc->output->add_gui_object('editform', $attrib['form']);
+        }
 
         return $table->show($attrib);
     }
@@ -95,8 +95,13 @@ class kolab_activesync_ui
 
         // group folders by type (show only known types)
         $folder_groups = array('mail' => array(), 'contact' => array(), 'event' => array(), 'task' => array());
-        $folder_meta   = $this->plugin->folder_meta();
         $folder_types  = $this->plugin->list_types();
+        $imei          = $this->device['_id'];
+        $subscribed    = array();
+
+        if ($imei) {
+            $folder_meta = $this->plugin->folder_meta();
+        }
 
         foreach ($this->plugin->list_folders() as $folder) {
             if ($folder_types[$folder]) {
@@ -108,6 +113,12 @@ class kolab_activesync_ui
 
             if (is_array($folder_groups[$type])) {
                 $folder_groups[$type][] = $folder;
+
+                if (!empty($folder_meta) && ($meta = $folder_meta[$folder])
+                    && $meta['FOLDER'] && $meta['FOLDER'][$imei]['S']
+                ) {
+                    $subscribed[$folder] = intval($meta['FOLDER'][$imei]['S']);
+                }
             }
         }
 
@@ -119,7 +130,7 @@ class kolab_activesync_ui
             $attrib['type'] = $type;
             $html .= html::div('subscriptionblock',
                 html::tag('h3', $type, $this->plugin->gettext($type)) .
-                $this->folder_subscriptions_block($group, $attrib));
+                $this->folder_subscriptions_block($group, $attrib, $subscribed));
         }
 
         $this->rc->output->add_gui_object('subscriptionslist', $attrib['id']);
@@ -127,7 +138,7 @@ class kolab_activesync_ui
         return html::div($attrib, $html);
     }
 
-    public function folder_subscriptions_block($a_folders, $attrib)
+    public function folder_subscriptions_block($a_folders, $attrib, $subscribed)
     {
         $alarms = ($attrib['type'] == 'event' || $attrib['type'] == 'task');
 
@@ -157,7 +168,6 @@ class kolab_activesync_ui
             }
 
             $names[] = $origname;
-
             $classes = array('mailbox');
 
             if ($folder_class = rcmail_folder_classname($folder)) {
@@ -169,10 +179,14 @@ class kolab_activesync_ui
             $padding = str_repeat('    ', $level);
 
             $table->add_row(array('class' => (($level+1) * $idx++) % 2 == 0 ? 'even' : 'odd'));
-            $table->add('subscription', $checkbox_sync->show('', array('value' => $folder, 'id' => $folder_id)));
+            $table->add('subscription', $checkbox_sync->show(
+                !empty($subscribed[$folder]) ? $folder : null,
+                array('value' => $folder, 'id' => $folder_id)));
 
             if ($alarms) {
-                $table->add('alarm', $checkbox_alarm->show('', array('value' => $folder, 'id' => $folder_id.'_alarm')));
+                $table->add('alarm', $checkbox_alarm->show(
+                    intval($subscribed[$folder]) > 1 ? $folder : null,
+                    array('value' => $folder, 'id' => $folder_id.'_alarm')));
             }
 
             $table->add(join(' ', $classes), html::label($folder_id, $padding . Q($foldername)));
diff --git a/plugins/kolab_activesync/localization/en_US.inc b/plugins/kolab_activesync/localization/en_US.inc
index be9fdf2..2399b13 100644
--- a/plugins/kolab_activesync/localization/en_US.inc
+++ b/plugins/kolab_activesync/localization/en_US.inc
@@ -28,5 +28,6 @@ $labels['savingerror'] = 'Failed to save configuration';
 $labels['notsupported'] = 'Your server does not support metadata/annotations';
 $labels['devicedeleteconfirm'] = 'Do you really want to delete the configuration for this device?';
 $labels['successfullydeleted'] = 'The device configuration was successfully removed';
+$labels['devicenotfound'] = 'Unable to read device configuration';
 
-?>
\ No newline at end of file
+?>
diff --git a/plugins/kolab_activesync/package.xml b/plugins/kolab_activesync/package.xml
index 464dc79..09e8d66 100644
--- a/plugins/kolab_activesync/package.xml
+++ b/plugins/kolab_activesync/package.xml
@@ -19,9 +19,9 @@
 		<email>bruederli at kolabsys.com</email>
 		<active>yes</active>
 	</lead>
-	<date>2012-07-02</date>
+	<date>2012-08-29</date>
 	<version>
-		<release>1.0</release>
+		<release>0.9</release>
 		<api>1.0</api>
 	</version>
 	<stability>
@@ -39,6 +39,8 @@
 			<file name="localization/en_US.inc" role="data"></file>
 			<file name="localization/pl_PL.inc" role="data"></file>
 			<file name="skins/classic/templates/config.html" role="data"></file>
+			<file name="skins/classic/templates/configedit.html" role="data"></file>
+			<file name="skins/classic/templates/configempty.html" role="data"></file>
 			<file name="skins/classic/config.css" role="data"></file>
 			<file name="skins/classic/alarm-clock.png" role="data"></file>
 			<file name="skins/classic/deviceactions.png" role="data"></file>
@@ -46,6 +48,8 @@
 			<file name="skins/classic/pointer-left.gif" role="data"></file>
 			<file name="skins/classic/synchronize.png" role="data"></file>
 			<file name="skins/larry/templates/config.html" role="data"></file>
+			<file name="skins/larry/templates/configedit.html" role="data"></file>
+			<file name="skins/larry/templates/configempty.html" role="data"></file>
 			<file name="skins/larry/config.css" role="data"></file>
 			<file name="skins/larry/alarm-clock.png" role="data"></file>
 			<file name="skins/larry/deviceactions.png" role="data"></file>
diff --git a/plugins/kolab_activesync/skins/classic/config.css b/plugins/kolab_activesync/skins/classic/config.css
index 176d148..8d7e13d 100644
--- a/plugins/kolab_activesync/skins/classic/config.css
+++ b/plugins/kolab_activesync/skins/classic/config.css
@@ -1,15 +1,9 @@
-/* Stylesheets for the Kolab Z-Push configuration UI */
-#configform {
-	padding-top: 15px;
-}
+/* Stylesheets for the Kolab ActiveSync configuration UI */
 
 #devices-table {
 	width: 100%;
 	table-layout: fixed;
-}
-
-#devices-table td {
-	cursor: pointer;
+	cursor: default;
 }
 
 #devices-table td span.devicetype {
@@ -38,24 +32,24 @@ div.subscriptionblock h3 {
 	font-size: 12px;
 	color: #333;
 	margin: 0 0 0.4em 0;
-	padding: 4px 4px 5px 30px;
-	background: url(foldertypes.png) 4px 4px no-repeat #fbfbfb;
+	padding: 4px 4px 0 30px;
+	background: url(foldertypes.png) 5px 4px no-repeat #eee;
 }
 
 div.subscriptionblock h3.contact {
-	background-position: 4px -16px;
+	background-position: 5px -16px;
 }
 
 div.subscriptionblock h3.event {
-	background-position: 4px -36px;
+	background-position: 5px -36px;
 }
 
 div.subscriptionblock h3.task {
-	background-position: 4px -56x;
+	background-position: 5px -56px;
 }
 
 div.subscriptionblock h3.note {
-	background-position: 4px -76px;
+	background-position: 5px -76px;
 }
 
 #foldersubscriptions thead td {
@@ -65,13 +59,22 @@ div.subscriptionblock h3.note {
 	text-align: center;
 }
 
+#foldersubscriptions thead tr td {
+	border-top: 1px solid #ddd;
+}
+
+#foldersubscriptions thead td img {
+	cursor: pointer;
+}
+
 #foldersubscriptions thead td.foldername {
     text-align: left;
 }
 
 #foldersubscriptions tbody td {
-	padding: 2px;
+	padding: 1px 2px;
 	border-top: 1px solid #ddd;
+	background-color: white;
 }
 
 #foldersubscriptions td label {
@@ -80,6 +83,7 @@ div.subscriptionblock h3.note {
 
 #foldersubscriptions td.mailbox {
 	min-width: 12em;
+	padding-right: 10px;
 }
 
 #foldersubscriptions td.virtual {
@@ -88,7 +92,6 @@ div.subscriptionblock h3.note {
 
 #foldersubscriptions {
 	overflow: auto;
-	max-height: 400px;
 	margin-top: 0.5em;
 }
 
diff --git a/plugins/kolab_activesync/skins/classic/templates/config.html b/plugins/kolab_activesync/skins/classic/templates/config.html
index 87ef463..aea9f78 100644
--- a/plugins/kolab_activesync/skins/classic/templates/config.html
+++ b/plugins/kolab_activesync/skins/classic/templates/config.html
@@ -15,38 +15,13 @@
 <div id="mainscreen">
 
 <div id="sectionslist">
-<div id="directorylist-title" class="boxtitle"><roundcube:label name="kolab_activesync.devices" /></div>
-<div class="boxlistcontent">
-	<roundcube:object name="plugin.devicelist" id="devices-table" class="records-table" cellspacing="0" />
-</div>
-<div class="boxfooter">
-	<roundcube:button type="link" command="plugin.delete-device" title="kolab_activesync.deletedevice" class="buttonPas delete" classAct="button delete" content=" " />
-</div>
-</div>
-
-<div id="prefs-box">
-	<div class="boxtitle" style="display:none"><roundcube:label name="kolab_activesync.syncsettings"></div>
-	<form action="#" method="post" id="configform" class="boxcontent" style="display:none">
-		<fieldset>
-			<legend><roundcube:label name="kolab_activesync.deviceconfig" /></legend>
-			<roundcube:object name="plugin.deviceconfigform" form="configform" />
-		</fieldset>
-		<fieldset>
-			<legend><roundcube:label name="kolab_activesync.folderstosync" /></legend>
-			<roundcube:object name="plugin.foldersubscriptions" form="configform" id="foldersubscriptions" syncicon="synchronize.png" alarmicon="alarm-clock.png" />
-		</fieldset>
-		<p class="formbuttons">
-			<roundcube:button type="input" class="button mainaction" command="plugin.save-config" label="save" />
-		</p>
-	</form>
-	<div id="introtext">
-		<div class="inner"><div class="bordered">
-			<roundcube:label name="kolab_activesync.nodevices" html="true" />
-		</div></div>
-		<div class="pointer-left"></div>
+	<div id="directorylist-title" class="boxtitle"><roundcube:label name="kolab_activesync.devices" /></div>
+	<div class="boxlistcontent">
+		<roundcube:object name="plugin.devicelist" id="devices-table" class="records-table" cellspacing="0" />
+	</div>
+	<div class="boxfooter">
+		<roundcube:button type="link" command="plugin.delete-device" title="kolab_activesync.deletedevice" class="buttonPas delete" classAct="button delete" content=" " />
 	</div>
-</div>
-
 </div>
 
 <script type="text/javascript">
@@ -54,5 +29,11 @@
 	rcmail.add_onload('viewsplit.init()');
 </script>
 
+<div id="prefs-box">
+	<roundcube:frame name="activesyncframe" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" />
+</div>
+
+</div>
+
 </body>
 </html>
diff --git a/plugins/kolab_activesync/skins/classic/templates/configedit.html b/plugins/kolab_activesync/skins/classic/templates/configedit.html
new file mode 100644
index 0000000..8115ef6
--- /dev/null
+++ b/plugins/kolab_activesync/skins/classic/templates/configedit.html
@@ -0,0 +1,30 @@
+<roundcube:object name="doctype" value="html5" />
+<html>
+<head>
+<title><roundcube:object name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+</head>
+<body class="iframe">
+
+<div id="prefs-title" class="boxtitle"><roundcube:label name="kolab_activesync.syncsettings"></div>
+
+<div id="prefs-details" class="boxcontent">
+	<form action="#" method="post" id="configform">
+		<fieldset>
+			<legend><roundcube:label name="kolab_activesync.deviceconfig" /></legend>
+			<roundcube:object name="plugin.deviceconfigform" form="configform" class="propform" />
+		</fieldset>
+		<fieldset>
+			<legend><roundcube:label name="kolab_activesync.folderstosync" /></legend>
+			<roundcube:object name="plugin.foldersubscriptions" form="configform" id="foldersubscriptions" syncicon="synchronize.png" alarmicon="alarm-clock.png" />
+		</fieldset>
+	</form>
+	<div id="formfooter">
+		<div class="footerleft">
+			<roundcube:button type="input" class="button mainaction" command="plugin.save-config" label="save" />
+		</div>
+	</div>
+</div>
+
+</body>
+</html>
diff --git a/plugins/kolab_activesync/skins/classic/templates/configempty.html b/plugins/kolab_activesync/skins/classic/templates/configempty.html
new file mode 100644
index 0000000..5afd3ce
--- /dev/null
+++ b/plugins/kolab_activesync/skins/classic/templates/configempty.html
@@ -0,0 +1,19 @@
+<roundcube:object name="doctype" value="html5" />
+<html>
+<head>
+<title><roundcube:object name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+</head>
+<body class="iframe">
+
+<div id="preferences-details" class="boxcontent">
+	<div id="introtext">
+		<div class="inner">
+			<roundcube:label name="kolab_activesync.nodevices" html="true" />
+		</div>
+		<div class="pointer-left"></div>
+	</div>
+</div>
+
+</body>
+</html>
diff --git a/plugins/kolab_activesync/skins/larry/config.css b/plugins/kolab_activesync/skins/larry/config.css
index 20e9afc..a676f2c 100644
--- a/plugins/kolab_activesync/skins/larry/config.css
+++ b/plugins/kolab_activesync/skins/larry/config.css
@@ -1,8 +1,4 @@
-/* Stylesheets for the Kolab Z-Push configuration UI */
-
-#configform {
-	padding-top: 15px;
-}
+/* Stylesheets for the Kolab ActiveSync configuration UI */
 
 #sectionslist {
 	width: 220px;
@@ -16,15 +12,15 @@
 	bottom: 0;
 }
 
+#activesync-frame {
+	border-radius: 3px;
+}
+
 #devices-table {
 	width: 100%;
 	table-layout: fixed;
 }
 
-#devices-table td {
-	cursor: pointer;
-}
-
 #devices-table td span.devicetype {
 	padding-left: 1em;
 	font-style: italic;
@@ -76,6 +72,10 @@ div.subscriptionblock h3.note {
   text-align: left;
 }
 
+#foldersubscriptions thead td img {
+	cursor: pointer;
+}
+
 #foldersubscriptions tbody td {
 	background: #eee;
 	padding: 2px;
@@ -98,7 +98,6 @@ div.subscriptionblock h3.note {
 
 #foldersubscriptions {
 	overflow: auto;
-	max-height: 400px;
 	margin-top: 0.5em;
 }
 
diff --git a/plugins/kolab_activesync/skins/larry/templates/config.html b/plugins/kolab_activesync/skins/larry/templates/config.html
index ae43a3d..88d42bc 100644
--- a/plugins/kolab_activesync/skins/larry/templates/config.html
+++ b/plugins/kolab_activesync/skins/larry/templates/config.html
@@ -15,44 +15,26 @@
 <div id="settings-right">
 
 <div id="sectionslist" class="uibox listbox">
-<h2 id="directorylist-title" class="boxtitle"><roundcube:label name="kolab_activesync.devices" /></h2>
-<div class="boxlistcontent">
-	<roundcube:object name="plugin.devicelist" id="devices-table" class="listing" cellspacing="0" />
-</div>
-<div class="boxfooter">
-	<roundcube:button type="link" command="plugin.delete-device" title="kolab_activesync.deletedevice" class="listbutton delete disabled" classAct="listbutton delete" innerClass="inner" content="x" />
-</div>
+	<h2 id="directorylist-title" class="boxtitle"><roundcube:label name="kolab_activesync.devices" /></h2>
+	<div class="boxlistcontent">
+		<roundcube:object name="plugin.devicelist" id="devices-table" class="listing" cellspacing="0" />
+	</div>
+	<div class="boxfooter">
+		<roundcube:button type="link" command="plugin.delete-device" title="kolab_activesync.deletedevice" class="listbutton delete disabled" classAct="listbutton delete" innerClass="inner" content="x" />
+	</div>
 </div>
 
 <div id="prefs-box" class="uibox contentbox">
-	<h1 class="boxtitle" style="display:none"><roundcube:label name="kolab_activesync.syncsettings"></h1>
-	<form action="#" method="post" id="configform" class="boxcontent tabbed" style="display:none">
-		<fieldset>
-			<legend><roundcube:label name="kolab_activesync.deviceconfig" /></legend>
-			<roundcube:object name="plugin.deviceconfigform" form="configform" class="propform" />
-		</fieldset>
-		<fieldset>
-			<legend><roundcube:label name="kolab_activesync.folderstosync" /></legend>
-			<roundcube:object name="plugin.foldersubscriptions" form="configform" id="foldersubscriptions" syncicon="synchronize.png" alarmicon="alarm-clock.png" />
-		</fieldset>
-
-		<p class="formbuttons">
-			<roundcube:button type="input" class="button mainaction" command="plugin.save-config" label="save" />
-		</p>
-	</form>
-
-	<div id="introtext">
-		<div class="inner">
-			<roundcube:label name="kolab_activesync.nodevices" html="true" />
-		</div>
-		<div class="pointer-left"></div>
+	<div class="iframebox">
+		<roundcube:frame name="activesyncframe" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" />
 	</div>
-
 	<roundcube:object name="message" id="message" class="statusbar" />
 </div>
 
 </div>
 
+</div>
+
 <roundcube:include file="/includes/footer.html" />
 
 <script type="text/javascript">
diff --git a/plugins/kolab_activesync/skins/larry/templates/configedit.html b/plugins/kolab_activesync/skins/larry/templates/configedit.html
new file mode 100644
index 0000000..88f56cf
--- /dev/null
+++ b/plugins/kolab_activesync/skins/larry/templates/configedit.html
@@ -0,0 +1,31 @@
+<roundcube:object name="doctype" value="html5" />
+<html>
+<head>
+<title><roundcube:object name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+</head>
+<body class="iframe floatingbuttons">
+
+<h1 class="boxtitle"><roundcube:label name="kolab_activesync.syncsettings"></h1>
+
+<div id="preferences-details" class="boxcontent">
+	<form action="#" method="post" id="configform" class="tabbed">
+		<fieldset>
+			<legend><roundcube:label name="kolab_activesync.deviceconfig" /></legend>
+			<roundcube:object name="plugin.deviceconfigform" form="configform" class="propform" />
+		</fieldset>
+		<fieldset>
+			<legend><roundcube:label name="kolab_activesync.folderstosync" /></legend>
+			<roundcube:object name="plugin.foldersubscriptions" form="configform" id="foldersubscriptions" syncicon="synchronize.png" alarmicon="alarm-clock.png" />
+		</fieldset>
+	</form>
+</div>
+
+<div class="footerleft formbuttons floating">
+	<roundcube:button type="input" class="button mainaction" command="plugin.save-config" label="save" />
+</div>
+
+<roundcube:include file="/includes/footer.html" />
+
+</body>
+</html>
diff --git a/plugins/kolab_activesync/skins/larry/templates/configempty.html b/plugins/kolab_activesync/skins/larry/templates/configempty.html
new file mode 100644
index 0000000..5d1a062
--- /dev/null
+++ b/plugins/kolab_activesync/skins/larry/templates/configempty.html
@@ -0,0 +1,21 @@
+<roundcube:object name="doctype" value="html5" />
+<html>
+<head>
+<title><roundcube:object name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+</head>
+<body class="iframe">
+
+<div id="preferences-details" class="boxcontent">
+	<div id="introtext">
+		<div class="inner">
+			<roundcube:label name="kolab_activesync.nodevices" html="true" />
+		</div>
+		<div class="pointer-left"></div>
+	</div>
+</div>
+
+<roundcube:include file="/includes/footer.html" />
+
+</body>
+</html>





More information about the commits mailing list