mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
issue 2649 theme delete
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12001 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bd7873a8c7
commit
e95a9f105b
5 changed files with 14 additions and 286 deletions
|
|
@ -200,78 +200,6 @@
|
|||
FileHandler::writeFile($siteDesignFile, $buff);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert theme information
|
||||
* @return void|object
|
||||
*/
|
||||
function procAdminInsertThemeInfo(){
|
||||
$vars = Context::getRequestVars();
|
||||
$theme_file = _XE_PATH_.'files/theme/theme_info.php';
|
||||
|
||||
$theme_output = sprintf('$theme_info->theme=\'%s\';', $vars->themeItem);
|
||||
$theme_output = $theme_output.sprintf('$theme_info->layout=%s;', $vars->layout);
|
||||
|
||||
$site_info = Context::get('site_module_info');
|
||||
|
||||
$args->site_srl = $site_info->site_srl;
|
||||
$args->layout_srl = $vars->layout;
|
||||
|
||||
// layout submit
|
||||
$output = executeQuery('layout.updateAllLayoutInSiteWithTheme', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
|
||||
// set layout info member
|
||||
$oModuleController = &getController('module');
|
||||
$memberConfig->layout_srl = $vars->layout;
|
||||
$oModuleController->updateModuleConfig('member', $memberConfig);
|
||||
|
||||
$skin_args->site_srl = $site_info->site_srl;
|
||||
|
||||
foreach($vars as $key=>$val){
|
||||
$pos = strpos($key, '-skin');
|
||||
if ($pos === false) continue;
|
||||
if ($val != '__skin_none__'){
|
||||
$module = substr($key, 0, $pos);
|
||||
$theme_output = $theme_output.sprintf('$theme_info->skin_info[%s]=\'%s\';', $module, $val);
|
||||
$skin_args->skin = $val;
|
||||
$skin_args->module = $module;
|
||||
if ($module == 'page')
|
||||
{
|
||||
$article_output = executeQueryArray('page.getArticlePageSrls');
|
||||
if (count($article_output->data)>0){
|
||||
$article_module_srls = array();
|
||||
foreach($article_output->data as $val){
|
||||
$article_module_srls[] = $val->module_srl;
|
||||
}
|
||||
$skin_args->module_srls = implode(',', $article_module_srls);
|
||||
}
|
||||
}
|
||||
|
||||
$skin_output = executeQuery('module.updateAllModuleSkinInSiteWithTheme', $skin_args);
|
||||
if (!$skin_output->toBool()) return $skin_output;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_config = $oModuleModel->getModuleConfig($module, $site_info->site_srl);
|
||||
$module_config->skin = $val;
|
||||
$oModuleController->insertModuleConfig($module, $module_config, $site_info->site_srl);
|
||||
}
|
||||
}
|
||||
|
||||
$theme_buff = sprintf(
|
||||
'<?php '.
|
||||
'if(!defined("__ZBXE__")) exit(); '.
|
||||
'%s'.
|
||||
'?>',
|
||||
$theme_output
|
||||
);
|
||||
// Save File
|
||||
FileHandler::writeFile($theme_file, $theme_buff);
|
||||
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminTheme');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle favorite
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -437,55 +437,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display Admin theme Configuration(settings) page
|
||||
* @return void
|
||||
*/
|
||||
function dispAdminTheme(){
|
||||
// choice theme file
|
||||
$theme_file = _XE_PATH_.'files/theme/theme_info.php';
|
||||
if(is_readable($theme_file)){
|
||||
@include($theme_file);
|
||||
Context::set('current_layout', $theme_info->layout);
|
||||
Context::set('theme_info', $theme_info);
|
||||
}
|
||||
else{
|
||||
$oModuleModel = &getModel('module');
|
||||
$default_mid = $oModuleModel->getDefaultMid();
|
||||
Context::set('current_layout', $default_mid->layout_srl);
|
||||
}
|
||||
|
||||
// layout list
|
||||
$oLayoutModel = &getModel('layout');
|
||||
// theme 정보 읽기
|
||||
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$theme_list = $oAdminModel->getThemeList();
|
||||
$layouts = $oLayoutModel->getLayoutList(0);
|
||||
$layout_list = array();
|
||||
if (is_array($layouts)){
|
||||
foreach($layouts as $val){
|
||||
unset($layout_info);
|
||||
$layout_info = $oLayoutModel->getLayout($val->layout_srl);
|
||||
if (!$layout_info) continue;
|
||||
$layout_parse = explode('|@|', $layout_info->layout);
|
||||
if (count($layout_parse) == 2){
|
||||
$thumb_path = sprintf('./themes/%s/layouts/%s/thumbnail.png', $layout_parse[0], $layout_parse[1]);
|
||||
}
|
||||
else{
|
||||
$thumb_path = './layouts/'.$layout_info->layout.'/thumbnail.png';
|
||||
}
|
||||
$layout_info->thumbnail = (is_readable($thumb_path))?$thumb_path:null;
|
||||
$layout_list[] = $layout_info;
|
||||
}
|
||||
}
|
||||
Context::set('theme_list', $theme_list);
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
// 설치된module 정보 가져오기
|
||||
$module_list = $oAdminModel->getModulesSkinList();
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
$this->setTemplateFile('theme');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,50 +188,46 @@
|
|||
'subMenu'=>array('trash'),
|
||||
),
|
||||
11=>array(
|
||||
'module'=>'admin',
|
||||
'subMenu'=>array('theme'),
|
||||
),
|
||||
12=>array(
|
||||
'module'=>'autoinstall',
|
||||
'subMenu'=>array('easyInstall'),
|
||||
),
|
||||
13=>array(
|
||||
12=>array(
|
||||
'module'=>'layout',
|
||||
'subMenu'=>array('installedLayout'),
|
||||
),
|
||||
14=>array(
|
||||
13=>array(
|
||||
'module'=>'module',
|
||||
'subMenu'=>array('installedModule'),
|
||||
),
|
||||
15=>array(
|
||||
14=>array(
|
||||
'module'=>'widget',
|
||||
'subMenu'=>array('installedWidget'),
|
||||
),
|
||||
16=>array(
|
||||
15=>array(
|
||||
'module'=>'addon',
|
||||
'subMenu'=>array('installedAddon'),
|
||||
),
|
||||
17=>array(
|
||||
16=>array(
|
||||
'module'=>'editor',
|
||||
'subMenu'=>array('editor'),
|
||||
),
|
||||
18=>array(
|
||||
17=>array(
|
||||
'module'=>'spamfilter',
|
||||
'subMenu'=>array('spamFilter'),
|
||||
),
|
||||
19=>array(
|
||||
18=>array(
|
||||
'module'=>'admin',
|
||||
'subMenu'=>array('adminConfigurationGeneral', 'adminConfigurationFtp', 'adminMenuSetup'),
|
||||
),
|
||||
20=>array(
|
||||
19=>array(
|
||||
'module'=>'file',
|
||||
'subMenu'=>array('fileUpload'),
|
||||
),
|
||||
21=>array(
|
||||
20=>array(
|
||||
'module'=>'module',
|
||||
'subMenu'=>array('filebox'),
|
||||
),
|
||||
22=>array(
|
||||
21=>array(
|
||||
'module'=>'point',
|
||||
'subMenu'=>array('point')
|
||||
),
|
||||
|
|
@ -305,7 +301,6 @@
|
|||
case 'spamFilter':
|
||||
return 'content';
|
||||
break;
|
||||
case 'theme':
|
||||
case 'easyInstall':
|
||||
case 'installedLayout':
|
||||
case 'installedModule':
|
||||
|
|
@ -353,9 +348,6 @@
|
|||
case 'trash':
|
||||
return 'content';
|
||||
break;
|
||||
case 'theme':
|
||||
return 'theme';
|
||||
break;
|
||||
case 'easyInstall':
|
||||
case 'installedLayout':
|
||||
case 'installedModule':
|
||||
|
|
@ -428,11 +420,13 @@
|
|||
$result = $this->_getOldGnbKey($menuKey);
|
||||
if($result == 'user_added_menu')
|
||||
{
|
||||
if($parentMenu[$menuItem->parent_srl] == 'theme')
|
||||
// theme menu use not anymore
|
||||
/*if($parentMenu[$menuItem->parent_srl] == 'theme')
|
||||
{
|
||||
$newParentItem = $newAdminParentMenuList['menu'];
|
||||
}
|
||||
else if($parentMenu[$menuItem->parent_srl] == 'extensions')
|
||||
else*/
|
||||
if($parentMenu[$menuItem->parent_srl] == 'extensions')
|
||||
{
|
||||
$newParentItem = $newAdminParentMenuList['advanced'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,14 +6,12 @@
|
|||
<action name="dispAdminIndex" type="view" standalone="true" index="true" />
|
||||
<action name="dispAdminConfigGeneral" type="view" standalone="true" menu_name="adminConfigurationGeneral" menu_index="true" />
|
||||
<action name="dispAdminConfigFtp" type="view" standalone="true" menu_name="adminConfigurationFtp" menu_index="true" />
|
||||
<action name="dispAdminTheme" type="view" standalone="true" menu_name="theme" menu_index="true" />
|
||||
<action name="dispAdminSetup" type="view" standalone="true" menu_name="adminMenuSetup" menu_index="true" />
|
||||
|
||||
<action name="procAdminRemoveIcons" type="controller" standalone="true" />
|
||||
<action name="procAdminRecompileCacheFile" type="controller" standalone="true" />
|
||||
<action name="procAdminLogout" type="controller" standalone="true" />
|
||||
<action name="procAdminInsertDefaultDesignInfo" type="controller" />
|
||||
<action name="procAdminInsertThemeInfo" type="controller" standalone="true" ruleset="insertThemeInfo" />
|
||||
<action name="procAdminToggleFavorite" type="controller" ruleset="toggleFavorite" />
|
||||
<action name="procAdminEnviromentGatheringAgreement" type="controller" standalone="true" />
|
||||
<action name="procAdminUpdateConfig" type="controller" standalone="true" />
|
||||
|
|
@ -63,18 +61,5 @@
|
|||
<title xml:lang="mn">FTP Configuration</title>
|
||||
<title xml:lang="tr">FTP Configuration</title>
|
||||
</menu>
|
||||
<menu name="theme" type="site">
|
||||
<title xml:lang="en">Theme</title>
|
||||
<title xml:lang="ko">테마</title>
|
||||
<title xml:lang="zh-CN">主题</title>
|
||||
<title xml:lang="jp">Theme</title>
|
||||
<title xml:lang="es">Theme</title>
|
||||
<title xml:lang="ru">Theme</title>
|
||||
<title xml:lang="fr">Theme</title>
|
||||
<title xml:lang="zh-TW">Theme</title>
|
||||
<title xml:lang="vi">Theme</title>
|
||||
<title xml:lang="mn">Theme</title>
|
||||
<title xml:lang="tr">Theme</title>
|
||||
</menu>
|
||||
</menus>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -1,128 +0,0 @@
|
|||
<load target="js/theme.js" type="body" usecdn="true" />
|
||||
|
||||
<script>
|
||||
jQuery(function($){
|
||||
|
||||
var themes = {};
|
||||
|
||||
<!--@foreach($theme_list as $key=>$val)-->
|
||||
{@$skins = array()}
|
||||
<!--@foreach($val->skin_infos as $module=>$skin_info)-->
|
||||
{@$skins[] = "'".$module."' : '".$skin_info->name."'";}
|
||||
<!--@end-->
|
||||
themes['{$key}'] = {
|
||||
'layout': '{$val->layout_info->layout_srl}',
|
||||
{implode(',',$skins)}
|
||||
};
|
||||
|
||||
<!--@end-->
|
||||
$('#theme').data('themes', themes);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<h1 class="h1">{$lang->menu_gnb_sub['theme']}</h1>
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="insertThemeInfo" action="./" method="post">
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="procAdminInsertThemeInfo">
|
||||
<fieldset id="theme">
|
||||
<h2 class="h2">{$lang->theme_setting}</h2>
|
||||
<p>{$lang->theme_desc}</p>
|
||||
<ul class="thumbPreview">
|
||||
<li>
|
||||
<p class="q">{$lang->selected_theme}</p>
|
||||
<ul class="a">
|
||||
{@$current_theme = ($theme_info)?$theme_info->theme:'user_define'}
|
||||
<li class="i" loop="$theme_list=>$key,$val">
|
||||
<span class="thumb"><!--@if($val->thumbnail)--><img src="{$val->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span>
|
||||
<input type="radio" name="themeItem" id="{$key}" value="{$key}" <!--@if($key == $current_theme)-->checked="checked"<!--@end--> />
|
||||
<label for="{$key}">{$val->title}({$key})</label>
|
||||
<ul>
|
||||
<li>· {$lang->version}: {$val->version}</li>
|
||||
<li>· {$lang->author}:
|
||||
<!--@foreach($val->publisher as $publisher)-->
|
||||
<a href="{$publisher->homepage}" cond="$publisher->homepage">{$publisher->name}</a>
|
||||
<!--@if(!$publisher->homepage)-->{$publisher->name}<!--@end-->
|
||||
<!--@endforeach-->
|
||||
</li>
|
||||
<li>· {$lang->description}: {$val->description}</li>
|
||||
<li>· {$lang->path}: {$val->path}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="i userDefine">
|
||||
<span class="thumb">{$lang->by_you}</span>
|
||||
<input type="radio" name="themeItem" id="theme_user_define" value="user_define" <!--@if($current_theme == 'user_define')-->checked="checked"<!--@end--> />
|
||||
<label for="theme_user_define">{$lang->user_define}</label>
|
||||
<ul>
|
||||
<li>· {$lang->description}: {$lang->no_selected_theme_desc}</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset id="skin">
|
||||
<p>{$lang->user_define_skin_select_desc} <button type="button" class="showAll"></button></p>
|
||||
<ul class="thumbPreview jx">
|
||||
<li data-skintype="layout">
|
||||
<p class="q">{$lang->selected_layout}</p>
|
||||
<ul class="a">
|
||||
<li class="i" loop="$layout_list=>$val">
|
||||
<span class="thumb"><span class="frame"><!--@if($val->thumbnail)--><img src="{$val->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span></span>
|
||||
<input type="radio" name="layout" id="layout_{$val->layout_srl}" value="{$val->layout_srl}" <!--@if($val->layout_srl == $current_layout)-->checked="checked"<!--@end--> />
|
||||
<label for="layout_{$val->layout_srl}">{$val->layout_title.'('.$val->layout.')'}</label>
|
||||
<ul>
|
||||
<li>· {$lang->version}: {$val->version}</li>
|
||||
<li>· {$lang->author}:
|
||||
<!--@foreach($val->author as $author)-->
|
||||
<a href="{$author->homepage}" cond="$author->homepage">{$author->name}</a>
|
||||
<!--@if(!$author->homepage)-->{$author->name}<!--@end-->
|
||||
<!--@endforeach-->
|
||||
</li>
|
||||
<li>· {$lang->description}: {$val->description}</li>
|
||||
<li>· {$lang->path}: {$val->path}</li>
|
||||
<li>· {$lang->cmd_setup}: <a href="{getUrl('', 'module', 'admin', 'act', 'dispLayoutAdminModify', 'layout', $val->layout,'layout_srl', $val->layout_srl)}">{$lang->cmd_edit}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li loop="$module_list=>$mkey,$mval" cond="$mkey!='__IS_PARSE__'" data-skintype="{$mkey}">
|
||||
<p class="q">{sprintf($lang->selected_skin, $mval['title'])}</p>
|
||||
<ul class="a">
|
||||
<li class="i noDirection" cond="!$theme_info->skin_info[$mkey]">
|
||||
<span class="thumb"><span class="frame"></span></span>
|
||||
<strong>{sprintf($lang->no_selected_skin, $mval['title'])}</strong>
|
||||
<ul>
|
||||
<li>{$lang->no_selected_skin_desc}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="i" loop="$mval['skins']=>$skey,$sval">
|
||||
{@ $id = $mkey.'_'.$skey }
|
||||
<span class="thumb"><span class="frame"><!--@if($sval->thumbnail)--><img src="{$sval->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span></span>
|
||||
<input type="radio" name="{$mkey}-skin" id="{$id}" value="{$skey}" checked="checked"|cond="$theme_info->skin_info[$mkey]==$skey" />
|
||||
<label for="{$id}">{$sval->title.'('.$skey.')'}</label>
|
||||
<ul>
|
||||
<li>· {$lang->version}: {$sval->version}</li>
|
||||
<li>· {$lang->author}:
|
||||
<!--@foreach($sval->author as $author)-->
|
||||
<a href="{$author->homepage}" cond="$author->homepage">{$author->name}</a>
|
||||
<!--@if(!$author->homepage)-->{$author->name}<!--@end-->
|
||||
<!--@endforeach-->
|
||||
</li>
|
||||
<li>· {$lang->description}: {$sval->description}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="i">
|
||||
<span class="thumb"><span class="frame">{$lang->msg_thumbnail_not_exist}</span></span>
|
||||
<input type="radio" name="{$mkey}-skin" id="{$mkey}_none" value="" checked="checked"|cond="!$theme_info->skin_info[$mkey]" />
|
||||
<label for="{$mkey}_none">{$lang->no_select}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue