Overview

Packages

  • None
  • Sam

Classes

  • Sam
  • Sam_Driver_Amavisd_Sql
  • Sam_Driver_Base
  • Sam_Driver_Spamd_Base
  • Sam_Driver_Spamd_Ftp
  • Sam_Driver_Spamd_Ldap
  • Sam_Driver_Spamd_Sql
  • Sam_Exception
  • Sam_Factory_Driver
  • Sam_Form_Blacklist
  • Sam_Form_List
  • Sam_Form_Options
  • Sam_Form_Whitelist
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Form class for address list management.
 4:  *
 5:  * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file COPYING for license information (GPL). If you
 8:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 9:  *
10:  * @author Max Kalika <max@horde.org>
11:  * @package Sam
12:  */
13: class Sam_Form_List extends Horde_Form
14: {
15:     protected $_attributes = array();
16: 
17:     public function __construct($vars, $title)
18:     {
19:         parent::__construct($vars, $title);
20:         $this->setButtons(_("Save"), true);
21: 
22:         try {
23:             $sam_driver = $GLOBALS['injector']->getInstance('Sam_Driver');
24:         } catch (Sam_Exception $e) {
25:             return;
26:         }
27: 
28:         foreach ($this->_attributes as $key => $attribute) {
29:             if (!$sam_driver->hasCapability($key)) {
30:                 continue;
31:             }
32: 
33:             $var = $this->addVariable($attribute, $key, 'longtext',
34:                                       false, false, null,
35:                                       array('5', '40'));
36:             $var->setHelp($key);
37: 
38:             if (!$vars->exists($key)) {
39:                 $vars->set($key, $sam_driver->getListOption($key));
40:             }
41:         }
42: 
43:         if ($sam_driver->hasCapability('global_defaults') &&
44:             $GLOBALS['registry']->isAdmin()) {
45:             $this->addVariable('', '', 'spacer', false);
46:             $var = $this->addVariable(_("Make Settings Global"),
47:                                       'global_defaults', 'boolean', false);
48:             $var->setHelp('global_defaults');
49:         }
50:     }
51: }
52: 
API documentation generated by ApiGen