<?php
class default_list implements \SYSTEM\PAGE\Page {
    var $tag = null;
    public function __construct($tag = null) {
        $this->tag = $tag;}

    public static function title(){
        return null;}
    public static function meta(){
        return array();}
        
    public static function css(){
        return array();}

    public static function js(){
        return array(   new PPAGE('default_list/js/default_list.js'));}
    
    private static function switch_list_title($tag){
        switch($tag){
            case 'nsa':
                return 'Überwachungsstaat';
            case 'ungleichheit':
                return 'Ungerechtigkeiten';
            case 'korruption':
                return 'Filz und Vetternwirtschaft';
            case 'polizei':
                return 'Dein Freund und Helfer';
            case 'demokratie':
                return 'Demokratie';
            case 'fof':
                return 'Foes of Freedom';
            case 'matrixintern':
                return 'Über Neopolimatrix';
            case 'youtube':
                return 'Videos';
            default:
                return 'Neuheiten';
        }
    }
    
    public function html(){
        $vars = array();
        $vars['title'] = self::switch_list_title($this->tag);
        $vars['list'] = '';
        $elements = \SYSTEM\PAGE\text::tag_adv($this->tag ? $this->tag : 'neopolimatrix');
        foreach($elements as $element){
            $vars['list'] .= article::preview($element);}
        $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
        return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_list/tpl/default_list.tpl'))->SERVERPATH(), $vars);
    }
}
