summaryrefslogblamecommitdiffstats
path: root/inc/message.inc.php
blob: 9409db950a87d2ff79a47c26e26ae62629b490e6 (plain) (tree)




























                                                                                                                         
<?php

// TODO: Move to extra file
$error_text = array(
	'loginfail'      => 'Benutzername oder Kennwort falsch',
	'token'          => 'Ungültiges Token. CSRF Angriff?',
);

class Message
{
	private static $list = array();

	public static function addError($id)
	{
		self::$list[] = array(
			'type' => 'error',
			'id'    => $id
		);
	}

	public static function renderList()
	{
		foreach (self::$list as $item) {
			Render::addTemplate('messagebox-' . $item['type'], array('message' => $error_text[$item['id']]));
		}
	}

}