Esempio n. 1
0
function smarty_modifier_markdown($md, $clear = false)
{
    return Utils::markdown($md, $clear);
}
Esempio n. 2
0
// CSV header
if ($poll->format === 'D') {
    $titles_line = ',';
    $moments_line = ',';
    foreach ($slots as $slot) {
        $title = Utils::csvEscape(strftime($date_format['txt_date'], $slot->title));
        $moments = explode(',', $slot->moments);
        $titles_line .= str_repeat($title . ',', count($moments));
        $moments_line .= implode(',', array_map('\\Framadate\\Utils::csvEscape', $moments)) . ',';
    }
    echo $titles_line . "\r\n";
    echo $moments_line . "\r\n";
} else {
    echo ',';
    foreach ($slots as $slot) {
        echo Utils::markdown($slot->title, true) . ',';
    }
    echo "\r\n";
}
// END - CSV header
// Vote lines
foreach ($votes as $vote) {
    echo Utils::csvEscape($vote->name) . ',';
    $choices = str_split($vote->choices);
    foreach ($choices as $choice) {
        switch ($choice) {
            case 0:
                $text = __('Generic', 'No');
                break;
            case 1:
                $text = __('Generic', 'Ifneedbe');