delete elasticsearch index when indexing to clean up properly
[phorkie.git] / src / phorkie / HtmlHelper.php
1 <?php
2 namespace phorkie;
3
4 class HtmlHelper
5 {
6     public function getLanguageOptions(File $file = null)
7     {
8         $html = '';
9         $fileExt = null;
10         if ($file !== null) {
11             $fileExt = $file->getExt();
12         }
13         foreach ($GLOBALS['phorkie']['languages'] as $ext => $arLang) {
14             if (isset($arLang['show']) && !$arLang['show']) {
15                 continue;
16             }
17             $html .= sprintf(
18                 '<option value="%s"%s>%s</option>',
19                 $ext,
20                 $fileExt == $ext ? ' selected="selected"' : '',
21                 $arLang['title']
22             ) . "\n";
23         }
24         return $html;
25     }
26 }
27
28 ?>