summaryrefslogtreecommitdiff
path: root/lib/smarty-plugins/function.suit.php
blob: eb166d9c128cf811daa9312fd9ce80742925d9ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

function smarty_function_suit($params, &$smarty) {

    $params['color'] = strtolower($params['color']);

    static $entities = array(
                             'c' => '&clubs;',
                             'd' => '&diams;',
                             'h' => '&hearts;',
                             's' => '&spades;'
                             );
    static $colors = array(
                           'c' => 'black',
                           'd' => 'red',
                           'h' => 'red',
                           's' => 'black'
                           );

    return '<span style="color: '.$colors[$params['color']].'">'.$entities[$params['color']].'</span>';

}

?>