openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 13215a8d73fc5997be5d1a4aa22e89d7a843fb25
parent 148fe7d2d156956ac04ef3fd75f03258a0664215
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 28 Nov 2017 22:09:28 +0100

Komponente "set" umgestellt auf eine Klasse.

Diffstat:
themes/default/include/html/set/Set.class.php | 27+++++++++++++++++++++++++++
themes/default/include/html/set/set-begin.inc.php | 12------------
2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/themes/default/include/html/set/Set.class.php b/themes/default/include/html/set/Set.class.php @@ -0,0 +1,26 @@ +<?php + +class SetComponent extends Component +{ + public $var; + public $value; + public $key; + + protected function begin() + { + if (!empty($this->value)) + { + if (!empty($this->key)) + echo '<?php $'.$this->value($this->var).'= '.$this->value($this->value).'['.$this->value($this->key).']; ?>'; + else + echo '<?php $'.$this->value($this->var).'= '.$this->value($this->value).'; ?>'; + } + else { + // Unset + echo '<?php unset($'.$this->value($this->var).') ?>'; + } + } +} + + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/set/set-begin.inc.php b/themes/default/include/html/set/set-begin.inc.php @@ -1,11 +0,0 @@ -<?php - #IF-ATTR value# - if (isset($attr_key)) - $$attr_var = $attr_value[$attr_key]; - else - $$attr_var = $attr_value; - #ELSE# - if (!isset($attr_value)) - unset($$attr_var); - #END-IF# -?>- \ No newline at end of file