[Svn] r3930 - trunk/plugins/enigma/lib

trac at roundcube.net trac at roundcube.net
Tue Aug 31 09:22:44 CEST 2010


Author: alec
Date: 2010-08-31 02:22:44 -0500 (Tue, 31 Aug 2010)
New Revision: 3930

Modified:
   trunk/plugins/enigma/lib/enigma_ui.php
Log:
- Enigma: Refresh list after key import


Modified: trunk/plugins/enigma/lib/enigma_ui.php
===================================================================
--- trunk/plugins/enigma/lib/enigma_ui.php	2010-08-31 07:06:36 UTC (rev 3929)
+++ trunk/plugins/enigma/lib/enigma_ui.php	2010-08-31 07:22:44 UTC (rev 3930)
@@ -234,12 +234,12 @@
      */
     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 @@
                     'to'    => $first + $curr_count,
                     'count' => $all)
             ));
+        }
 
         return $out;
     }
@@ -346,13 +347,16 @@
             $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 @@
     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 @@
             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']);
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list