<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:    block function
 * Name:    center
 * Version:    0.1
 * Date:    2003-02-13
 * Author:    Joscha Feth, joscha@feth.com
 * Purpose: centers the input vertically and horizontally.
 * Usage:    In the template, use {center}something{/center}    
 * Params:    none
 * Install: Drop into the plugin directory, call 
 *          $smarty->load_filter('output','trimwhitespace');
 *          from application.
 * -------------------------------------------------------------
 */
function smarty_block_center($params$content, &$this)
{
    if(
$content == null) {
        return 
true;
    }
    
?>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> 
    <tr> 
        <td align="center" valign="middle">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <?php    echo $content;    ?>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table> 
<?php
}
?>