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:
<?php
/**
* Form control creating a section in a form for an object derived from icms_ipf_Object
*
* @copyright The ImpressCMS Project http://www.impresscms.org/
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @category ICMS
* @package ipf
* @subpackage form
* @since 1.1
* @author marcan <marcan@impresscms.org>
* @version $Id: Section.php 10851 2010-12-05 19:15:30Z phoenyx $
*/
defined('ICMS_ROOT_PATH') or die("ImpressCMS root path not defined");
class icms_ipf_form_elements_Section extends icms_form_Element {
/**
* @var string
* @access private
*/
private $_value;
/**
*
* @var bool
* @access private
*/
private $_close;
/**
* Constructor
*
* @param icms_ipf_Object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key name of the form section
*/
public function __construct($object, $key) {
$control = $object->getControl($key);
$this->setName($key);
$this->_value = $object->vars[$key]['value'];
$this->_close = isset($control['close']) ? $control['close'] : FALSE;
}
/**
* Get the text
*
* @return string
*/
public function getValue() {
return $this->_value;
}
/**
* Get the section type (opener / closer)
*
* @return bool
*/
public function isClosingSection() {
return $this->_close;
}
/**
* Prepare HTML for output
*
* @return string
*/
public function render() {
if ($this->_close) return;
return $this->getValue();
}
}