| | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2007, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | | | See the README file for a full license statement. | |
| | | | | |
| | | | PURPOSE: | |
| | | | Show edit form for a contact entry or to add a new one | |
| | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | | if ($RCMAIL->action == 'edit') { |
| | |
| | | $OUTPUT->set_env('cid', $record['ID']); |
| | | } |
| | | |
| | | // adding not allowed here |
| | | if ($CONTACTS->readonly) { |
| | | // editing not allowed here |
| | | if ($CONTACTS->readonly || $record['readonly']) { |
| | | $OUTPUT->show_message('sourceisreadonly'); |
| | | rcmail_overwrite_action('show'); |
| | | return; |
| | |
| | | |
| | | $form = array( |
| | | 'contact' => array( |
| | | 'name' => rcube_label('contactproperties'), |
| | | 'name' => rcube_label('properties'), |
| | | 'content' => array( |
| | | 'email' => array('size' => $i_size, 'visible' => true), |
| | | 'phone' => array('size' => $i_size, 'visible' => true), |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Register container as active area to drop photos onto |
| | | */ |
| | | function rcmail_photo_drop_area($attrib) |
| | | { |
| | | global $OUTPUT; |
| | | |
| | | if ($attrib['id']) { |
| | | $OUTPUT->add_gui_object('filedrop', $attrib['id']); |
| | | $OUTPUT->set_env('filedrop', array('action' => 'upload-photo', 'fieldname' => '_photo', 'single' => 1, 'filter' => '^image/.+')); |
| | | } |
| | | } |
| | | |
| | | |
| | | $OUTPUT->add_handlers(array( |
| | | 'contactedithead' => 'rcmail_contact_edithead', |
| | | 'contacteditform' => 'rcmail_contact_editform', |
| | | 'contactphoto' => 'rcmail_contact_photo', |
| | | 'photouploadform' => 'rcmail_upload_photo_form', |
| | | 'sourceselector' => 'rcmail_source_selector', |
| | | 'filedroparea' => 'rcmail_photo_drop_area', |
| | | )); |
| | | |
| | | if ($RCMAIL->action == 'add' && $OUTPUT->template_exists('contactadd')) |