<?php

function smarty_function_web_version($params, &$smarty)
{
    $version = 'default';
    if (isset($_COOKIE['web_version'])) {
        switch ($_COOKIE['web_version']) {
            case '1':
                $version = 'desktop';
                break;
        }
    }

    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $version);
    } else {
        return $version;
    }
}
