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/edit.inc | 43 +++++++++++++++++-------------------------- 1 files changed, 17 insertions(+), 26 deletions(-) diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc index 71983fc..71c706f 100644 --- a/program/steps/addressbook/edit.inc +++ b/program/steps/addressbook/edit.inc @@ -4,8 +4,8 @@ +-----------------------------------------------------------------------+ | program/steps/addressbook/edit.inc | | | - | This file is part of the RoundCube Webmail client | - | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | + | This file is part of the Roundcube Webmail client | + | Copyright (C) 2005-2007, Roundcube Dev. - Switzerland | | Licensed under the GNU GPL | | | | PURPOSE: | @@ -43,8 +43,7 @@ } // add some labels to client - rcube_add_label('noemailwarning'); - rcube_add_label('nonamewarning'); + $OUTPUT->add_label('noemailwarning', 'nonamewarning'); list($form_start, $form_end) = get_form_tags($attrib); unset($attrib['form']); @@ -82,35 +81,27 @@ // similar function as in /steps/settings/edit_identity.inc function get_form_tags($attrib) - { +{ global $CONTACTS, $EDIT_FORM, $RCMAIL; - $result = $CONTACTS->get_result(); - $form_start = ''; - if (!strlen($EDIT_FORM)) - { - $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); - $hiddenfields->add(array('name' => '_action', 'value' => 'save', 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); - $hiddenfields->add(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC))); - $hiddenfields->add(array('name' => '_framed', 'value' => (empty($_REQUEST['_framed']) ? 0 : 1))); + $form_start = $form_end = ''; + + if (empty($EDIT_FORM)) { + $hiddenfields = new html_hiddenfield(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC))); + $hiddenfields->add(array('name' => '_gid', 'value' => $CONTACTS->group_id)); if (($result = $CONTACTS->get_result()) && ($record = $result->first())) $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID'])); - $form_start = !strlen($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : ''; - $form_start .= $hiddenfields->show(); - } - - $form_end = (strlen($EDIT_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; - $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form'; - - if (!strlen($EDIT_FORM)) - $RCMAIL->output->add_gui_object('editform', $form_name); - - $EDIT_FORM = $form_name; + $form_start = $RCMAIL->output->request_form(array('name' => "form", 'method' => "post", 'task' => $RCMAIL->task, 'action' => 'save', 'request' => 'save.'.intval($record['ID']), 'noclose' => true) + $attrib, $hiddenfields->show()); + $form_end = !strlen($attrib['form']) ? '</form>' : ''; + + $EDIT_FORM = !empty($attrib['form']) ? $attrib['form'] : 'form'; + $RCMAIL->output->add_gui_object('editform', $EDIT_FORM); + } return array($form_start, $form_end); - } +} @@ -119,4 +110,4 @@ // this will be executed if no template for addcontact exists $OUTPUT->send('editcontact'); -?> + -- Gitblit v1.9.1