| | |
| | | | program/steps/settings/edit_identity.inc | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2011, The Roundcube Dev Team | |
| | | | Copyright (C) 2005-2013, The Roundcube Dev Team | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | |
| | | |
| | | // edit-identity |
| | | if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') { |
| | | $IDENTITY_RECORD = $RCMAIL->user->get_identity(rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC)); |
| | | $id = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC); |
| | | $IDENTITY_RECORD = $RCMAIL->user->get_identity($id); |
| | | |
| | | if (is_array($IDENTITY_RECORD)) |
| | | if (is_array($IDENTITY_RECORD)) { |
| | | $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); |
| | | } |
| | | else { |
| | | $OUTPUT->show_message('dberror', 'error'); |
| | | // go to identities page |
| | |
| | | $IDENTITY_RECORD['email'] = $RCMAIL->get_user_email(); |
| | | } |
| | | } |
| | | |
| | | $OUTPUT->include_script('list.js'); |
| | | $OUTPUT->add_handler('identityform', 'rcube_identity_form'); |
| | | $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); |
| | | $OUTPUT->add_label('deleteidentityconfirm'); |
| | | |
| | | $OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'newidentity' : 'edititem'))); |
| | | |
| | | if ($RCMAIL->action == 'add-identity' && $OUTPUT->template_exists('identityadd')) { |
| | | $OUTPUT->send('identityadd'); |
| | | } |
| | | |
| | | $OUTPUT->send('identityedit'); |
| | | |
| | | |
| | | function rcube_identity_form($attrib) |
| | |
| | | 'content' => array( |
| | | 'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows, |
| | | 'spellcheck' => true), |
| | | 'html_signature' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('htmlsignature'), |
| | | 'html_signature' => array('type' => 'checkbox', |
| | | 'label' => $RCMAIL->gettext('htmlsignature'), |
| | | 'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'), |
| | | )) |
| | | ); |
| | |
| | | $out = "$form_start\n"; |
| | | |
| | | foreach ($form as $fieldset) { |
| | | if (empty($fieldset['content'])) |
| | | if (empty($fieldset['content'])) { |
| | | continue; |
| | | } |
| | | |
| | | $content = ''; |
| | | if (is_array($fieldset['content'])) { |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | foreach ($fieldset['content'] as $col => $colprop) { |
| | | $colprop['id'] = 'rcmfd_'.$col; |
| | | |
| | |
| | | $table->add('title', html::label($colprop['id'], rcube::Q($label))); |
| | | $table->add(null, $value); |
| | | } |
| | | |
| | | $content = $table->show($attrib); |
| | | } |
| | | else { |
| | | $content = $fieldset['content']; |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $content) ."\n"; |
| | | $content = html::tag('legend', null, rcube::Q($fieldset['name'])) . $content; |
| | | $out .= html::tag('fieldset', null, $content) . "\n"; |
| | | } |
| | | |
| | | $out .= $form_end; |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | $OUTPUT->include_script('list.js'); |
| | | $OUTPUT->add_handler('identityform', 'rcube_identity_form'); |
| | | $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); |
| | | $OUTPUT->add_label('deleteidentityconfirm'); |
| | | |
| | | $OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); |
| | | |
| | | if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('identityadd')) |
| | | $OUTPUT->send('identityadd'); |
| | | |
| | | $OUTPUT->send('identityedit'); |
| | | |
| | | |