mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-14 07:52:13 +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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue