mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
apply favicon, mobile icon
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9097 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0245d5553b
commit
9f94898ff0
7 changed files with 110 additions and 74 deletions
|
|
@ -121,6 +121,14 @@ class HTMLDisplayHandler {
|
||||||
// Remove unnecessary information
|
// Remove unnecessary information
|
||||||
$output = preg_replace('/member\_\-([0-9]+)/s','member_0',$output);
|
$output = preg_replace('/member\_\-([0-9]+)/s','member_0',$output);
|
||||||
|
|
||||||
|
// set icon
|
||||||
|
$oAdminModel = &getAdminModel('admin');
|
||||||
|
$favicon_url = $oAdminModel->getFaviconUrl();
|
||||||
|
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
||||||
|
Context::set('favicon_url', $favicon_url);
|
||||||
|
Context::set('mobicon_url', $mobicon_url);
|
||||||
|
debugPrint($favicon_url);
|
||||||
|
|
||||||
// convert the final layout
|
// convert the final layout
|
||||||
Context::set('content', $output);
|
Context::set('content', $output);
|
||||||
$oTemplate = &TemplateHandler::getInstance();
|
$oTemplate = &TemplateHandler::getInstance();
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<script type="text/javascript" src="../js/html5.js" cond="$db_info->use_html5=='Y'"></script>
|
<script type="text/javascript" src="../js/html5.js" cond="$db_info->use_html5=='Y'"></script>
|
||||||
<!--[if lt IE 9]><script type="text/javascript" src="../js/respond.min.js"></script><![endif]-->
|
<!--[if lt IE 9]><script type="text/javascript" src="../js/respond.min.js"></script><![endif]-->
|
||||||
<!--@if($rss_url)-->
|
<!--@if($rss_url)-->
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" />
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" />
|
||||||
<link rel="alternate" type="application/atom+xml" title="Atom" href="{$atom_url}" />
|
<link rel="alternate" type="application/atom+xml" title="Atom" href="{$atom_url}" />
|
||||||
|
|
@ -58,6 +58,9 @@
|
||||||
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" />
|
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" />
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
|
<link cond="$favicon_url" rel="shortcut icon" href="{$favicon_url}" />
|
||||||
|
<link cond="$mobicon_url" rel="apple-touch-icon" href="{$mobicon_url}" />
|
||||||
|
|
||||||
{@ $ssl_actions = Context::getSSLActions() }
|
{@ $ssl_actions = Context::getSSLActions() }
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
var current_url = "{$current_url}";
|
var current_url = "{$current_url}";
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,12 @@
|
||||||
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" />
|
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" />
|
||||||
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" />
|
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" />
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
|
<link cond="$favicon_url" rel="shortcut icon" href="{$favicon_url}" />
|
||||||
|
<link cond="$mobicon_url" rel="apple-touch-icon" href="{$mobicon_url}" />
|
||||||
|
|
||||||
<script type="text/javascript" src="../js/html5.js" cond="$db_info->use_html5=='Y'"></script>
|
<script type="text/javascript" src="../js/html5.js" cond="$db_info->use_html5=='Y'"></script>
|
||||||
<!--[if lt IE 9]><script type="text/javascript" src="../js/respond.min.js"></script><![endif]-->
|
<!--[if lt IE 9]><script type="text/javascript" src="../js/respond.min.js"></script><![endif]-->
|
||||||
{@ $ssl_actions = Context::getSSLActions() }
|
{@ $ssl_actions = Context::getSSLActions() }
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
var current_url = "{$current_url}";
|
var current_url = "{$current_url}";
|
||||||
|
|
|
||||||
|
|
@ -416,4 +416,25 @@
|
||||||
|
|
||||||
return $output->data->count;
|
return $output->data->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFaviconUrl()
|
||||||
|
{
|
||||||
|
return $this->iconUrlCheck('favicon.ico','faviconSample.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMobileIconUrl()
|
||||||
|
{
|
||||||
|
return $this->iconUrlCheck('mobicon.png','mobiconSample.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
function iconUrlCheck($iconname,$default_icon_name)
|
||||||
|
{
|
||||||
|
$file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);
|
||||||
|
if(!$file_exsit){
|
||||||
|
$icon_url = './modules/admin/tpl/img/'.$default_icon_name ;
|
||||||
|
} else {
|
||||||
|
$icon_url = $db_info->default_url.'files/attach/xeicon/'.$iconname;
|
||||||
|
}
|
||||||
|
return $icon_url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -368,9 +368,9 @@
|
||||||
|
|
||||||
Context::set('admin_ip', $db_info->admin_ip);
|
Context::set('admin_ip', $db_info->admin_ip);
|
||||||
|
|
||||||
|
$oAdminModel = &getAdminModel('admin');
|
||||||
$favicon_url = $this->iconUrlCheck('favicon.ico','faviconSample.png');
|
$favicon_url = $oAdminModel->getFaviconUrl();
|
||||||
$mobicon_url = $this->iconUrlCheck('mobicon.png','mobiconSample.png');
|
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
||||||
Context::set('favicon_url', $favicon_url);
|
Context::set('favicon_url', $favicon_url);
|
||||||
Context::set('mobicon_url', $mobicon_url);
|
Context::set('mobicon_url', $mobicon_url);
|
||||||
|
|
||||||
|
|
@ -487,14 +487,4 @@
|
||||||
|
|
||||||
$this->setTemplateFile('theme');
|
$this->setTemplateFile('theme');
|
||||||
}
|
}
|
||||||
|
|
||||||
function iconUrlCheck($iconname,$default_icon_name){
|
|
||||||
$file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$iconname);
|
|
||||||
if(!$file_exsit){
|
|
||||||
$icon_url = './modules/admin/tpl/img/'.$default_icon_name ;
|
|
||||||
} else {
|
|
||||||
$icon_url = $db_info->default_url.'files/attach/xeicon/'.$iconname;
|
|
||||||
}
|
|
||||||
return $icon_url;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
function getFTPList(pwd)
|
function getFTPList(pwd)
|
||||||
{
|
{
|
||||||
var form = jQuery("#ftp_form").get(0);
|
var form = jQuery("#ftp_form").get(0);
|
||||||
if(typeof(pwd) != 'undefined')
|
if(typeof(pwd) != 'undefined')
|
||||||
{
|
{
|
||||||
|
|
@ -16,16 +16,16 @@ function getFTPList(pwd)
|
||||||
form.ftp_root_path.value = "/";
|
form.ftp_root_path.value = "/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var params= new Array();
|
var params= new Array();
|
||||||
//ftp_pasv not used
|
//ftp_pasv not used
|
||||||
params['ftp_user'] = jQuery("#ftp_user").val();
|
params['ftp_user'] = jQuery("#ftp_user").val();
|
||||||
params['ftp_password'] =jQuery("#ftp_password").val();
|
params['ftp_password'] =jQuery("#ftp_password").val();
|
||||||
params['ftp_host'] = jQuery("#ftp_host").val();
|
params['ftp_host'] = jQuery("#ftp_host").val();
|
||||||
params['ftp_port'] = jQuery("#ftp_port").val();
|
params['ftp_port'] = jQuery("#ftp_port").val();
|
||||||
params['ftp_root_path'] = jQuery("#ftp_root_path").val();
|
params['ftp_root_path'] = jQuery("#ftp_root_path").val();
|
||||||
|
|
||||||
exec_xml('admin', 'getAdminFTPList', params, completeGetFtpInfo, ['list', 'error', 'message'], params, form);
|
exec_xml('admin', 'getAdminFTPList', params, completeGetFtpInfo, ['list', 'error', 'message'], params, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFTPInfo()
|
function removeFTPInfo()
|
||||||
|
|
@ -43,7 +43,7 @@ function completeGetFtpInfo(ret_obj)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var e = jQuery("#ftpSuggestion").empty();
|
var e = jQuery("#ftpSuggestion").empty();
|
||||||
|
|
||||||
var list = "";
|
var list = "";
|
||||||
if(!jQuery.isArray(ret_obj['list']['item']))
|
if(!jQuery.isArray(ret_obj['list']['item']))
|
||||||
{
|
{
|
||||||
|
|
@ -60,14 +60,14 @@ function completeGetFtpInfo(ret_obj)
|
||||||
target = arr.join("/");
|
target = arr.join("/");
|
||||||
list = list + "<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>";
|
list = list + "<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i=0;i<ret_obj['list']['item'].length;i++)
|
for(var i=0;i<ret_obj['list']['item'].length;i++)
|
||||||
{
|
{
|
||||||
var v = ret_obj['list']['item'][i];
|
var v = ret_obj['list']['item'][i];
|
||||||
if(v == "../")
|
if(v == "../")
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if( v == "./")
|
else if( v == "./")
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -81,18 +81,28 @@ function completeGetFtpInfo(ret_obj)
|
||||||
e.append(jQuery(list));
|
e.append(jQuery(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteIcon(iconname){
|
var icon = null;
|
||||||
|
function deleteIcon(iconname){
|
||||||
var params = new Array();
|
var params = new Array();
|
||||||
params['iconname'] = iconname;
|
params['iconname'] = iconname;
|
||||||
exec_xml('admin', 'procAdminRemoveIcons', params, iconDeleteMessage, ['error', 'message'], params);
|
exec_xml('admin', 'procAdminRemoveIcons', params, iconDeleteMessage, ['error', 'message'], params);
|
||||||
|
icon = iconname;
|
||||||
}
|
}
|
||||||
function iconDeleteMessage(ret_obj){
|
function iconDeleteMessage(ret_obj){
|
||||||
alert(ret_obj['message']);
|
alert(ret_obj['message']);
|
||||||
|
|
||||||
|
if (ret_obj['error'] == '0')
|
||||||
|
{
|
||||||
|
if (icon == 'favicon.ico'){
|
||||||
|
jQuery('.faviconPreview img').attr('src', 'modules/admin/tpl/img/faviconSample.png');
|
||||||
|
}else if (icon == 'mobicon.png'){
|
||||||
|
jQuery('.mobiconPreview img').attr('src', 'modules/admin/tpl/img/mobiconSample.png');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function doRecompileCacheFile() {
|
function doRecompileCacheFile() {
|
||||||
var params = new Array();
|
var params = new Array();
|
||||||
exec_xml("admin","procAdminRecompileCacheFile", params, completeCacheMessage);
|
exec_xml("admin","procAdminRecompileCacheFile", params, completeCacheMessage);
|
||||||
}
|
}
|
||||||
function completeCacheMessage(ret_obj) {
|
function completeCacheMessage(ret_obj) {
|
||||||
alert(ret_obj['message']);
|
alert(ret_obj['message']);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief Change settings
|
* @brief Change settings
|
||||||
**/
|
**/
|
||||||
function procInstallAdminSaveTimeZone() {
|
function procInstallAdminSaveTimeZone() {
|
||||||
$use_rewrite = Context::get('use_rewrite');
|
$use_rewrite = Context::get('use_rewrite');
|
||||||
if($use_rewrite!='Y') $use_rewrite = 'N';
|
if($use_rewrite!='Y') $use_rewrite = 'N';
|
||||||
|
|
||||||
|
|
@ -73,8 +73,8 @@
|
||||||
|
|
||||||
$use_mobile_view = Context::get('use_mobile_view');
|
$use_mobile_view = Context::get('use_mobile_view');
|
||||||
if($use_mobile_view!='Y') $use_mobile_view = 'N';
|
if($use_mobile_view!='Y') $use_mobile_view = 'N';
|
||||||
|
|
||||||
$admin_ip = Context::get('admin_ip');
|
$admin_ip = Context::get('admin_ip');
|
||||||
|
|
||||||
$db_info = Context::getDBInfo();
|
$db_info = Context::getDBInfo();
|
||||||
$db_info->default_url = Context::get('default_url');
|
$db_info->default_url = Context::get('default_url');
|
||||||
|
|
@ -88,8 +88,8 @@
|
||||||
$db_info->use_cdn = $use_cdn;
|
$db_info->use_cdn = $use_cdn;
|
||||||
$db_info->use_html5 = $use_html5;
|
$db_info->use_html5 = $use_html5;
|
||||||
$db_info->use_mobile_view = $use_mobile_view;
|
$db_info->use_mobile_view = $use_mobile_view;
|
||||||
$db_info->admin_ip = $admin_ip;
|
$db_info->admin_ip = $admin_ip;
|
||||||
|
|
||||||
if($http_port) $db_info->http_port = (int) $http_port;
|
if($http_port) $db_info->http_port = (int) $http_port;
|
||||||
else if($db_info->http_port) unset($db_info->http_port);
|
else if($db_info->http_port) unset($db_info->http_port);
|
||||||
|
|
||||||
|
|
@ -107,8 +107,8 @@
|
||||||
$site_args->default_language = Context::get('change_lang_type');
|
$site_args->default_language = Context::get('change_lang_type');
|
||||||
$site_args->domain = $db_info->default_url;
|
$site_args->domain = $db_info->default_url;
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$oModuleController->updateSite($site_args);
|
$oModuleController->updateSite($site_args);
|
||||||
|
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,83 +150,83 @@
|
||||||
if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
|
if($_SESSION['ftp_password']) unset($_SESSION['ftp_password']);
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
function procInstallAdminConfig(){
|
function procInstallAdminConfig(){
|
||||||
$this->procInstallAdminSaveTimeZone();
|
$this->procInstallAdminSaveTimeZone();
|
||||||
|
|
||||||
//FTP 정보
|
//FTP 정보
|
||||||
$this->procInstallAdminSaveFTPInfo();
|
$this->procInstallAdminSaveFTPInfo();
|
||||||
|
|
||||||
//언어 선택
|
//언어 선택
|
||||||
$selected_lang = Context::get('selected_lang');
|
$selected_lang = Context::get('selected_lang');
|
||||||
$this->saveLangSelected($selected_lang);
|
$this->saveLangSelected($selected_lang);
|
||||||
|
|
||||||
//썸네일 세팅
|
//썸네일 세팅
|
||||||
$config = Context::gets('thumbnail_type');
|
$config = Context::gets('thumbnail_type');
|
||||||
$this->thumbnailCheck($config);
|
$this->thumbnailCheck($config);
|
||||||
|
|
||||||
//파비콘
|
//파비콘
|
||||||
$favicon = Context::get('favicon');
|
$favicon = Context::get('favicon');
|
||||||
$this->saveIcon($favicon);
|
$this->saveIcon($favicon);
|
||||||
|
|
||||||
//모바일아이콘
|
//모바일아이콘
|
||||||
$mobicon = Context::get('mobicon');
|
$mobicon = Context::get('mobicon');
|
||||||
$this->saveIcon($mobicon);
|
$this->saveIcon($mobicon);
|
||||||
|
|
||||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//from procInstallAdminSaveTimeZone
|
//from procInstallAdminSaveTimeZone
|
||||||
/**
|
/**
|
||||||
* @brief Supported languages (was procInstallAdminSaveLangSelected)
|
* @brief Supported languages (was procInstallAdminSaveLangSelected)
|
||||||
**/
|
**/
|
||||||
function saveLangSelected($selected_lang){
|
function saveLangSelected($selected_lang){
|
||||||
/*$selected_lang = trim($selected_lang);
|
/*$selected_lang = trim($selected_lang);
|
||||||
if(!$selected_lang) return new Object(-1,'msg_invalid_request');
|
if(!$selected_lang) return new Object(-1,'msg_invalid_request');
|
||||||
$langs = explode('|@|', $selected_lang);*/
|
$langs = explode('|@|', $selected_lang);*/
|
||||||
$langs = $selected_lang;
|
$langs = $selected_lang;
|
||||||
//fileter로 넘어오지 않으므로 위에 처럼 변경
|
//fileter로 넘어오지 않으므로 위에 처럼 변경
|
||||||
|
|
||||||
$lang_supported = Context::loadLangSupported();
|
$lang_supported = Context::loadLangSupported();
|
||||||
$buff = null;
|
$buff = null;
|
||||||
for($i=0;$i<count($langs);$i++) {
|
for($i=0;$i<count($langs);$i++) {
|
||||||
$buff .= sprintf("%s,%s\n", $langs[$i], $lang_supported[$langs[$i]]);
|
$buff .= sprintf("%s,%s\n", $langs[$i], $lang_supported[$langs[$i]]);
|
||||||
|
|
||||||
}
|
}
|
||||||
FileHandler::writeFile(_XE_PATH_.'files/config/lang_selected.info', trim($buff));
|
FileHandler::writeFile(_XE_PATH_.'files/config/lang_selected.info', trim($buff));
|
||||||
//$this->setMessage('success_updated');
|
//$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 썸내일 보여주기 방식 변경.*/
|
/* 썸내일 보여주기 방식 변경.*/
|
||||||
function thumbnailCheck($config){
|
function thumbnailCheck($config){
|
||||||
|
|
||||||
if(!$config->thumbnail_type || $config->thumbnail_type != 'ratio' ) $args->thumbnail_type = 'crop';
|
if(!$config->thumbnail_type || $config->thumbnail_type != 'ratio' ) $args->thumbnail_type = 'crop';
|
||||||
else $args->thumbnail_type = 'ratio';
|
else $args->thumbnail_type = 'ratio';
|
||||||
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$output = $oModuleController->insertModuleConfig('document',$args);
|
|
||||||
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveIcon($icon){
|
|
||||||
$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);
|
$oModuleController = &getController('module');
|
||||||
|
$output = $oModuleController->insertModuleConfig('document',$args);
|
||||||
if($iconname == 'favicon.ico' && preg_match('/^.*(icon).*$/',$type)){
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveIcon($icon){
|
||||||
|
$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';
|
$fitHeight = $fitWidth = '16';
|
||||||
} else if($iconname == 'mobicon.png' && preg_match('/^.*(png).*$/',$type) && in_array($height,$mobicon_size) && in_array($width,$mobicon_size)) {
|
} else if($iconname == 'mobicon.png' && preg_match('/^.*(png).*$/',$type) && in_array($height,$mobicon_size) && in_array($width,$mobicon_size)) {
|
||||||
$fitHeight = $fitWidth = $height;
|
$fitHeight = $fitWidth = $height;
|
||||||
} else{
|
} else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//FileHandler::createImageFile($target_file, $target_filename, $fitHeight, $fitWidth, $ext);
|
//FileHandler::createImageFile($target_file, $target_filename, $fitHeight, $fitWidth, $ext);
|
||||||
@copy($target_file, $target_filename);
|
FileHandler::copyFile($target_file, $target_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue