issue 1894 modify name of layout in theme, add 'skin fixed' option on page info.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10954 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-07-27 05:42:00 +00:00
parent f7109b400e
commit 339c6e6d29
6 changed files with 56 additions and 7 deletions

View file

@ -188,8 +188,7 @@
$output = $this->updateLayout($args);
if(!$output->toBool()) return $output;
$this->setRedirectUrl(Context::get('error_return_url'));
return $output;
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
}
/**

View file

@ -35,6 +35,18 @@
if(!$oDB->isColumnExists('layouts', 'layout_type')) return true;
$args->layout = '.';
$output = executeQueryArray('layout.getLayoutDotList', $args);
if($output->data && count($output->data) > 0)
{
foreach($output->data as $layout)
{
$layout_path = explode('.', $layout->layout);
if(count($layout_path) != 2) continue;
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1]))) return true;
}
}
return false;
}
@ -66,6 +78,21 @@
$oDB->addColumn('layouts','layout_type','char',1,'P',true);
}
$output = executeQueryArray('layout.getLayoutDotList', $args);
if($output->data && count($output->data) > 0)
{
foreach($output->data as $layout)
{
$layout_path = explode('.', $layout->layout);
if(count($layout_path) != 2) continue;
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1])))
{
$args->layout = implode('|@|', $layout_path);
$args->layout_srl = $layout->layout_srl;
$output = executeQuery('layout.updateLayout', $args);
}
}
}
return new Object(0, 'success_updated');
}

View file

@ -104,7 +104,7 @@
* @return string path of layout
**/
function getLayoutPath($layout_name, $layout_type = "P") {
$layout_parse = explode('.', $layout_name);
$layout_parse = explode('|@|', $layout_name);
if (count($layout_parse) > 1){
$class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/';
}else if($layout_name == 'faceoff'){

View file

@ -0,0 +1,16 @@
<query id="getLayoutDotList" action="select">
<tables>
<table name="layouts" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="site_srl" var="site_srl" filter="number" default="0" notnull="notnull" />
<condition operation="equal" column="layout_type" var="layout_type" default="P" pipe="and" />
<condition operation="like" column="layout" var="layout" default="." pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="layout_srl" order="desc" />
</navigation>
</query>