* [bug#59671,done,0.5h] unset sub menu when preview image.

This commit is contained in:
liumengyi
2025-02-14 10:35:09 +08:00
committed by xieqiyu
parent edca34bdbf
commit c699e2b51a
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -146,6 +146,9 @@ class file extends control
return print($this->view->error);
}
/* Unset the menu. */
if(!empty($this->lang->{$this->app->tab}->menu)) $this->lang->{$this->app->tab}->menu = array();
if(!$this->file->checkPriv($file))
{
if(isInModal()) return $this->send(array('result' => 'success', 'message' => $this->lang->file->accessDenied, 'closeModal' => true, 'load' => true));
@@ -164,6 +167,7 @@ class file extends control
}
/* If the mode is open, locate directly. */
$this->view->title = $this->lang->file->previewFile;
$this->view->file = $file;
$this->view->charset = $this->get->charset ? $this->get->charset : $this->config->charset;
$this->view->fileType = ($file->extension == 'txt') ? 'txt' : ($file->extension == 'mp4' ? 'video' : 'image');
+1 -1
View File
@@ -23,7 +23,7 @@ if(!empty($error))
else
{
$fileContent = trim(file_get_contents($file->realPath));
$fromOld = strpos($_SERVER['HTTP_REFERER'], 'ajaxIframeModal') !== false;
$fromOld = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'ajaxIframeModal') !== false;
if($charset != $config->charset)
{
$fileContent = helper::convertEncoding($fileContent, $charset . "//IGNORE", $config->charset);