* adjust for file module page.

This commit is contained in:
wangyidong
2018-04-28 13:52:17 +08:00
parent fb3e2b370f
commit 00f29bee8a
7 changed files with 54 additions and 64 deletions
+33 -35
View File
@@ -6,47 +6,45 @@
#txtFile{padding: 5px 10px;}
#txtFile div{overflow-x: auto;}
#titlebar span{float: right; padding-right: 25px;}
.main-header .btn-toolbar{margin-left:8px;}
</style>
<div id='titlebar'>
<div class='heading'>
<strong><?php echo $lang->file->common;?></strong>
<small class='text-muted'><?php echo $lang->file->preview;?></small>
<div id='mainContent' class='main-content'>
<div class='main-header clearfix'>
<h2 class='pull-left'><?php echo $lang->file->preview;?></h2>
<?php if($fileType == 'txt'):?>
<span><?php echo html::select('charset', $config->file->charset, $charset, "onchange='setCharset(this.value)'");?></span>
<div class='btn-toolbar pull-left w-120px'><?php echo html::select('charset', $config->file->charset, $charset, "onchange='setCharset(this.value)' class='chosen'");?></div>
<?php endif;?>
</div>
</div>
<?php if($fileType == 'image'):?>
<div id='imageFile'><?php echo html::image($this->createLink('file', 'read', "fileID=$file->id"));?></div>
<?php else:?>
<div id='txtFile'>
<div>
<?php
$fileContent = file_get_contents($file->realPath);
if($charset != $config->charset)
{
$fileContent = helper::convertEncoding($fileContent, $charset, $config->charset);
}
else
{
if(extension_loaded('mbstring'))
{
$encoding = mb_detect_encoding($fileContent, array('ASCII', 'UTF-8', 'GB2312', 'GBK', 'BIG5'));
if($encoding != 'UTF-8') $fileContent = helper::convertEncoding($fileContent, $encoding, $config->charset);
}
else
{
$encoding = 'UTF-8';
if($config->default->lang == 'zh-cn') $encoding = 'GBK';
if($config->default->lang == 'zh-tw') $encoding = 'BIG5';
$fileContent = helper::convertEncoding($fileContent, $encoding, $config->charset);
}
}
a($fileContent);
?>
<?php if($fileType == 'image'):?>
<div id='imageFile'><?php echo html::image($this->createLink('file', 'read', "fileID=$file->id"));?></div>
<?php else:?>
<div id='txtFile'>
<?php
$fileContent = file_get_contents($file->realPath);
if($charset != $config->charset)
{
$fileContent = helper::convertEncoding($fileContent, $charset, $config->charset);
}
else
{
if(extension_loaded('mbstring'))
{
$encoding = mb_detect_encoding($fileContent, array('ASCII', 'UTF-8', 'GB2312', 'GBK', 'BIG5'));
if($encoding != 'UTF-8') $fileContent = helper::convertEncoding($fileContent, $encoding, $config->charset);
}
else
{
$encoding = 'UTF-8';
if($config->default->lang == 'zh-cn') $encoding = 'GBK';
if($config->default->lang == 'zh-tw') $encoding = 'BIG5';
$fileContent = helper::convertEncoding($fileContent, $encoding, $config->charset);
}
}
echo "<pre>" . htmlspecialchars($fileContent) . "</pre>";
?>
</div>
<?php endif;?>
</div>
<?php endif;?>
<script>
function setCharset(charset)
{
+17 -18
View File
@@ -28,24 +28,23 @@ function closeWindow()
clearInterval(time);
}
</script>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['edit']);?></span>
<strong><?php echo $lang->file->inputFileName;?></strong>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2><?php echo $lang->file->inputFileName;?></h2>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' onsubmit='setFileName();' style='padding: 30px 5%'>
<table class='w-p100'>
<tr>
<td>
<div class='input-group'>
<?php echo html::input('fileName', $file->title, "class='form-control' autocomplete='off'");?>
<strong class='input-group-addon'>.<?php echo $file->extension;?></strong>
</div>
</td>
<td><?php echo html::submitButton();?></td>
</tr>
</table>
</form>
<form class='main-form' method='post' target='hiddenwin' onsubmit='setFileName();'>
<table class='table table-form'>
<tr>
<td>
<div class='input-group'>
<?php echo html::input('fileName', $file->title, "class='form-control' autocomplete='off'");?>
<strong class='input-group-addon'>.<?php echo $file->extension;?></strong>
</div>
</td>
<td class='w-80px'><?php echo html::submitButton();?></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+1 -1
View File
@@ -117,7 +117,7 @@ $(document).ready(function()
<h2><?php echo $lang->export;?></h2>
</div>
<?php $isCustomExport = (!empty($customExport) and !empty($allExportFields));?>
<form method='post' target='hiddenwin' style='padding: 40px 1% 50px'>
<form class='main-form' method='post' target='hiddenwin' style='padding: 40px 1% 50px'>
<table class='w-p100 table-fixed'>
<tr>
<td>
+1 -1
View File
@@ -184,7 +184,7 @@ class tree extends control
$parentModules = $this->tree->getParents($currentModuleID);
$newModule = (version_compare($project->openedVersion, '4.1', '>') and $products) ? true : false;
$title = $project->name . $this->lang->colon . $this->lang->tree->manageProject;
$title = $this->lang->tree->manageProject;
$position[] = html::a($this->createLink('project', 'task', "projectID=$rootID"), $project->name);
$position[] = $this->lang->tree->manageProject;
+1 -1
View File
@@ -19,7 +19,7 @@
</a>
<div class="divider"></div>
<div class="page-title">
<span class='text'><?php echo $lang->tree->common . ':' . $root->name;?></span>
<span class='text'><?php echo $lang->tree->common . $lang->colon . $root->name;?></span>
</div>
</div>
<div id="mainContent" class="main-row">
+1 -1
View File
@@ -21,7 +21,7 @@ $jsRoot = $webRoot . "js/";
<h4 class="modal-title"><strong><?php echo $lang->tree->edit;?></strong></h4>
</div>
<div class='modal-body'>
<form action="<?php echo inlink('edit', 'module=' . $module->id .'&type=' .$type);?>" target='hiddenwin' class='form-condensed' method='post' class='mt-10px' id='dataform'>
<form action="<?php echo inlink('edit', 'module=' . $module->id .'&type=' .$type);?>" target='hiddenwin' method='post' class='mt-10px' id='dataform'>
<table class='table table-form'>
<?php if($showProduct):?>
<tr>
-7
View File
@@ -47,13 +47,6 @@ tr.text-center > td.text-left, tr.text-center > th.text-left {text-align: left;}
tr.text-center > td.text-right, tr.text-center > th.text-right {text-align: right;}
.text-top, tr.text-top td, tr.text-top th {vertical-align: top!important;}
/* columns */
.row-table {display: table; width: 100%}
.col-main, .row-table-swap .col-side {padding-right: 10px; padding-left: 0;}
.row-table-swap .col-main {padding-right: 0; padding-left: 10px;}
.row-table-side-left .col-side {padding-right: 10px; padding-left: 0;}
.row-table-side-left .col-main {padding-left: 10px; padding-right: 0;}
/* === Components === */
/* remove outline of links */
a,a:focus,a:active {text-decoration: none; outline:none;}