45 lines
934 B
PHP
Executable File
45 lines
934 B
PHP
Executable File
<?php
|
|
|
|
namespace Vn\Hedera;
|
|
|
|
class Js
|
|
{
|
|
static $isMobile = NULL;
|
|
|
|
static function includeFile ($fileName)
|
|
{
|
|
echo '<script type="text/javascript" src="'.$fileName.'?'. $_SESSION['version'] .'"></script>'."\n\t";
|
|
}
|
|
|
|
static function includeLib ($libName)
|
|
{
|
|
$args = func_get_args ();
|
|
|
|
$localeJs = 'locale/'. $_SESSION['lang'] .'/js/'. $libName .'.js';
|
|
|
|
if (file_exists ($localeJs))
|
|
self::includeFile ($localeJs);
|
|
|
|
for ($i = 1; $i < count ($args); $i++)
|
|
self::includeFile ('js/'.$libName.'/'.$args[$i].'.js');
|
|
}
|
|
|
|
static function includeCss ($fileName)
|
|
{
|
|
echo '<link rel="stylesheet" type="text/css" href="'.$fileName.'?'. $_SESSION['version'] .'"/>'."\n\t";
|
|
}
|
|
|
|
static function isMobile ()
|
|
{
|
|
if (self::$isMobile === NULL)
|
|
{
|
|
$re = '/(Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone)/i';
|
|
self::$isMobile = preg_match ($re, $_SERVER['HTTP_USER_AGENT']);
|
|
}
|
|
|
|
return self::$isMobile;
|
|
}
|
|
}
|
|
|
|
?>
|