plugins/kolab_files

Aleksander Machniak machniak at kolabsys.com
Fri Oct 17 14:00:03 CEST 2014


 plugins/kolab_files/kolab_files.js                            |   10 +++--
 plugins/kolab_files/lib/kolab_files_engine.php                |   20 +++++++++-
 plugins/kolab_files/localization/en_US.inc                    |    3 +
 plugins/kolab_files/skins/larry/style.css                     |   16 +++++++-
 plugins/kolab_files/skins/larry/templates/compose_plugin.html |    1 
 plugins/kolab_files/skins/larry/templates/files.html          |    1 
 plugins/kolab_files/skins/larry/templates/message_plugin.html |    1 
 7 files changed, 47 insertions(+), 5 deletions(-)

New commits:
commit fa20f96c30ce8b5808b68ce27ea5fe67cb271cc2
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri Oct 17 07:59:38 2014 -0400

    Add "remember password" option

diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index 898a682..57e36a5 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -385,6 +385,10 @@ function kolab_files_folder_mount_dialog()
       }
     });
 
+    $('.auth-options input', dialog).each(function() {
+      args[this.name] = this.type == 'checkbox' && !this.checked ? '' : this.value;
+    });
+
     file_api.folder_mount(args);
     kolab_dialog_close(this);
   };
@@ -1025,7 +1029,7 @@ function kolab_files_ui()
 
     elem.html('').append(list);
 
-    this.env.folders = this.folder_list_parse(response.result ? response.result.list : []);
+    this.env.folders = this.folder_list_parse(response.result && response.result.list ? response.result.list : response.result);
 
     $.each(this.env.folders, function(i, f) {
       list.append(file_api.folder_list_row(i, f));
@@ -1835,13 +1839,13 @@ function kolab_files_ui()
       content = this.folder_list_auth_form(driver);
 
     dialog.find('table.propform').remove();
-    dialog.append(content);
+    $('.options', dialog).before(content);
 
     args.buttons[this.t('kolab_files.save')] = function() {
       var data = {folder: label, list: 1};
 
       $('input', dialog).each(function() {
-        data[this.name] = this.value;
+        data[this.name] = this.type == 'checkbox' && !this.checked ? '' : this.value;
       });
 
       file_api.open_dialog = this;
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index bbcd666..d319fe7 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -123,6 +123,7 @@ class kolab_files_engine
             $this->rc->output->add_handlers(array(
                 'folder-create-form' => array($this, 'folder_create_form'),
                 'folder-mount-form'  => array($this, 'folder_mount_form'),
+                'folder-auth-options'=> array($this, 'folder_auth_options'),
                 'file-search-form'   => array($this, 'file_search_form'),
                 'file-edit-form'     => array($this, 'file_edit_form'),
                 'filelist'           => array($this, 'file_list'),
@@ -243,7 +244,7 @@ class kolab_files_engine
             $table->add(array('id' => $id, 'colspan' => 2, 'class' => 'source'), $row);
         }
 
-        $out = $table->show();
+        $out = $table->show() . $this->folder_auth_options(array('suffix' => '-form'));
 
         // add form tag around text field
         if (empty($attrib['form'])) {
@@ -259,6 +260,23 @@ class kolab_files_engine
     }
 
     /**
+     * Template object for folder authentication options
+     */
+    public function folder_auth_options($attrib)
+    {
+        $checkbox = new html_checkbox(array(
+            'name'  => 'store_passwords',
+            'value' => '1',
+            'id'    => 'auth-pass-checkbox' . $attrib['suffix'],
+        ));
+
+        return html::div('auth-options', $checkbox->show(). ' '
+            . html::label('auth-pass-checkbox' . $attrib['suffix'], $this->plugin->gettext('storepasswords'))
+            . html::span('description', $this->plugin->gettext('storepasswordsdesc'))
+        );
+    }
+
+    /**
      * Template object for file_edit form
      */
     public function file_edit_form($attrib)
diff --git a/plugins/kolab_files/localization/en_US.inc b/plugins/kolab_files/localization/en_US.inc
index 3ecd1fc..9ddecef 100644
--- a/plugins/kolab_files/localization/en_US.inc
+++ b/plugins/kolab_files/localization/en_US.inc
@@ -81,6 +81,9 @@ $labels['fileoverwrite'] = 'Overwrite';
 $labels['fileoverwriteall'] = 'Overwrite all';
 $labels['filemoveconfirm'] = 'This action is going to overwrite the destination file: <b>$file</b>.';
 
+$labels['storepasswords'] = 'remember password';
+$labels['storepasswordsdesc'] = 'Stored passwords will be encrypted. Enable this if you do not want to be asked for the password on every login or you want this storage to be available via WebDAV.';
+
 $labels['arialabelsearchform'] = 'Files search form';
 $labels['arialabelquicksearchbox'] = 'Search input';
 $labels['arialabellistoptions'] = 'Files list options';
diff --git a/plugins/kolab_files/skins/larry/style.css b/plugins/kolab_files/skins/larry/style.css
index de0735c..526395e 100644
--- a/plugins/kolab_files/skins/larry/style.css
+++ b/plugins/kolab_files/skins/larry/style.css
@@ -365,7 +365,6 @@ ul.toolbarmenu li span.saveas {
   background: url(images/buttons.png) -5px -253px no-repeat;
 }
 
-
 table.propform td.source.selected {
   background-color: #c7e3ef;
 }
@@ -400,3 +399,18 @@ table.propform td.source table.propform td {
   padding: 2px 10px;
   background-color: inherit;
 }
+
+.auth-options {
+  margin-top: 5px;
+}
+
+.auth-options .description {
+  color: #666;
+  display: block;
+  margin: 3px 0 0 25px;
+}
+
+.auth-options input,
+.auth-options label {
+  vertical-align: middle;
+}
diff --git a/plugins/kolab_files/skins/larry/templates/compose_plugin.html b/plugins/kolab_files/skins/larry/templates/compose_plugin.html
index ceb56cc..e4d0a15 100644
--- a/plugins/kolab_files/skins/larry/templates/compose_plugin.html
+++ b/plugins/kolab_files/skins/larry/templates/compose_plugin.html
@@ -28,4 +28,5 @@
 
 <div id="files-folder-auth-dialog" role="dialog" aria-labelledby="aria-label-folderauthform" aria-hidden="true">
     <h3 id="aria-label-folderauthform" class="voice"><roundcube:label name="kolab_files.arialabelfolderauthform" /></h3>
+    <roundcube:object name="folder-auth-options">
 </div>
diff --git a/plugins/kolab_files/skins/larry/templates/files.html b/plugins/kolab_files/skins/larry/templates/files.html
index e33d1d0..4494e3e 100644
--- a/plugins/kolab_files/skins/larry/templates/files.html
+++ b/plugins/kolab_files/skins/larry/templates/files.html
@@ -82,6 +82,7 @@
 </div>
 <div id="files-folder-auth-dialog" role="dialog" aria-labelledby="aria-label-folderauthform" aria-hidden="true">
     <h3 id="aria-label-folderauthform" class="voice"><roundcube:label name="kolab_files.arialabelfolderauthform" /></h3>
+    <roundcube:object name="folder-auth-options">
 </div>
 
 <div id="listoptions" class="propform popupdialog" data-editable="true" role="dialog" aria-labelledby="aria-label-listoptions" aria-hidden="true">
diff --git a/plugins/kolab_files/skins/larry/templates/message_plugin.html b/plugins/kolab_files/skins/larry/templates/message_plugin.html
index 26c2525..215d333 100644
--- a/plugins/kolab_files/skins/larry/templates/message_plugin.html
+++ b/plugins/kolab_files/skins/larry/templates/message_plugin.html
@@ -20,6 +20,7 @@
 
 <div id="files-folder-auth-dialog" role="dialog" aria-labelledby="aria-label-folderauthform" aria-hidden="true">
     <h3 id="aria-label-folderauthform" class="voice"><roundcube:label name="kolab_files.arialabelfolderauthform" /></h3>
+    <roundcube:object name="folder-auth-options">
 </div>
 
 <script src="plugins/kolab_files/skins/larry/ui.js" type="text/javascript"></script>




More information about the commits mailing list