<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


function smarty_function_unescaped_form_errors($params, &$smarty)
{
    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');

    $error_list = null;

    foreach($params as $_key => $_val) {
        switch($_key) {
            case 'error_list':
                $$_key = (array)$_val;
                break;
        }
    }

    if (!isset($error_list) || !is_array($error_list) || count( $error_list ) <= 0 )
        return ''; /* raise error here? */

    $_html_result = '';

    $_html_result = '<b>Es sind folgende Fehler aufgetreten:</b><ul style="margin-top: 0;">';

    foreach ($error_list as $_val)
        $_html_result .= '<li>'.$_val.'</li>';

    $_html_result .= '</ul>';

    return $_html_result;

}

/* vim: set expandtab: */

?>