summaryrefslogtreecommitdiff
path: root/plugins/kolab_files/lib/kolab_files_engine.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-02-21 12:27:38 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-02-21 12:27:38 (GMT)
commitfd3b78960ce0d49144903fb4f23e11e424d7bfa0 (patch)
tree6aca27cf82408d9e426c6c706624f1f8a1793e69 /plugins/kolab_files/lib/kolab_files_engine.php
parent581724f7c11b05fa79f5911d217f00ab9a605578 (diff)
downloadroundcubemail-plugins-kolab-fd3b78960ce0d49144903fb4f23e11e424d7bfa0.tar.gz
Add folder creation in Save as dialog
Diffstat (limited to 'plugins/kolab_files/lib/kolab_files_engine.php')
-rw-r--r--plugins/kolab_files/lib/kolab_files_engine.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index 893077d..84d34e8 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -63,6 +63,11 @@ class kolab_files_engine
}
if (!empty($template)) {
+ // register template objects
+ $this->rc->output->add_handlers(array(
+ 'folder-create-form' => array($this, 'folder_create_form'),
+ ));
+ // add dialog content at the end of page body
$this->rc->output->add_footer(
$this->rc->output->parse('kolab_files.' . $template, false, false));
}
@@ -83,6 +88,32 @@ class kolab_files_engine
}
/**
+ * Template object for folder creation form in "Save as" dialog
+ */
+ public function folder_create_form($attr)
+ {
+ $attrib['name'] = 'folder-create-form';
+ if (empty($attrib['id'])) {
+ $attrib['id'] = 'folder-create-form';
+ }
+
+ $input_name = new html_inputfield(array('name' => 'folder_name'));
+ $out = $input_name->show();
+
+// $input_parent = new html_checkbox(array('name' => 'folder_parent', 'checked' => true, 'value' => 1));
+// $out .= html::label(null, $input_parent->show() . $this->plugin->gettext('assubfolder'));
+
+ // add form tag around text field
+ if (empty($attrib['form'])) {
+ $out = $this->rc->output->form_tag($attrib, $out);
+ }
+
+ $this->rc->output->add_gui_object('folder-create-form', $attrib['id']);
+
+ return $out;
+ }
+
+ /**
* Get API token for current user session, authenticate if needed
*/
protected function get_api_token()
@@ -263,6 +294,8 @@ class kolab_files_engine
$this->rc->output->show_message($this->plugin->gettext('saveallerror', array('n' => $count)), 'error');
}
+ // @TODO: update quota indicator, make this optional in case files aren't stored in IMAP
+
$this->rc->output->send();
}