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

@ -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)) {