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