Overview

Packages

  • Mnemo
  • None

Classes

  • Mnemo
  • Mnemo_Ajax_Application
  • Mnemo_Ajax_Imple_EditNote
  • Mnemo_Api
  • Mnemo_Driver
  • Mnemo_Driver_Kolab
  • Mnemo_Driver_Sql
  • Mnemo_Exception
  • Mnemo_Factory_Driver
  • Mnemo_Factory_Notepads
  • Mnemo_Form_CreateNotepad
  • Mnemo_Form_DeleteNotepad
  • Mnemo_Form_EditNotepad
  • Mnemo_Notepads_Base
  • Mnemo_Notepads_Default
  • Mnemo_Notepads_Kolab
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Horde_Form for creating notepads.
 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 Mnemo
 9:  */
10: /**
11:  * The Mnemo_Form_CreateNotepad class provides the form for creating a notepad.
12:  *
13:  * @author  Chuck Hagenbuch <chuck@horde.org>
14:  * @package Mnemo
15:  */
16: class Mnemo_Form_CreateNotepad extends Horde_Form
17: {
18:     public function __construct(&$vars)
19:     {
20:         parent::__construct($vars, _("Create Notepad"));
21: 
22:         $this->addVariable(_("Name"), 'name', 'text', true);
23:         $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
24: 
25:         $this->setButtons(array(_("Create")));
26:     }
27: 
28:     public function execute()
29:     {
30:         // Create new share.
31:         try {
32:             $notepad = $GLOBALS['mnemo_shares']->newShare($GLOBALS['registry']->getAuth(), strval(new Horde_Support_Uuid()), $this->_vars->get('name'));
33:         } catch (Horde_Share_Exception $e) {
34:             Horde::logMessage($e->getMessage(), 'ERR');
35:             throw new Mnemo_Exception($e);
36:         }
37:         $notepad->set('desc', $this->_vars->get('description'));
38:         return $GLOBALS['mnemo_shares']->addShare($notepad);
39:     }
40: 
41: }
42: 
API documentation generated by ApiGen