openrat-cms

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

commit 7d676c7a4835fd7dba303d704f5a9a6c893bcd1e
parent bf29352645fc41e1392abae2a2775a32e20900db
Author: Jan Dankert <devnull@localhost>
Date:   Sat,  2 Dec 2017 00:17:44 +0100

Komponente "list" umgestellt auf eine Klasse.

Diffstat:
themes/default/include/html/list/List.class.php | 29+++++++++++++++++++++++++++++
themes/default/include/html/list/list-begin.inc.php | 26--------------------------
themes/default/include/html/list/list-end.inc.php | 3---
3 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/themes/default/include/html/list/List.class.php b/themes/default/include/html/list/List.class.php @@ -0,0 +1,28 @@ +<?php + +class ListComponent extends Component +{ + + public $list; + + public $extract = false; + + public $key = 'list_key'; + + public $value = 'list_value'; + + public function begin() + { + echo '<?php foreach($' . $this->varname($this->list) . ' as $' . $this->varname($this->key) . '=>$' . $this->varname($this->value) . '){ ?>'; + + if ($this->extract) + echo '<?php extract($' . $this->varname($this->value) . ') ?>'; + } + + public function end() + { + echo '<?php } ?>'; + } +} + +?>+ \ No newline at end of file diff --git a/themes/default/include/html/list/list-begin.inc.php b/themes/default/include/html/list/list-begin.inc.php @@ -1,25 +0,0 @@ -<?php -//-- - $attr_list_tmp_key = $attr_key; - $attr_list_tmp_value = $attr_value; - $attr_list_extract = $attr_extract; - unset($attr_key); - unset($attr_value); - - if ( !isset($$attr_list) || !is_array($$attr_list) ) - $$attr_list = array(); - - foreach( $$attr_list as $$attr_list_tmp_key => $$attr_list_tmp_value ) - { - if ( $attr_list_extract ) - { - if ( !is_array($$attr_list_tmp_value) ) - { - print_r($$attr_list_tmp_value); - die( 'not an array at key: '.$$attr_list_tmp_key ); - } - extract($$attr_list_tmp_value); - } - - /* Diese Zeile wird ignoriert */ } -?>- \ No newline at end of file diff --git a/themes/default/include/html/list/list-end.inc.php b/themes/default/include/html/list/list-end.inc.php @@ -1,2 +0,0 @@ -/* Ignore: */ <?php { ?> -<?php } ?>- \ No newline at end of file