Overview

Packages

  • Horde
    • Form
    • MIME
      • Viewer
    • Scheduler
  • None
  • Whups
    • UnitTests

Classes

  • Horde_Core_Ui_VarRenderer_whups
  • Whups
  • Whups_Ajax_Imple_ContactAutoCompleter
  • Whups_Api
  • Whups_Driver
  • Whups_Driver_Sql
  • Whups_Form_AddComment
  • Whups_Form_Admin_AddAttribute
  • Whups_Form_Admin_AddPriority
  • Whups_Form_Admin_AddQueue
  • Whups_Form_Admin_AddReply
  • Whups_Form_Admin_AddState
  • Whups_Form_Admin_AddType
  • Whups_Form_Admin_AddUser
  • Whups_Form_Admin_AddVersion
  • Whups_Form_Admin_CloneType
  • Whups_Form_Admin_DefaultPriority
  • Whups_Form_Admin_DefaultState
  • Whups_Form_Admin_DeleteAttribute
  • Whups_Form_Admin_DeletePriority
  • Whups_Form_Admin_DeleteQueue
  • Whups_Form_Admin_DeleteReply
  • Whups_Form_Admin_DeleteState
  • Whups_Form_Admin_DeleteType
  • Whups_Form_Admin_DeleteVersion
  • Whups_Form_Admin_EditAttributeStepOne
  • Whups_Form_Admin_EditAttributeStepTwo
  • Whups_Form_Admin_EditPriorityStepOne
  • Whups_Form_Admin_EditPriorityStepTwo
  • Whups_Form_Admin_EditQueueStepOne
  • Whups_Form_Admin_EditQueueStepTwo
  • Whups_Form_Admin_EditReplyStepOne
  • Whups_Form_Admin_EditReplyStepTwo
  • Whups_Form_Admin_EditStateStepOne
  • Whups_Form_Admin_EditStateStepTwo
  • Whups_Form_Admin_EditTypeStepOne
  • Whups_Form_Admin_EditTypeStepTwo
  • Whups_Form_Admin_EditUser
  • Whups_Form_Admin_EditVersionStepOne
  • Whups_Form_Admin_EditVersionStepTwo
  • Whups_Form_InsertBranch
  • Whups_Form_Query_AttributeCriterion
  • Whups_Form_Query_ChooseNameForLoad
  • Whups_Form_Query_ChooseNameForSave
  • Whups_Form_Query_DateCriterion
  • Whups_Form_Query_Delete
  • Whups_Form_Query_GroupCriterion
  • Whups_Form_Query_Parameter
  • Whups_Form_Query_PropertyCriterion
  • Whups_Form_Query_TextCriterion
  • Whups_Form_Query_UserCriterion
  • Whups_Form_Renderer_Comment
  • Whups_Form_Search
  • Whups_Form_SendReminder
  • Whups_Form_Ticket_CreateStepFour
  • Whups_Form_Ticket_CreateStepOne
  • Whups_Form_Ticket_CreateStepThree
  • Whups_Form_Ticket_CreateStepTwo
  • Whups_Form_Ticket_Edit
  • Whups_Form_TicketDetails
  • Whups_LoginTasks_SystemTask_Upgrade
  • Whups_Mail
  • Whups_Query
  • Whups_Query_Manager
  • Whups_Reports
  • Whups_Ticket
  • Whups_View_Base
  • Whups_View_Results
  • Whups_View_SavedQueries
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * This file contains all Horde_Form classes for attribute administration.
 4:  *
 5:  * Copyright 2002-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file LICENSE for license information (BSD). If you
 8:  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 9:  *
10:  * @author  Chuck Hagenbuch <chuck@horde.org>
11:  * @package Whups
12:  */
13: 
14: class Whups_Form_Admin_EditAttributeStepTwo extends Horde_Form
15: {
16:     public function __construct(&$vars)
17:     {
18:         parent::__construct($vars, _("Edit Attribute"));
19: 
20:         $attribute = $vars->get('attribute');
21: 
22:         $info = $GLOBALS['whups_driver']->getAttributeDesc($attribute);
23: 
24:         $this->addHidden('', 'type', 'int', true, true);
25:         $this->addHidden('', 'attribute', 'int', true, true);
26:         $pname = &$this->addVariable(
27:             _("Attribute Name"), 'attribute_name', 'text', true);
28:         $pname->setDefault($info['name']);
29:         $pdesc = &$this->addVariable(
30:             _("Attribute Description"), 'attribute_description', 'text', true);
31:         $pdesc->setDefault($info['description']);
32:         $preq = &$this->addVariable(
33:             _("Required Attribute?"), 'attribute_required', 'boolean', false);
34:         $preq->setDefault($info['required']);
35: 
36:         $ptype = &$this->addVariable(
37:             _("Attribute Type"), 'attribute_type', 'enum', true, false, null,
38:             array(Whups::fieldTypeNames()));
39:         $ptype->setAction(
40:             Horde_Form_Action::factory(
41:                 array('whups', 'whups_reload'),
42:                 array('formname' => 'whups_form_admin_editattributesteptwo_reload')));
43:         $ptype->setDefault($info['type']);
44: 
45:         $type = $vars->get('attribute_type');
46:         if (empty($type)) {
47:             $type = $info['type'];
48:         }
49:         foreach (Whups::fieldTypeParams($type) as $param => $param_info) {
50:             $pparam = &$this->addVariable(
51:                 $param_info['label'],
52:                 'attribute_params[' . $param . ']',
53:                 $param_info['type'],
54:                 false);
55:             if (isset($info['params'][$param])) {
56:                 $pparam->setDefault($info['params'][$param]);
57:             }
58:         }
59:     }
60: 
61: }
API documentation generated by ApiGen