|
|
@ -138,6 +138,44 @@ class HtmlTool {
|
|
|
|
return $output;
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function getStaticCommonFile($files, $forceTimestamp = '') {
|
|
|
|
|
|
|
|
$static = array();
|
|
|
|
|
|
|
|
$staticDir = str_replace('\\', '/', Zc::C(ZcConfigConst::DirWsApp));
|
|
|
|
|
|
|
|
$apiPath = stripos(Zc::C('static.domain'), '.api.') != false ? '/' : '/api/';
|
|
|
|
|
|
|
|
$staticUrlPart = AppConst::getCurProtocol() . '://' . Zc::C('static.domain') . $apiPath . $staticDir . 'views/static_common/';
|
|
|
|
|
|
|
|
$files = is_array($files) ? $files : [$files];
|
|
|
|
|
|
|
|
foreach ($files as $file) {
|
|
|
|
|
|
|
|
$timestamp = '';
|
|
|
|
|
|
|
|
list ($file, $timestamp) = explode('?', $file);
|
|
|
|
|
|
|
|
$timestamp = empty($timestamp) ? '' : ('?' . $timestamp);
|
|
|
|
|
|
|
|
$timestamp = $forceTimestamp ? ('?' . $forceTimestamp) : $timestamp;
|
|
|
|
|
|
|
|
$ext = strrchr($file, '.');
|
|
|
|
|
|
|
|
$static[$ext][] = $file . $timestamp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$output = '';
|
|
|
|
|
|
|
|
foreach ($static as $ext => $files) {
|
|
|
|
|
|
|
|
switch (strtolower($ext)) {
|
|
|
|
|
|
|
|
case '.css' :
|
|
|
|
|
|
|
|
foreach ($files as $f) {
|
|
|
|
|
|
|
|
$output .= '<link rel="stylesheet" href="' . $staticUrlPart . 'css/' . $f . '" />' . "\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '.js' :
|
|
|
|
|
|
|
|
foreach ($files as $f) {
|
|
|
|
|
|
|
|
$output .= '<script src="' . $staticUrlPart . 'js/' . $f . '"></script>' . "\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default :
|
|
|
|
|
|
|
|
foreach ($files as $f) {
|
|
|
|
|
|
|
|
$output = $staticUrlPart . $f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function checkIsCloseSidebarMenu() {
|
|
|
|
public static function checkIsCloseSidebarMenu() {
|
|
|
|
$cookieKey = $_SESSION[SessionConst::mallId] . '_getSideBarCookieKey';
|
|
|
|
$cookieKey = $_SESSION[SessionConst::mallId] . '_getSideBarCookieKey';
|
|
|
|
return $_COOKIE[$cookieKey] == 'close';
|
|
|
|
return $_COOKIE[$cookieKey] == 'close';
|
|
|
|