From e019f2d0f2dc2fbfa345ab5d7ae85e67bfdd76b8 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 25 Sep 2010 09:03:53 -0400
Subject: [PATCH] - s/RoundCube/Roundcube/

---
 program/steps/addressbook/import.inc |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 1d5b00e..ac6dc92 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -4,8 +4,8 @@
  +-----------------------------------------------------------------------+
  | program/steps/addressbook/import.inc                                  |
  |                                                                       |
- | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland                 |
+ | This file is part of the Roundcube Webmail client                     |
+ | Copyright (C) 2008-2009, Roundcube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -25,11 +25,15 @@
 function rcmail_import_form($attrib)
 {
   global $RCMAIL, $OUTPUT;
+  $target = get_input_value('_target', RCUBE_INPUT_GPC);
   
   $attrib += array('id' => "rcmImportForm");
   
+  $abook = new html_hiddenfield(array('name' => '_target', 'value' => $target));
+  $form = $abook->show();
+
   $upload = new html_inputfield(array('type' => 'file', 'name' => '_file', 'id' => 'rcmimportfile', 'size' => 40));
-  $form = html::p(null, html::label('rcmimportfile', rcube_label('importfromfile')) . html::br() . $upload->show());
+  $form .= html::p(null, html::label('rcmimportfile', rcube_label('importfromfile')) . html::br() . $upload->show());
   
   $check_replace = new html_checkbox(array('name' => '_replace', 'value' => 1, 'id' => 'rcmimportreplace'));
   $form .= html::p(null, $check_replace->show(get_input_value('_replace', RCUBE_INPUT_GPC)) .
@@ -74,13 +78,14 @@
 function rcmail_import_buttons($attrib)
 {
   global $IMPORT_STATS, $OUTPUT;
+  $target = get_input_value('_target', RCUBE_INPUT_GPC);
   
   $attrib += array('type' => 'input');
   unset($attrib['name']);
   
   if (is_object($IMPORT_STATS)) {
     $attrib['class'] = trim($attrib['class'] . ' mainaction');
-    $out = $OUTPUT->button(array('command' => 'list', 'label' => 'done') + $attrib);
+    $out = $OUTPUT->button(array('command' => 'list', 'prop' => $target, 'label' => 'done') + $attrib);
   }
   else {
     $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib);
@@ -98,9 +103,9 @@
 $importstep = 'rcmail_import_form';
 
 if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'])) {
-
   $replace = (bool)get_input_value('_replace', RCUBE_INPUT_GPC);
-  $CONTACTS = $RCMAIL->get_address_book(null, true);
+  $target = get_input_value('_target', RCUBE_INPUT_GPC);
+  $CONTACTS = $RCMAIL->get_address_book($target, true);
 
   // let rcube_vcard do the hard work :-)
   $vcards = rcube_vcard::import(file_get_contents($_FILES['_file']['tmp_name']));
@@ -150,7 +155,7 @@
         'vcard' => $vcard->export(),
       );
       
-      $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $a_record, 'source' => null));
+      $plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $a_record, 'source' => null));
       $a_record = $plugin['record'];
 
       // insert record and send response
@@ -183,5 +188,3 @@
 
 // render page
 $OUTPUT->send('importcontacts');
-
-?>
\ No newline at end of file

--
Gitblit v1.9.1