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 creating 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_CreateAddressBook class provides the form for
13:  * creating an address book.
14:  *
15:  * @author  Chuck Hagenbuch <chuck@horde.org>
16:  * @package Turba
17:  */
18: class Turba_Form_CreateAddressBook extends Horde_Form
19: {
20:     public function __construct($vars)
21:     {
22:         parent::__construct($vars, _("Create Address Book"));
23: 
24:         $this->addVariable(_("Name"), 'name', 'text', true);
25:         $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
26: 
27:         $this->setButtons(array(_("Create")));
28:     }
29: 
30:     /**
31:      * @throws Turba_Exception
32:      */
33:     public function execute()
34:     {
35:         // Need a clean cfgSources array
36:         $cfgSources = Turba::availableSources();
37: 
38:         $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($cfgSources[$GLOBALS['conf']['shares']['source']]);
39: 
40:         $params = array(
41:             'params' => array('source' => $GLOBALS['conf']['shares']['source']),
42:             'name' => $this->_vars->get('name'),
43:             'desc' => $this->_vars->get('description'),
44:         );
45:         return $driver->createShare(strval(new Horde_Support_Randomid()), $params);
46:     }
47: 
48: }
49: 
API documentation generated by ApiGen