commit 9221f76743aaa03db7fae2dc12560b53df7a2587 parent 526e609c79968a5e7f2da26b0bb0b4bd352bcbca Author: Jan Dankert <devnull@localhost> Date: Sat, 2 Dec 2017 01:14:33 +0100 Komponente "hidden" umgestellt auf eine Klasse. Diese Komponente ist leer. Diffstat:
themes/default/include/html/hidden/Hidden.class.php | | | 28 | ++++++++++++++++++++++++++++ |
themes/default/include/html/hidden/hidden-begin.inc.php | | | 9 | --------- |
2 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/themes/default/include/html/hidden/Hidden.class.php b/themes/default/include/html/hidden/Hidden.class.php @@ -0,0 +1,27 @@ +<?php + +class HiddenComponent extends Component +{ + + public $name; + + public $default; + + public function begin() + { + echo '<input'; + echo ' type="hidden"'; + echo ' name="' . $this->htmlvalue($this->name) . '"'; + echo ' value="'; + + if (isset($this->default)) + echo $this->htmlvalue($this->default); + else + echo '<?php echo $' . $this->varname($this->name) . ' ?>'; + + echo '"'; + echo '/>'; + } +} + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/hidden/hidden-begin.inc.php b/themes/default/include/html/hidden/hidden-begin.inc.php @@ -1,8 +0,0 @@ -<?php -if (isset($$attr_name)) - $attr_tmp_value = $$attr_name; -elseif ( isset($attr_default) ) - $attr_tmp_value = $attr_default; -else - $attr_tmp_value = ""; -?><input type="hidden" name="<?php echo $attr_name ?>" value="<?php echo $attr_tmp_value ?>" />- \ No newline at end of file