Merge pull request #435 from kijin/pr/more-favicon-improvements

파비콘 관련 기능 일부 개선
This commit is contained in:
Kijin Sung 2016-04-11 23:03:49 +09:00
commit 52315d8ee3
5 changed files with 12 additions and 36 deletions

View file

@ -925,35 +925,13 @@ class adminAdminController extends admin
$relative_filename = 'files/attach/xeicon/'.$virtual_site.'tmp/'.$iconname;
$target_filename = RX_BASEDIR . $relative_filename;
list($width, $height, $type_no, $attrs) = @getimagesize($original_filename);
if ($iconname == 'favicon.ico')
{
if(!preg_match('/^.*(x-icon|\.icon)$/i',$type)) {
Context::set('msg', '*.ico '.lang('msg_possible_only_file'));
return;
}
}
elseif ($iconname == 'mobicon.png')
{
if (!preg_match('/^.*(png).*$/',$type))
{
Context::set('msg', '*.png '.lang('msg_possible_only_file'));
return;
}
if (!(($height == '57' && $width == '57') || ($height == '114' && $width == '114')))
{
Context::set('msg', lang('msg_invalid_format').' (size : 57x57, 114x114)');
return;
}
}
else
if ($iconname !== 'favicon.ico' && $iconname !== 'mobicon.png')
{
Context::set('msg', lang('msg_invalid_format'));
return;
}
$fitHeight = $fitWidth = $height;
FileHandler::copyFile($original_filename, $target_filename);
Rhymix\Framework\Storage::copy($original_filename, $target_filename, 0666 & ~umask());
return $relative_filename;
}
@ -980,8 +958,6 @@ class adminAdminController extends admin
{
FileHandler::moveFile($tmpicon_filepath, $icon_filepath);
}
FileHandler::removeFile($tmpicon_filepath);
}
}
/* End of file admin.admin.controller.php */

View file

@ -403,10 +403,10 @@ class adminAdminView extends admin
// Favicon and mobicon
$oAdminModel = getAdminModel('admin');
$favicon_url = $oAdminModel->getFaviconUrl();
$mobicon_url = $oAdminModel->getMobileIconUrl();
Context::set('favicon_url', $favicon_url.'?'.$_SERVER['REQUEST_TIME']);
Context::set('mobicon_url', $mobicon_url.'?'.$_SERVER['REQUEST_TIME']);
$favicon_url = $oAdminModel->getFaviconUrl(false) ?: $oAdminModel->getFaviconUrl();
$mobicon_url = $oAdminModel->getMobileIconUrl(false) ?: $oAdminModel->getMobileIconUrl();
Context::set('favicon_url', $favicon_url);
Context::set('mobicon_url', $mobicon_url);
$this->setTemplateFile('config_general');
}

View file

@ -154,9 +154,9 @@ $lang->about_admin_ip_deny = 'This list can be used to designate IP addresses th
$lang->msg_current_ip_will_be_denied = 'The given IP list cannot be applied, as they would block your own IP address.';
$lang->detail_about_ftp_info = 'FTP information is needed for easyinstall when save_mode = on.';
$lang->allow_use_favicon = 'Do you want to use favicon?';
$lang->about_use_favicon = 'You can upload 16x16 size<em>*.ico</em> file only.';
$lang->about_use_favicon = 'The favicon should be 16x16 or 32x32, either ico or png format.';
$lang->allow_use_mobile_icon = 'Do you want to use the mobile home screen icon?';
$lang->detail_use_mobile_icon = 'You can upload 57x57 or 114x114 size<em>*.png</em> file only.';
$lang->detail_use_mobile_icon = 'The mobile icon should be 57x57 or 114x114, only png format.';
$lang->use_sso = 'Use <abbr title="Single Sign On">SSO</abbr>?';
$lang->about_use_sso = 'SSO will enable users to sign in just once for both default and virtual site. You will need this only if you are using virtual sites.';
$lang->about_arrange_session = 'Do you want to clean up session?';

View file

@ -157,9 +157,9 @@ $lang->about_admin_ip_deny = '여기에 나열된 IP 주소에서는 관리자
$lang->msg_current_ip_will_be_denied = '주어진 설정에 따르면 현재 로그인하신 관리자의 IP 주소도 차단됩니다. 다시 확인해 주십시오.';
$lang->detail_about_ftp_info = 'safe_mode = on 상태에서 쉬운설치를 사용하려면 FTP 정보를 입력해야 합니다.';
$lang->allow_use_favicon = '파비콘 지정';
$lang->about_use_favicon = '16 x 16 크기의<em>*.ico</em> 파일 업로드 권장.';
$lang->about_use_favicon = '16x16 또는 32x32 크기의 ico 또는 png 파일을 권장합니다.';
$lang->allow_use_mobile_icon = '모바일 홈 화면 아이콘';
$lang->detail_use_mobile_icon = '57 x 57 또는 114 x 114 크기의<em>*.png</em> 파일만 업로드 가능.';
$lang->detail_use_mobile_icon = '57x57 또는 114x114 크기의 png 파일을 권장합니다.';
$lang->use_sso = '<abbr title="Single Sign On">SSO</abbr> 사용';
$lang->about_use_sso = '사용자가 한 번만 로그인하면 기본 사이트와 가상 사이트에 동시에 로그인이 됩니다. 가상 사이트를 사용할 때만 필요합니다.';
$lang->about_arrange_session = '세션을 정리하시겠습니까?';

View file

@ -107,7 +107,7 @@
<input type="hidden" name="act" value="procAdminFaviconUpload">
<p>
<input type="file" name="favicon" id="favicon" title="Favicon"/>
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
<input class="x_btn" type="submit" value="{$lang->cmd_upload}" style="vertical-align:top">
</p>
</form>
<span class="x_help-block">{$lang->about_use_favicon}</span>
@ -126,7 +126,7 @@
<input type="hidden" name="act" value="procAdminFaviconUpload">
<p>
<input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/>
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
<input class="x_btn" type="submit" value="{$lang->cmd_upload}" style="vertical-align:top">
</p>
</form>
<span class="x_help-block">{$lang->detail_use_mobile_icon}</span>