summaryrefslogtreecommitdiff
path: root/src/phorkie/HtmlHelper.php
blob: ebda58bcc2e3c497d7c69dc60e014e6a5a9c0239 (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
25
26
27
28
<?php
namespace phorkie;

class HtmlHelper
{
    public function getLanguageOptions(File $file = null)
    {
        $html = '';
        $fileExt = null;
        if ($file !== null) {
            $fileExt = $file->getExt();
        }
        foreach ($GLOBALS['phorkie']['languages'] as $ext => $arLang) {
            if (isset($arLang['show']) && !$arLang['show']) {
                continue;
            }
            $html .= sprintf(
                '<option value="%s"%s>%s</option>',
                $ext,
                $fileExt == $ext ? ' selected="selected"' : '',
                $arLang['title']
            ) . "\n";
        }
        return $html;
    }
}

?>