summaryrefslogtreecommitdiff
path: root/plugins/kolab_files/lib/kolab_files_engine.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-04-03 13:37:13 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-04-03 13:37:13 (GMT)
commit00df84f76bb9ac52d12a1d90370591c66990266b (patch)
tree3b39dd8e299a3372a933889dbb69868fa13575a4 /plugins/kolab_files/lib/kolab_files_engine.php
parentdaa307c6af6c1d974c79e50ddd38c95c84f74782 (diff)
downloadroundcubemail-plugins-kolab-00df84f76bb9ac52d12a1d90370591c66990266b.tar.gz
Added folder creation form, other improvements/cleanups
Diffstat (limited to 'plugins/kolab_files/lib/kolab_files_engine.php')
-rw-r--r--plugins/kolab_files/lib/kolab_files_engine.php40
1 files changed, 18 insertions, 22 deletions
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index 4a87080..6b3993e 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -91,14 +91,14 @@ class kolab_files_engine
$this->rc->output->set_env('files_url', $this->url . '/api/');
$this->rc->output->set_env('files_token', $this->get_api_token());
- if ($this->rc->task != 'files') {
- // register template objects for dialogs
- $this->rc->output->add_handlers(array(
- 'folder-create-form' => array($this, 'folder_create_form'),
- 'file-search-form' => array($this, 'file_search_form'),
- 'filelist' => array($this, 'file_list'),
- ));
+ // register template objects for dialogs (and main interface)
+ $this->rc->output->add_handlers(array(
+ 'folder-create-form' => array($this, 'folder_create_form'),
+ 'file-search-form' => array($this, 'file_search_form'),
+ 'filelist' => array($this, 'file_list'),
+ ));
+ if ($this->rc->task != 'files') {
// add dialog content at the end of page body
$this->rc->output->add_footer(
$this->rc->output->parse('kolab_files.' . $template, false, false));
@@ -130,7 +130,7 @@ class kolab_files_engine
}
/**
- * Template object for folder creation form in "Save as" dialog
+ * Template object for folder creation form
*/
public function folder_create_form($attrib)
{
@@ -139,19 +139,23 @@ class kolab_files_engine
$attrib['id'] = 'folder-create-form';
}
- $input_name = new html_inputfield(array('name' => 'folder_name'));
- $out = $input_name->show();
+ $input_name = new html_inputfield(array('id' => 'folder-name', 'name' => 'name', 'size' => 30));
+ $select_parent = new html_select(array('id' => 'folder-parent', 'name' => 'parent'));
+ $table = new html_table(array('cols' => 2, 'class' => 'propform'));
+
+ $table->add('title', html::label('folder-name', Q($this->plugin->gettext('foldername'))));
+ $table->add(null, $input_name->show());
+ $table->add('title', html::label('folder-parent', Q($this->plugin->gettext('folderinside'))));
+ $table->add(null, $select_parent->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'));
+ $out = $table->show();
// add form tag around text field
if (empty($attrib['form'])) {
$out = $this->rc->output->form_tag($attrib, $out);
}
- $this->rc->output->add_label('kolab_files.foldercreating');
-
+ $this->rc->output->add_label('kolab_files.foldercreating', 'kolab_files.create');
$this->rc->output->add_gui_object('folder-create-form', $attrib['id']);
return $out;
@@ -452,14 +456,6 @@ class kolab_files_engine
protected function action_index()
{
- // register template objects
- $this->rc->output->add_handlers(array(
-// 'folderlist' => array($this, 'folder_list'),
- 'filelist' => array($this, 'file_list'),
- 'file-search-form' => array($this, 'file_search_form'),
- ));
-
-
$this->rc->output->add_label('deletefolderconfirm', 'kolab_files.folderdeleting',
'kolab_files.foldercreating', 'kolab_files.uploading', 'kolab_files.filedeleteconfirm',
'kolab_files.folderdeleteconfirm', 'kolab_files.filedeleting', 'kolab_files.filedeletenotice',