45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
class default_list extends \SYSTEM\PAGE\Page {
|
|
|
|
var $filter = null;
|
|
public function __construct($filter) {
|
|
new \SYSTEM\LOG\INFO($filter);
|
|
$this->filter = $filter;
|
|
}
|
|
|
|
private function switch_filter($filter){
|
|
switch($filter){
|
|
case 1:
|
|
return '%';
|
|
case 2:
|
|
return '"%Überwachung%"';
|
|
default:
|
|
return 'filter fail';}
|
|
|
|
}
|
|
|
|
public function generate_list(){
|
|
$result = '';
|
|
$tag = $this->filter;
|
|
$elements = elements::getAllElementsOfTag($this->switch_filter($tag));
|
|
foreach($elements as $element){
|
|
$element['title'] = $element['id'];
|
|
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_list/element.tpl'), $element);
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
public function html(){
|
|
$vars = array();
|
|
$vars['content'] = $this->generate_list();
|
|
new SYSTEM\LOG\INFO(print_r($vars['content']), TRUE);
|
|
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_list/default_list.tpl'), $vars);
|
|
}
|
|
}
|
|
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|