* adjust the varname of CodeType to encode.

This commit is contained in:
wangchunsheng
2012-05-02 14:49:48 +00:00
parent bb224fa03e
commit 1b81daa010
5 changed files with 26 additions and 18 deletions
+6 -3
View File
@@ -104,9 +104,12 @@ $lang->searchTips = 'Id here';
$lang->exportFileTypeList['csv'] = 'csv';
$lang->exportFileTypeList['xml'] = 'xml';
$lang->exportFileTypeList['html'] = 'html';
/*code*/
$lang->exportCodeTypeList['gbk'] = 'gbk';
$lang->exportCodeTypeList['utf-8']= 'utf-8';
/* Support charset. */
$lang->exportEncodeList['gbk'] = 'GBK';
$lang->exportEncodeList['big5'] = 'BIG5';
$lang->exportEncodeList['utf-8'] = 'UTF-8';
/* Themes. */
$lang->themes['default'] = 'Default';
$lang->themes['green'] = 'Green';
+6 -3
View File
@@ -104,9 +104,12 @@ $lang->searchTips = '输入编号';
$lang->exportFileTypeList['csv'] = 'csv';
$lang->exportFileTypeList['xml'] = 'xml';
$lang->exportFileTypeList['html'] = 'html';
/*编码*/
$lang->exportCodeTypeList['gbk'] = 'gbk';
$lang->exportCodeTypeList['utf-8']= 'utf-8';
/* 支持的编码格式。*/
$lang->exportEncodeList['gbk'] = 'GBK';
$lang->exportEncodeList['big5'] = 'BIG5';
$lang->exportEncodeList['utf-8'] = 'UTF-8';
/* 风格列表。*/
$lang->themes['default'] = '默认';
$lang->themes['green'] = '绿色';
+6 -3
View File
@@ -104,9 +104,12 @@ $lang->searchTips = '輸入編號';
$lang->exportFileTypeList['csv'] = 'csv';
$lang->exportFileTypeList['xml'] = 'xml';
$lang->exportFileTypeList['html'] = 'html';
/*編碼*/
$lang->exportCodeTypeList['gbk'] = 'gbk';
$lang->exportCodeTypeList['utf-8']= 'utf-8';
/* 支持的編碼格式。*/
$lang->exportEncodeList['gbk'] = 'GBK';
$lang->exportEncodeList['big5'] = 'BIG5';
$lang->exportEncodeList['utf-8'] = 'UTF-8';
/* 風格列表。*/
$lang->themes['default'] = '預設';
$lang->themes['green'] = '綠色';
+3 -3
View File
@@ -117,15 +117,15 @@ class file extends control
$this->view->fields = $this->post->fields;
$this->view->rows = $this->post->rows;
$output = $this->parse('file', 'export2csv');
if( $this->post->CodeType != "utf-8")
if( $this->post->encode != "utf-8")
{
if(function_exists('mb_convert_encoding'))
{
$output = @mb_convert_encoding($output, $this->post->CodeType , 'utf-8');
$output = @mb_convert_encoding($output, $this->post->encode, 'utf-8');
}
elseif(function_exists('iconv'))
{
$output = @iconv('utf-8', $this->post->CodeType, $output);
$output = @iconv('utf-8', $this->post->encode, $output);
}
}
+5 -6
View File
@@ -12,7 +12,6 @@
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/colorbox.html.php';?>
<script>
function setDownloading()
{
@@ -33,15 +32,15 @@ function closeWindow()
}
i ++;
}
function switchCodeType(fileType)
function switchEncode(fileType)
{
if(fileType == 'csv')
{
$('#CodeType').removeAttr('class');
$('#encode').removeAttr('class');
}
else
{
$('#CodeType').attr('class', 'hidden');
$('#encode').attr('class', 'hidden');
}
}
</script>
@@ -53,8 +52,8 @@ function switchCodeType(fileType)
<td class='a-center'>
<?php echo $lang->setFileName;?>
<?php echo html::input('fileName', '', 'size=15');?>
<?php echo html::select('fileType', $lang->exportFileTypeList,'csv', 'onchange=switchCodeType(this.value)');?>
<?php echo html::select('CodeType', $lang->exportCodeTypeList, 'gbk');?>
<?php echo html::select('fileType', $lang->exportFileTypeList,'csv', 'onchange=switchEncode(this.value)');?>
<?php echo html::select('encode', $lang->exportEncodeList, 'gbk');?>
<?php echo html::submitButton();?>
</td>
</tr>