|
@@ -47,7 +47,7 @@ class CustomTemplateLogic extends BaseLogic |
|
@@ -47,7 +47,7 @@ class CustomTemplateLogic extends BaseLogic |
|
47
|
if($info === false){
|
47
|
if($info === false){
|
|
48
|
$this->fail('当前数据不存在');
|
48
|
$this->fail('当前数据不存在');
|
|
49
|
}
|
49
|
}
|
|
50
|
- if($info['is_visualization'] == 0){
|
50
|
+ if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){
|
|
51
|
$html = $this->getBodyHeaderFooter($info['html'],$info['html_style']);
|
51
|
$html = $this->getBodyHeaderFooter($info['html'],$info['html_style']);
|
|
52
|
$info['html'] = $this->getHeadFooter($html);
|
52
|
$info['html'] = $this->getHeadFooter($html);
|
|
53
|
}
|
53
|
}
|
|
@@ -92,15 +92,16 @@ class CustomTemplateLogic extends BaseLogic |
|
@@ -92,15 +92,16 @@ class CustomTemplateLogic extends BaseLogic |
|
92
|
*/
|
92
|
*/
|
|
93
|
public function saveHtml(){
|
93
|
public function saveHtml(){
|
|
94
|
$html = $this->param['html'];
|
94
|
$html = $this->param['html'];
|
|
95
|
- $this->saveCommonTemplate($html);
|
|
|
|
96
|
- $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
97
|
- $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
95
|
+ $info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']);
|
|
|
|
96
|
+ if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面
|
|
|
|
97
|
+ $this->saveCommonTemplate($html);
|
|
|
|
98
|
+ $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
99
|
+ $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
100
|
+ }
|
|
98
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
101
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
99
|
if($rs === false){
|
102
|
if($rs === false){
|
|
100
|
$this->fail('系统错误,请联系管理');
|
103
|
$this->fail('系统错误,请联系管理');
|
|
101
|
}
|
104
|
}
|
|
102
|
- //TODO::通知网站更新
|
|
|
|
103
|
- $info = $this->model->read(['id'=>$this->param['id']],['id','url']);
|
|
|
|
104
|
$data = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PAGE, 'route'=>$info['url']];
|
105
|
$data = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PAGE, 'route'=>$info['url']];
|
|
105
|
$this->updateNotify($data);
|
106
|
$this->updateNotify($data);
|
|
106
|
return $this->success();
|
107
|
return $this->success();
|