Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty plugin
Chris PeBenito 696b41
 * @package Smarty
Chris PeBenito 696b41
 * @subpackage plugins
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty assign_smarty_interface core plugin
Chris PeBenito 696b41
 *
Chris PeBenito 696b41
 * Type:     core
Chris PeBenito 696b41
 * Name:     assign_smarty_interface
Chris PeBenito 696b41
 * Purpose:  assign the $smarty interface variable
Chris PeBenito 696b41
 * @param array Format: null
Chris PeBenito 696b41
 * @param Smarty
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
function smarty_core_assign_smarty_interface($params, &$smarty)
Chris PeBenito 696b41
{
Chris PeBenito 696b41
        if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
Chris PeBenito 696b41
            return;
Chris PeBenito 696b41
        }
Chris PeBenito 696b41
Chris PeBenito 696b41
        $_globals_map = array('g'  => 'HTTP_GET_VARS',
Chris PeBenito 696b41
                             'p'  => 'HTTP_POST_VARS',
Chris PeBenito 696b41
                             'c'  => 'HTTP_COOKIE_VARS',
Chris PeBenito 696b41
                             's'  => 'HTTP_SERVER_VARS',
Chris PeBenito 696b41
                             'e'  => 'HTTP_ENV_VARS');
Chris PeBenito 696b41
Chris PeBenito 696b41
        $_smarty_vars_request  = array();
Chris PeBenito 696b41
Chris PeBenito 696b41
        foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
Chris PeBenito 696b41
            if (isset($_globals_map[$_c])) {
Chris PeBenito 696b41
                $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
Chris PeBenito 696b41
            }
Chris PeBenito 696b41
        }
Chris PeBenito 696b41
        $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
Chris PeBenito 696b41
Chris PeBenito 696b41
        $smarty->_smarty_vars['request'] = $_smarty_vars_request;
Chris PeBenito 696b41
}
Chris PeBenito 696b41
Chris PeBenito 696b41
/* vim: set expandtab: */
Chris PeBenito 696b41
Chris PeBenito 696b41
?>