modify auto changed to favicon.ico or mobicon.png

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9446 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2011-09-30 05:59:01 +00:00
parent 485b163319
commit 05550891b2
3 changed files with 19 additions and 25 deletions

View file

@ -900,21 +900,21 @@ Lütfen son sürümü için indirme linkine tıklayınız.]]></value>
If you are unable to easy install, PHP's 'safe_mode' must be changed 'On'
]]></value>
</item>
<item name="about_favicon">
<item name="allow_use_favicon">
<value xml:lang="ko"><![CDATA[파비콘을 사용할까요?]]></value>
<value xml:lang="en"><![CDATA[Do you want to use favicon?]]></value>
</item>
<item name="detail_about_use_favicon">
<value xml:lang="ko"><![CDATA[16 x 16 크기의 <em>favicon.ico</em> 파일만 업로드 가능.]]></value>
<value xml:lang="en"><![CDATA[You can upload 16x16 size <em>favicon.ico</em> file only.]]></value>
<item name="about_use_favicon">
<value xml:lang="ko"><![CDATA[16 x 16 크기의 <em>*.ico</em> 파일만 업로드 가능.]]></value>
<value xml:lang="en"><![CDATA[You can upload 16x6 size <em>*.ico</em> file only.]]></value>
</item>
<item name="about_mobilehome_icon">
<item name="allow_use_mobile_icon">
<value xml:lang="ko"><![CDATA[모바일 홈 화면 아이콘을 사용할까요?]]></value>
<value xml:lang="en"><![CDATA[Do you want to use the mobile home screen icon?]]></value>
</item>
<item name="detail_about_mobilehome_icon">
<value xml:lang="ko"><![CDATA[57 x 57 또는 114 x 114 크기의 <em>mobicon.png</em> 파일만 업로드 가능.]]></value>
<value xml:lang="en"><![CDATA[You can upload 57x57 or 114x114 size <em>mobicon.png</em> file only.]]></value>
<item name="detail_use_mobile_icon">
<value xml:lang="ko"><![CDATA[57 x 57 또는 114 x 114 크기의 <em>*.png</em> 파일만 업로드 가능.]]></value>
<value xml:lang="en"><![CDATA[You can upload 57x57 or 114x114 size <em>*.png</em> file only.]]></value>
</item>
<item name="about_use_sso">
<value xml:lang="ko"><![CDATA[SSO(Single Sign On)를 사용하시겠습니까?]]></value>
@ -932,10 +932,6 @@ Lütfen son sürümü için indirme linkine tıklayınız.]]></value>
<value xml:lang="ko"><![CDATA[세션 정리]]></value>
<value xml:lang="en"><![CDATA[Clean up session]]></value>
</item>
<item name="msg_not_correct_iconname">
<value xml:lang="ko"><![CDATA[아이콘 형식이 바르지 않습니다.]]></value>
<value xml:lang="en"><![CDATA[Invalid icon type]]></value>
</item>
<item name="msg_possible_only_file">
<value xml:lang="ko"><![CDATA[파일만 업로드 가능합니다.]]></value>
<value xml:lang="en"><![CDATA[You can upload files only.]]></value>

View file

@ -1,16 +1,16 @@
<script type="text/javascript">
jQuery(function($){
$('#favicon').change(function(){
var re_favicon = /favicon\.ico$/
var re_favicon = /[^.]+\.ico$/
if(re_favicon.test($(this).val()) != true){
alert('{$lang->msg_not_correct_iconname} favicon.ico {$lang->msg_possible_only_file}');
alert('*.ico {$lang->msg_possible_only_file}');
return false;
}
});
$('#mobicon').change(function(){
var re_favicon = /mobicon\.png$/
var re_favicon = /[^.]+\.png$/
if(re_favicon.test($(this).val()) != true){
alert('{$lang->msg_not_correct_iconname} mobicon.png {$lang->msg_possible_only_file}');
alert('*.png {$lang->msg_possible_only_file}');
return false;
}
});
@ -151,22 +151,22 @@ jQuery(function($){
<p class="desc">{$lang->msg_ftp_installed_realpath} : {_XE_PATH_} </p>
</li>
<li>
<p class="q">{$lang->about_use_favicon}</p>
<p class="q">{$lang->allow_use_favicon}</p>
<p class="a faviconPreview">
<img src="{$favicon_url}" alt="favicon" width="16" height="16" class="fn1">
<img src="{$favicon_url}" alt="favicon Image" width="16" height="16" class="fn2">
<a href="javascript:deleteIcon('favicon\.ico');">{$lang->cmd_delete}</a>
</p>
<p class="a"><input type="file" name="favicon" id="favicon" title="favicon" /> <span class="desc">{$lang->detail_about_use_favicon}</span></p>
<p class="a"><input type="file" name="favicon" id="favicon" title="favicon" /> <span class="desc">{$lang->about_use_favicon}</span></p>
</li>
<li>
<p class="q">{$lang->about_mobilehome_icon}</p>
<p class="q">{$lang->allow_use_mobile_icon}</p>
<p class="a mobiconPreview">
<img src="{$mobicon_url}" alt="Mobile Home Icon" width="32" height="32" />
<span>www</span>
<a href="javascript:deleteIcon('mobicon\.png');">{$lang->cmd_delete}</a>
</p>
<p class="a"><input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/> <span class="desc">{$lang->detail_about_mobilehome_icon}</span></p>
<p class="a"><input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/> <span class="desc">{$lang->detail_use_mobile_icon}</span></p>
</li>
</ul>
</fieldset>

View file

@ -172,11 +172,11 @@
//파비콘
$favicon = Context::get('favicon');
$this->saveIcon($favicon);
$this->saveIcon($favicon,'favicon.ico');
//모바일아이콘
$mobicon = Context::get('mobicon');
$this->saveIcon($mobicon);
$this->saveIcon($mobicon,'mobicon.png');
$this->setRedirectUrl(Context::get('error_return_url'));
}
@ -215,15 +215,13 @@
return $output;
}
function saveIcon($icon){
function saveIcon($icon,$iconname){
$mobicon_size = array('57','114');
$iconname = $icon['name'];
$target_file = $icon['tmp_name'];
$type = $icon['type'];
$target_filename = _XE_PATH_.'files/attach/xeicon/'.$iconname;
list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
if($iconname == 'favicon.ico' && preg_match('/^.*(icon).*$/',$type)){
$fitHeight = $fitWidth = '16';
} else if($iconname == 'mobicon.png' && preg_match('/^.*(png).*$/',$type) && in_array($height,$mobicon_size) && in_array($width,$mobicon_size)) {