Rev 380 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 380 | Rev 386 | ||
---|---|---|---|
Line 338... | Line 338... | ||
338 | 338 | ||
339 | $out['title'] = OIDplus::config()->getValue('system_title'); |
339 | $out['title'] = OIDplus::config()->getValue('system_title'); |
340 | $out['icon'] = OIDplus::webpath(__DIR__).'system_big.png'; |
340 | $out['icon'] = OIDplus::webpath(__DIR__).'system_big.png'; |
341 | 341 | ||
342 | if (file_exists(OIDplus::basePath() . '/userdata/welcome/welcome$'.OIDplus::getCurrentLang().'.html')) { |
342 | if (file_exists(OIDplus::basePath() . '/userdata/welcome/welcome$'.OIDplus::getCurrentLang().'.html')) { |
343 | $out['text'] = file_get_contents(OIDplus::basePath() . '/userdata/welcome/welcome$'.OIDplus::getCurrentLang().'.html'); |
343 | $cont = file_get_contents(OIDplus::basePath() . '/userdata/welcome/welcome$'.OIDplus::getCurrentLang().'.html'); |
344 | } else if (file_exists(OIDplus::basePath() . '/userdata/welcome/welcome.html')) { |
344 | } else if (file_exists(OIDplus::basePath() . '/userdata/welcome/welcome.html')) { |
345 | $out['text'] = file_get_contents(OIDplus::basePath() . '/userdata/welcome/welcome.html'); |
345 | $cont = file_get_contents(OIDplus::basePath() . '/userdata/welcome/welcome.html'); |
346 | } else if (file_exists(__DIR__ . '/welcome$'.OIDplus::getCurrentLang().'.html')) { |
346 | } else if (file_exists(__DIR__ . '/welcome$'.OIDplus::getCurrentLang().'.html')) { |
347 | $out['text'] = file_get_contents(__DIR__ . '/welcome$'.OIDplus::getCurrentLang().'.html'); |
347 | $cont = file_get_contents(__DIR__ . '/welcome$'.OIDplus::getCurrentLang().'.html'); |
348 | } else if (file_exists(__DIR__ . '/welcome.html')) { |
348 | } else if (file_exists(__DIR__ . '/welcome.html')) { |
349 | $out['text'] = file_get_contents(__DIR__ . '/welcome.html'); |
349 | $cont = file_get_contents(__DIR__ . '/welcome.html'); |
350 | } else { |
350 | } else { |
351 | $out['text'] = ''; |
351 | $cont = ''; |
352 | } |
352 | } |
353 | 353 | ||
- | 354 | list($html, $js, $css) = extractHtmlContents($cont); |
|
- | 355 | $cont = ''; |
|
354 | // make sure the program works even if the user provided HTML is not UTF-8 |
356 | if (!empty($js)) $cont .= "<script>\n$js\n</script>"; |
355 | $out['text'] = iconv(mb_detect_encoding($out['text'], mb_detect_order(), true), 'UTF-8//IGNORE', $out['text']); |
357 | if (!empty($css)) $cont .= "<style>\n$css\n</style>"; |
356 | $bom = pack('H*','EFBBBF'); |
358 | $cont .= $html; |
- | 359 | ||
357 | $out['text'] = preg_replace("/^$bom/", '', $out['text']); |
360 | $out['text'] = $cont; |
358 | 361 | ||
359 | if (strpos($out['text'], '%%OBJECT_TYPE_LIST%%') !== false) { |
362 | if (strpos($out['text'], '%%OBJECT_TYPE_LIST%%') !== false) { |
360 | $tmp = '<ul>'; |
363 | $tmp = '<ul>'; |
361 | foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
364 | foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
362 | $tmp .= '<li><a '.OIDplus::gui()->link($ot::root()).'>'.htmlentities($ot::objectTypeTitle()).'</a></li>'; |
365 | $tmp .= '<li><a '.OIDplus::gui()->link($ot::root()).'>'.htmlentities($ot::objectTypeTitle()).'</a></li>'; |