/usr/share/php/Horde/View/Helper/Form/Builder.php is in php-horde-view 2.0.6-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | <?php
/**
* Copyright 2007-2008 Maintainable Software, LLC
* Copyright 2008-2016 Horde LLC (http://www.horde.org/)
*
* @author Mike Naberezny <mike@maintainable.com>
* @author Derek DeVries <derek@maintainable.com>
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/bsd
* @category Horde
* @package View
* @subpackage Helper
*/
/**
* @author Mike Naberezny <mike@maintainable.com>
* @author Derek DeVries <derek@maintainable.com>
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/bsd
* @category Horde
* @package View
* @subpackage Helper
*/
class Horde_View_Helper_Form_Builder
{
private $_objectName;
private $_object;
private $_view;
private $_options;
private $_end;
public function __construct($objectName, $object, $view, $options)
{
$this->_objectName = $objectName;
$this->_object = $object;
$this->_view = $view;
$this->_end = isset($options['end']) ? $options['end'] : '';
unset($options['end']);
$this->_options = $options;
}
public function __call($method, $args)
{
if (empty($args)) {
throw new InvalidArgumentException('No object property specified');
}
$objectProperty = $args[0];
$options = array_merge(isset($args[1]) ? $args[1] : array(),
array('object' => $this->_object));
return $this->_view->{$method}($this->_objectName, $objectProperty, $options);
}
public function fieldsFor($name)
{
$name = "{$this->_objectName}[$name]";
$args = func_get_args();
$args[0] = $name;
return call_user_func_array(array($this->_view, 'fieldsFor'), $args);
}
public function checkBox($method, $options = array(), $checkedValue = '1',
$uncheckedValue = '0')
{
$options = array_merge($options, array('object' => $this->_object));
return $this->_view->checkBox($this->_objectName, $method, $options, $checkedValue, $uncheckedValue);
}
public function radioButton($method, $tagValue, $options = array())
{
$options = array_merge($options, array('object' => $this->_object));
return $this->_view->radioButton($this->_objectName, $method, $tagValue, $options);
}
public function submit($value = 'Save changes', $options = array())
{
$options = array_merge(array('id' => "{$this->_objectName}_submit"), $options);
return $this->_view->submitTag($value, $options);
}
public function end()
{
echo $this->_end;
}
}
|