diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js index 898a6828..57e36a55 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 bbcd666e..d319fe74 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'])) { @@ -258,6 +259,23 @@ class kolab_files_engine return $out; } + /** + * 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 */ diff --git a/plugins/kolab_files/localization/en_US.inc b/plugins/kolab_files/localization/en_US.inc index 3ecd1fce..9ddecefb 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: $file.'; +$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 de0735c1..526395e1 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 ceb56cce..e4d0a156 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 @@
diff --git a/plugins/kolab_files/skins/larry/templates/files.html b/plugins/kolab_files/skins/larry/templates/files.html index e33d1d09..4494e3e2 100644 --- a/plugins/kolab_files/skins/larry/templates/files.html +++ b/plugins/kolab_files/skins/larry/templates/files.html @@ -82,6 +82,7 @@