2015-01-23 13:09:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Vn\Hedera;
|
|
|
|
|
2015-03-06 23:33:54 +00:00
|
|
|
require_once ('vn/hedera/web.php');
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
class Js
|
|
|
|
{
|
2015-02-17 11:48:53 +00:00
|
|
|
static $isMobile = NULL;
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
static function includeFile ($fileName)
|
|
|
|
{
|
2015-09-11 09:37:16 +00:00
|
|
|
echo '<script type="text/javascript" src="'.$fileName.'?'. Web::getVersion () .'"></script>'."\n\t\t";
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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');
|
|
|
|
}
|
2015-02-17 11:48:53 +00:00
|
|
|
|
|
|
|
static function includeCss ($fileName)
|
|
|
|
{
|
2015-09-11 09:37:16 +00:00
|
|
|
echo '<link rel="stylesheet" type="text/css" href="'.$fileName.'?'. Web::getVersion () .'"/>'."\n\t\t";
|
2015-02-17 11:48:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|