Changeset 2450 in subversion


Ignore:
Timestamp:
May 4, 2009 2:53:56 AM (4 years ago)
Author:
alec
Message:
Location:
trunk/roundcubemail/program/steps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/addressbook/copy.inc

    r1712 r2450  
    2727  $TARGET = $RCMAIL->get_address_book($target); 
    2828 
    29   if ($TARGET && $TARGET->ready && !$TARGET->readonly) 
    30     $success = $TARGET->insert($CONTACTS->search($CONTACTS->primary_key, $cid), true); 
     29  if ($TARGET && $TARGET->ready && !$TARGET->readonly) { 
     30    $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->search($CONTACTS->primary_key, $cid), 'source' => $target)); 
     31    $a_record = $plugin['record']; 
     32 
     33    if (!$plugin['abort']) 
     34      $success = $TARGET->insert($CONTACTS->search($a_record, true); 
     35  } 
    3136 
    3237  if (empty($success)) 
  • trunk/roundcubemail/program/steps/addressbook/import.inc

    r2237 r2450  
    7676  global $IMPORT_STATS, $OUTPUT; 
    7777   
    78   $attrib += array('type' => "input"); 
     78  $attrib += array('type' => 'input'); 
    7979  unset($attrib['name']); 
    8080   
    8181  if (is_object($IMPORT_STATS)) { 
    8282    $attrib['class'] = trim($attrib['class'] . ' mainaction'); 
    83     $out = $OUTPUT->button(array('command' => "list", 'label' => "done") + $attrib); 
     83    $out = $OUTPUT->button(array('command' => 'list', 'label' => 'done') + $attrib); 
    8484  } 
    8585  else { 
    86     $out = $OUTPUT->button(array('command' => "list", 'label' => "cancel") + $attrib); 
     86    $out = $OUTPUT->button(array('command' => 'list', 'label' => 'cancel') + $attrib); 
    8787    $out .= ' '; 
    8888    $attrib['class'] = trim($attrib['class'] . ' mainaction'); 
    89     $out .= $OUTPUT->button(array('command' => "import", 'label' => "import") + $attrib); 
     89    $out .= $OUTPUT->button(array('command' => 'import', 'label' => 'import') + $attrib); 
    9090  } 
    9191   
     
    143143      } 
    144144       
    145       $success = $CONTACTS->insert(array( 
     145      $a_record = array( 
    146146        'name' => $vcard->displayname, 
    147147        'firstname' => $vcard->firstname, 
     
    149149        'email' => $email, 
    150150        'vcard' => $vcard->export(), 
    151       )); 
     151      ); 
    152152       
    153       if ($success) { 
     153      $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $a_record, 'source' => null)); 
     154      $a_record = $plugin['record']; 
     155 
     156      // insert record and send response 
     157      if (!$plugin['abort'] && ($success = $CONTACTS->insert($a_record))) { 
    154158        $IMPORT_STATS->inserted++; 
    155159        $IMPORT_STATS->names[] = $vcard->displayname; 
    156       } 
    157       else { 
     160      } else { 
    158161        $IMPORT_STATS->errors++; 
    159162      } 
     
    166169  if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { 
    167170    $OUTPUT->show_message('filesizeerror', 'error', array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))); 
    168   } 
    169   else { 
     171  } else { 
    170172    $OUTPUT->show_message('fileuploaderror', 'error'); 
    171173  } 
  • trunk/roundcubemail/program/steps/mail/addcontact.inc

    r2447 r2450  
    4444    else 
    4545    { 
    46       $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $contact, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); 
     46      $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $contact, 'source' => null)); 
    4747      $contact = $plugin['record']; 
    4848 
Note: See TracChangeset for help on using the changeset viewer.