Overview

Packages

  • Horde
    • Data
  • None
  • Turba

Classes

  • Turba
  • Turba_Api
  • Turba_Driver
  • Turba_Driver_Facebook
  • Turba_Driver_Favourites
  • Turba_Driver_Group
  • Turba_Driver_Imsp
  • Turba_Driver_Kolab
  • Turba_Driver_Ldap
  • Turba_Driver_Prefs
  • Turba_Driver_Share
  • Turba_Driver_Sql
  • Turba_Driver_Vbook
  • Turba_Exception
  • Turba_Factory_Driver
  • Turba_Form_AddContact
  • Turba_Form_Contact
  • Turba_Form_ContactBase
  • Turba_Form_CreateAddressBook
  • Turba_Form_DeleteAddressBook
  • Turba_Form_EditAddressBook
  • Turba_Form_EditContact
  • Turba_Form_EditContactGroup
  • Turba_List
  • Turba_LoginTasks_SystemTask_Upgrade
  • Turba_Object
  • Turba_Object_Group
  • Turba_Test
  • Turba_View_Browse
  • Turba_View_Contact
  • Turba_View_DeleteContact
  • Turba_View_Duplicates
  • Turba_View_EditContact
  • Turba_View_List
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Horde_Form for editing address books.
 4:  *
 5:  * See the enclosed file LICENSE for license information (ASL). If you
 6:  * did not receive this file, see http://www.horde.org/licenses/apache.
 7:  *
 8:  * @package Turba
 9:  */
10: 
11: /**
12:  * The Turba_Form_EditAddressBook class provides the form for
13:  * editing an address book.
14:  *
15:  * @author  Chuck Hagenbuch <chuck@horde.org>
16:  * @package Turba
17:  */
18: class Turba_Form_EditAddressBook extends Horde_Form
19: {
20:     /**
21:      * Address book being edited
22:      *
23:      * @var Horde_Share_Object
24:      */
25:     protected $_addressbook;
26: 
27:     public function __construct($vars, Horde_Share_Object $addressbook)
28:     {
29:         $this->_addressbook = $addressbook;
30:         parent::__construct($vars, sprintf(_("Edit %s"), $addressbook->get('name')));
31: 
32:         $this->addHidden('', 'a', 'text', true);
33:         $this->addVariable(_("Name"), 'name', 'text', true);
34:         $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
35: 
36:         $this->setButtons(array(_("Save")));
37:     }
38: 
39:     public function execute()
40:     {
41:         $this->_addressbook->set('name', $this->_vars->get('name'));
42:         $this->_addressbook->set('desc', $this->_vars->get('description'));
43:         try {
44:             $this->_addressbook->save();
45:             return true;
46:         } catch (Horde_Share_Exception $e) {
47:             throw new Turba_Exception(sprintf(_("Unable to save address book \"%s\": %s"), $this->_vars->get('name'), $e->getMessage()));
48:         }
49:     }
50: 
51: }
52: 
API documentation generated by ApiGen