pre-lang & p_path
parent
97735aec43
commit
cf5aa37633
45
common.php
45
common.php
|
@ -26,7 +26,7 @@ $Base64Env = [
|
||||||
//'usesharepoint',
|
//'usesharepoint',
|
||||||
'sharepointname',
|
'sharepointname',
|
||||||
'shareurl',
|
'shareurl',
|
||||||
'sharecookie',
|
//'sharecookie',
|
||||||
'shareapiurl',
|
'shareapiurl',
|
||||||
//'siteid',
|
//'siteid',
|
||||||
'public_path',
|
'public_path',
|
||||||
|
@ -81,7 +81,7 @@ $InnerEnv = [
|
||||||
'sharepointname',
|
'sharepointname',
|
||||||
'siteid',
|
'siteid',
|
||||||
'shareurl',
|
'shareurl',
|
||||||
'sharecookie',
|
//'sharecookie',
|
||||||
'shareapiurl',
|
'shareapiurl',
|
||||||
'public_path',
|
'public_path',
|
||||||
'refresh_token',
|
'refresh_token',
|
||||||
|
@ -113,7 +113,17 @@ function main($path)
|
||||||
global $exts;
|
global $exts;
|
||||||
global $constStr;
|
global $constStr;
|
||||||
|
|
||||||
if (in_array($_SERVER['firstacceptlanguage'], array_keys($constStr['languages']))) $constStr['language'] = $_SERVER['firstacceptlanguage'];
|
if (in_array($_SERVER['firstacceptlanguage'], array_keys($constStr['languages']))) {
|
||||||
|
$constStr['language'] = $_SERVER['firstacceptlanguage'];
|
||||||
|
} else {
|
||||||
|
$prelang = splitfirst($_SERVER['firstacceptlanguage'], '-')[0];
|
||||||
|
foreach ( array_keys($constStr['languages']) as $lang) {
|
||||||
|
if ($prelang == splitfirst($lang, '-')[0]) {
|
||||||
|
$constStr['language'] = $lang;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isset($_COOKIE['language'])&&$_COOKIE['language']!='') $constStr['language'] = $_COOKIE['language'];
|
if (isset($_COOKIE['language'])&&$_COOKIE['language']!='') $constStr['language'] = $_COOKIE['language'];
|
||||||
//if (!$constStr['language']) $constStr['language'] = getConfig('language');
|
//if (!$constStr['language']) $constStr['language'] = getConfig('language');
|
||||||
/*echo 'firstacceptlanguage:'.$_SERVER['firstacceptlanguage'].'
|
/*echo 'firstacceptlanguage:'.$_SERVER['firstacceptlanguage'].'
|
||||||
|
@ -1247,15 +1257,28 @@ function render_list($path = '', $files = '')
|
||||||
if ($path !== '/') {
|
if ($path !== '/') {
|
||||||
if (isset($files['file'])) {
|
if (isset($files['file'])) {
|
||||||
$pretitle = str_replace('&','&', $files['name']);
|
$pretitle = str_replace('&','&', $files['name']);
|
||||||
$n_path=$pretitle;
|
$n_path = $pretitle;
|
||||||
|
$tmp = splitlast(splitlast($path,'/')[0],'/');
|
||||||
|
if ($tmp[1]=='') {
|
||||||
|
$p_path = $tmp[0];
|
||||||
|
} else {
|
||||||
|
$p_path = $tmp[1];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$pretitle = substr($path,-1)=='/'?substr($path,0,-1):$path;
|
if (substr($path,0,1)=='/') $pretitle = substr($path,1);
|
||||||
$n_path=substr($pretitle,strrpos($pretitle,'/')+1);
|
if (substr($path,-1)=='/') $pretitle = substr($path,0,-1);
|
||||||
$pretitle = substr($pretitle,1);
|
$tmp=splitlast($pretitle,'/');
|
||||||
}
|
if ($tmp[1]=='') {
|
||||||
if (strrpos($path,'/')!=0) {
|
$n_path = $tmp[0];
|
||||||
$p_path=substr($path,0,strrpos($path,'/'));
|
} else {
|
||||||
$p_path=substr($p_path,strrpos($p_path,'/')+1);
|
$n_path = $tmp[1];
|
||||||
|
$tmp = splitlast($tmp[0],'/');
|
||||||
|
if ($tmp[1]=='') {
|
||||||
|
$p_path = $tmp[0];
|
||||||
|
} else {
|
||||||
|
$p_path = $tmp[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pretitle = getconstStr('Home');
|
$pretitle = getconstStr('Home');
|
||||||
|
|
Loading…
Reference in New Issue