Overview

Packages

  • None
  • Sesha

Classes

  • Horde_Core_UI_VarRenderer_Stockedit_Html
  • Sesha
  • Sesha_Api
  • Sesha_Driver
  • Sesha_Driver_Sql
  • Sesha_Exception
  • Sesha_Forms_Category
  • Sesha_Forms_CategoryDelete
  • Sesha_Forms_CategoryList
  • Sesha_Forms_Property
  • Sesha_Forms_PropertyDelete
  • Sesha_Forms_PropertyList
  • Sesha_Forms_Search
  • Sesha_Forms_Stock
  • Sesha_Forms_Type_Client
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Copyright 2004-2011 Horde LLC (http://www.horde.org/)
 4:  *
 5:  * See the enclosed file LICENSE for license information (GPL). If you
 6:  * did not receive this file, see http://www.horde.org/licenses/gpl.php.
 7:  *
 8:  * @author  Bo Daley <bo@darkwork.net>
 9:  * @package Sesha
10:  */
11: class Sesha_Forms_CategoryList extends Horde_Form {
12: 
13:     function __construct($vars)
14:     {
15:         parent::__construct($vars);
16:         // This is probably wrong. The library should get the driver 
17:         // or the properties passed
18:         $sesha_driver = $GLOBALS['injector']->getInstance('Sesha_Factory_Driver')->create();
19:         $this->setButtons(array(_("Edit Category"),
20:                                 _("Delete Category")));
21:         $categories = $sesha_driver->getCategories();
22:         $params = array();
23:         foreach ($categories as $category) {
24:             $params[$category['category_id']] = $category['category'];
25:         }
26:         $title = !empty($title) ? $title : _("Edit a category");
27:         $this->setTitle($title);
28: 
29:         $this->addHidden('', 'actionID', 'text', false, false, null, array('edit_category'));
30:         if (!count($params)) {
31:             $fieldtype = 'invalid';
32:             $params = _("No categories are currently configured. Use the form below to add one.");
33:         } else {
34:             $fieldtype = 'enum';
35:         }
36:         $this->addVariable(_("Category"), 'category_id', $fieldtype, true, false, null, array($params));
37:     }
38: }
39: 
API documentation generated by ApiGen