1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-10 01:56:30 +02:00

Merge pull request #179 from novashdima/v4.0

V4.0
This commit is contained in:
Marco Dickert
2022-06-10 01:51:45 +02:00
committed by GitHub

View File

@@ -1141,8 +1141,8 @@ f00bar;
$tmp_d = $dir; $tmp_d = $dir;
$tmp_missing_parts = []; $tmp_missing_parts = [];
while (realpath($tmp_d) === false) { while (realpath($tmp_d) === false) {
$tmp_i = pathinfo($tmp_d); $tmp_i = pathinfo($tmp_d, PATHINFO_FILENAME);
array_push($tmp_missing_parts, $tmp_i['filename']); array_push($tmp_missing_parts, $tmp_i);
$tmp_d = dirname($tmp_d); $tmp_d = dirname($tmp_d);
if ($tmp_d == dirname($tmp_d)) if ($tmp_d == dirname($tmp_d))
break; break;
@@ -1153,6 +1153,8 @@ f00bar;
return false; return false;
elseif ($rpDir == $rpConfig) elseif ($rpDir == $rpConfig)
return true; return true;
elseif (!file_exists($rpDir))
return false;
elseif (0 === strpos($rpDir, $rpConfig)) elseif (0 === strpos($rpDir, $rpConfig))
return true; return true;
else else
@@ -1160,7 +1162,7 @@ f00bar;
} }
private function chDirIfNecessary($d) { private function chDirIfNecessary($d) {
if (substr(getcwd(), strlen($this->getScriptRoot())) != $this->getValidDir($d) && !empty($d)) if (substr(getcwd(), strlen($this->getRootDir())) != $this->getValidDir($d) && !empty($d))
chdir($d); chdir($d);
} }
@@ -1168,7 +1170,7 @@ f00bar;
$type = strtolower($type); $type = strtolower($type);
switch ($type) { switch ($type) {
case "aac": case "aiff": case "mid": case "mp3": case "wav": return 'icon icon-file-audio'; break; case "aac": case "aiff": case "mid": case "mp3": case "wav": return 'icon icon-file-audio'; break;
case "ai": case "bmp": case "eps": case "tiff": case "gif": case "jpg": case "jpeg": case "png": case "psd": case "svg": return 'icon icon-file-image'; break; case "ai": case "bmp": case "eps": case "tiff": case "gif": case "jpg": case "jpeg": case "png": case "psd": case "svg": case "webp": return 'icon icon-file-image'; break;
case "avi": case "flv": case "mp4": case "mpg": case "mkv": case "mpeg": case "webm": case "wmv": case "mov": return 'icon icon-file-video'; break; case "avi": case "flv": case "mp4": case "mpg": case "mkv": case "mpeg": case "webm": case "wmv": case "mov": return 'icon icon-file-video'; break;
case "c": case "cpp": case "css": case "dat": case "h": case "html": case "java": case "js": case "php": case "py": case "sql": case "xml": case "yml": case "json": return 'icon icon-file-code'; break; case "c": case "cpp": case "css": case "dat": case "h": case "html": case "java": case "js": case "php": case "py": case "sql": case "xml": case "yml": case "json": return 'icon icon-file-code'; break;
case "doc": case "docx": case "odf": case "odt": case "rtf": return 'icon icon-file-word'; break; case "doc": case "docx": case "odf": case "odt": case "rtf": return 'icon icon-file-word'; break;