summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-31 07:22:44 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-31 07:22:44 +0000
commit31702d86ce282f1ca681afed905a54531222a633 (patch)
treeb085b3be83b585b801dbd7d0e8c4ae8341e472b0 /plugins
parentab5a49d37c0be08bc1a84cea6bd5ddd946377e0a (diff)
- Enigma: Refresh list after key import
git-svn-id: https://svn.roundcube.net/trunk@3930 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/enigma/lib/enigma_ui.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php
index 9db7eab2e..552d865be 100644
--- a/plugins/enigma/lib/enigma_ui.php
+++ b/plugins/enigma/lib/enigma_ui.php
@@ -234,12 +234,12 @@ class enigma_ui
*/
private function get_rowcount_text($all=0, $curr_count=0, $page=1)
{
- $pagesize = $this->rc->config->get('pagesize', 100);
- $first = ($page - 1) * $pagesize;
-
if (!$curr_count)
$out = $this->enigma->gettext('nokeysfound');
- else
+ else {
+ $pagesize = $this->rc->config->get('pagesize', 100);
+ $first = ($page - 1) * $pagesize;
+
$out = $this->enigma->gettext(array(
'name' => 'keysfromto',
'vars' => array(
@@ -247,6 +247,7 @@ class enigma_ui
'to' => $first + $curr_count,
'count' => $all)
));
+ }
return $out;
}
@@ -346,13 +347,16 @@ class enigma_ui
$result = $this->enigma->engine->import_key($_FILES['_file']['tmp_name'], true);
if (is_array($result)) {
+ // reload list if any keys has been added
+ if ($result['imported']) {
+ $this->rc->output->command('parent.enigma_list', 1);
+ }
+ else
+ $this->rc->output->command('parent.enigma_loadframe');
+
$this->rc->output->show_message('enigma.keysimportsuccess', 'confirmation',
array('new' => $result['imported'], 'old' => $result['unchanged']));
- if ($result['imported']) {
- // @TODO: reload list if any keys has been added
- }
- $this->rc->output->command('parent.enigma_loadframe');
$this->rc->output->send('iframe');
}
else
@@ -381,7 +385,7 @@ class enigma_ui
function tpl_key_import_form($attrib)
{
$attrib += array('id' => 'rcmKeyImportForm');
-
+
$upload = new html_inputfield(array('type' => 'file', 'name' => '_file',
'id' => 'rcmimportfile', 'size' => 30));
@@ -389,7 +393,7 @@ class enigma_ui
Q($this->enigma->gettext('keyimporttext'), 'show')
. html::br() . html::br() . $upload->show()
);
-
+
$this->rc->output->add_label('selectimportfile', 'importwait');
$this->rc->output->add_gui_object('importform', $attrib['id']);