mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
issue 2370, issue 2373, issue 2374 add the site design info.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11303 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
abef8deda9
commit
ffde9607d9
5 changed files with 233 additions and 9 deletions
|
|
@ -108,6 +108,82 @@
|
|||
header('Location: '.getNotEncodedUrl('', 'module','admin'));
|
||||
}
|
||||
|
||||
|
||||
public function procAdminInsertDefaultDesignInfo()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
if(!$vars->site_srl)
|
||||
{
|
||||
$vars->site_srl = 0;
|
||||
}
|
||||
|
||||
// create a DesignInfo file
|
||||
$output = $this->updateDefaultDesignInfo($vars);
|
||||
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
||||
}
|
||||
|
||||
public function updateDefaultDesignInfo($vars)
|
||||
{
|
||||
$siteDesignPath = _XE_PATH_.'files/site_design/';
|
||||
|
||||
if(!is_dir($siteDesignPath))
|
||||
{
|
||||
FileHandler::makeDir($siteDesignPath);
|
||||
}
|
||||
|
||||
$siteDesignFile = _XE_PATH_.'files/site_design/design_'.$vars->site_srl.'.php';
|
||||
|
||||
$buff = '';
|
||||
if(is_readable($siteDesignFile))
|
||||
{
|
||||
@include($siteDesignFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
$designInfo = new stdClass();
|
||||
}
|
||||
|
||||
$layoutSrl = (!$vars->layout_srl) ? $designInfo->layout_srl : $vars->layout_srl;
|
||||
|
||||
if($layoutSrl)
|
||||
{
|
||||
$buff .= sprintf('$designInfo->layout_srl = %s;', $layoutSrl);
|
||||
}
|
||||
|
||||
if($vars->module)
|
||||
{
|
||||
if($designInfo->module)
|
||||
{
|
||||
foreach($designInfo->module as $key => $val)
|
||||
{
|
||||
if($key == $vars->module)
|
||||
{
|
||||
$skin = $vars->module_skin;
|
||||
$skin_vars = serialize($vars->skin_vars);
|
||||
}
|
||||
else
|
||||
{
|
||||
$skin = $val->skin;
|
||||
$skin_vars = $val->skin_vars;
|
||||
}
|
||||
$buff .= sprintf('$designInfo->module->%s->skin = \'%s\';', $key, $skin);
|
||||
$buff .= sprintf('$designInfo->module->%s->skin_vars = \'%s\';', $key, $skin_vars);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$buff .= sprintf('$designInfo->module->%s->skin = \'%s\';', $vars->module, $vars->module_skin);
|
||||
$buff .= sprintf('$designInfo->module->%s->skin_vars = \'%s\';', $vars->module, serialize($vars->skin_vars));
|
||||
}
|
||||
}
|
||||
|
||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); if(!defined("__XE__")) exit(); %s ?>', $buff);
|
||||
|
||||
FileHandler::writeFile($siteDesignFile, $buff);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert theme information
|
||||
* @return void|object
|
||||
|
|
|
|||
|
|
@ -319,7 +319,8 @@
|
|||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('module_srl', 'module', 'skin', 'mskin');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if($module_info->module_srl) {
|
||||
if($module_info->module_srl)
|
||||
{
|
||||
if($mode === 'M')
|
||||
{
|
||||
$skin = $module_info->mskin;
|
||||
|
|
@ -353,8 +354,10 @@
|
|||
unset($obj->module);
|
||||
unset($obj->_mode);
|
||||
// Separately handle if a type of extra_vars is an image in the original skin_info
|
||||
if($skin_info->extra_vars) {
|
||||
foreach($skin_info->extra_vars as $vars) {
|
||||
if($skin_info->extra_vars)
|
||||
{
|
||||
foreach($skin_info->extra_vars as $vars)
|
||||
{
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $obj->{$vars->name};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue