|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Models\Project\PageSetting; |
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Template\BTemplateCom;
|
|
|
|
use App\Models\Template\BTemplateCommon;
|
|
|
|
use App\Models\Template\BTemplateMain;
|
|
|
|
use App\Models\Template\Setting;
|
|
...
|
...
|
@@ -51,14 +52,83 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
$data['id'] = $mainInfo['id'];
|
|
|
|
$data['updated_at'] = $mainInfo['updated_at'];
|
|
|
|
}
|
|
|
|
$commonInfo = $this->getCommonHtml($this->param['type'],$is_list,$template_id,$is_custom); //获取头部
|
|
|
|
$html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other'].$commonInfo['head_html'].$main_html.$commonInfo['footer_html'];
|
|
|
|
$commonInfo = $this->getTemplateComHtml($this->param['type'],$is_list,$is_custom,$template_id); //获取头部
|
|
|
|
$html = $commonInfo['head_style'].$main_style.$commonInfo['footer_style'].$commonInfo['other'].$commonInfo['head_html'].$main_html.$commonInfo['footer_html'];
|
|
|
|
$html = $this->getHeadFooter($html);//组装数据
|
|
|
|
$data['html'] = $html;
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :非定制获取头部+底部
|
|
|
|
* @name :getTemplateComHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/4/29 16:53
|
|
|
|
*/
|
|
|
|
public function getTemplateComHtml($source,$is_list,$is_custom,$template_id){
|
|
|
|
$condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
|
|
|
|
$headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id);
|
|
|
|
$bTemplateComModel = new BTemplateCom();
|
|
|
|
$condition['common_type'] = BTemplate::COMMON_OTHER;
|
|
|
|
$condition['source'] = $headComInfo['source'];
|
|
|
|
$otherInfo = $bTemplateComModel->read($condition);
|
|
|
|
if($otherInfo === false){
|
|
|
|
$this->fail('获取失败,请联系管理员');
|
|
|
|
}
|
|
|
|
$footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id);
|
|
|
|
$data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '',
|
|
|
|
'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? ''];
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :公共头部
|
|
|
|
* @name :HeadComHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/4/29 17:20
|
|
|
|
*/
|
|
|
|
public function getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id){
|
|
|
|
$commonHead = $this->getType($source,$is_list,$is_custom,BTemplate::COMMON_HEAD,$template_id);
|
|
|
|
$bTemplateComModel = new BTemplateCom();
|
|
|
|
$condition['source'] = $commonHead;
|
|
|
|
$condition['common_type'] = BTemplate::COMMON_HEAD;
|
|
|
|
$headComInfo = $bTemplateComModel->read($condition);
|
|
|
|
if($headComInfo === false){
|
|
|
|
//取默认公共的
|
|
|
|
$condition['source'] = BTemplate::SOURCE_COM;
|
|
|
|
$headComInfo = $bTemplateComModel->read($condition);
|
|
|
|
if($headComInfo === false){
|
|
|
|
$this->fail('获取失败,请联系管理员');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($headComInfo);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :公共底部
|
|
|
|
* @name :footerComHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/4/29 17:18
|
|
|
|
*/
|
|
|
|
public function getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id){
|
|
|
|
$bTemplateComModel = new BTemplateCom();
|
|
|
|
$condition['common_type'] = BTemplate::COMMON_FOOTER;
|
|
|
|
$condition['source'] = $this->getType($source,$is_list,$is_custom,BTemplate::COMMON_FOOTER,$template_id);
|
|
|
|
$footerComInfo = $bTemplateComModel->read($condition);
|
|
|
|
if($footerComInfo === false){
|
|
|
|
//取默认首页的
|
|
|
|
$condition['source'] = BTemplate::SOURCE_COM;
|
|
|
|
$footerComInfo = $bTemplateComModel->read($condition);
|
|
|
|
if($footerComInfo === false){
|
|
|
|
$this->fail('获取失败,请联系管理员');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($footerComInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :拼接获取公共头部底部
|
|
|
|
* @name :getHeadFooter
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -114,93 +184,80 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
];
|
|
|
|
$bTemplateMainModel->edit($data,['id'=>$mainInfo['id']]);
|
|
|
|
}
|
|
|
|
$this->saveCommonHtml($this->param['html'],$this->param['type'],$is_list,$template_id,$is_custom);
|
|
|
|
$this->saveTemplateCom($this->param['html'],$template_id,$this->param['type'],$is_list,$is_custom);
|
|
|
|
$route = RouteMap::getRoute('all',0,$this->user['project_id']);
|
|
|
|
$this->curlDelRoute(['route'=>$route,'new_route'=>$route]);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存公共头部底部
|
|
|
|
* @name :saveCommonHtml
|
|
|
|
* @remark :保存公共部分(头部。底部。连接部分)
|
|
|
|
* @name :saveTemplateCom
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/13 17:05
|
|
|
|
* @time :2024/4/29 10:32
|
|
|
|
*/
|
|
|
|
public function saveCommonHtml($html,$source,$is_list,$template_id,$is_custom){
|
|
|
|
$type = $this->getType($source,$is_list,$is_custom);//获取头部类型1-9(首页到自定义页面)
|
|
|
|
$templateCommonModel = new BTemplateCommon();
|
|
|
|
$commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]);//查看当前头部是否存在
|
|
|
|
public function saveTemplateCom($html,$template_id,$source,$is_list,$is_custom){
|
|
|
|
$typeArr = [BTemplate::COMMON_HEAD, BTemplate::COMMON_FOOTER, BTemplate::COMMON_OTHER];
|
|
|
|
$handleInfo = $this->handleCommonParam($html);
|
|
|
|
if($commonInfo === false){
|
|
|
|
$data = [
|
|
|
|
'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],'other'=>$handleInfo['other'],
|
|
|
|
'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'],
|
|
|
|
'type'=>$type,'template_id'=>$template_id, 'project_id'=>$this->user['project_id'],
|
|
|
|
];
|
|
|
|
$templateCommonModel->add($data);
|
|
|
|
}else{
|
|
|
|
$data = [
|
|
|
|
'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],'other'=>$handleInfo['other'],
|
|
|
|
'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'],
|
|
|
|
];
|
|
|
|
$templateCommonModel->edit($data,['id'=>$commonInfo['id']]);
|
|
|
|
}
|
|
|
|
//更新所有界面的other
|
|
|
|
return $templateCommonModel->edit(['other'=>$handleInfo['other']],['project_id'=>$this->user['project_id'],'template_id'=>$template_id]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :根据类型获取公共头和底
|
|
|
|
* @name :getCommonPage
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/21 16:55
|
|
|
|
*/
|
|
|
|
public function getCommonHtml($source,$is_list,$template_id,$is_custom){
|
|
|
|
$type = $this->getType($source,$is_list,$is_custom);
|
|
|
|
$data = [
|
|
|
|
'template_id' => $template_id,
|
|
|
|
'project_id' => $this->user['project_id'],
|
|
|
|
'type'=>$type
|
|
|
|
];
|
|
|
|
$commonTemplateModel = new BTemplateCommon();
|
|
|
|
$commonInfo = $commonTemplateModel->read($data);
|
|
|
|
if($commonInfo === false){
|
|
|
|
$data['type'] = BTemplate::SOURCE_HOME;
|
|
|
|
$commonInfo = $commonTemplateModel->read($data);
|
|
|
|
$templateComModel = new BTemplateCom();
|
|
|
|
foreach ($typeArr as $type){
|
|
|
|
if($type == BTemplate::COMMON_HEAD){
|
|
|
|
$param['html'] = $handleInfo['head_html'];
|
|
|
|
$param['html_style'] = $handleInfo['head_style'];
|
|
|
|
$typeSource = $this->getType($source,$is_list,$is_custom,$type,$template_id);//头部是否为独立头部
|
|
|
|
}elseif ($type == BTemplate::COMMON_FOOTER){
|
|
|
|
$param['html'] = $handleInfo['footer_html'];
|
|
|
|
$param['html_style'] = $handleInfo['footer_style'];
|
|
|
|
$typeSource = $this->getType($source,$is_list,$is_custom,$type,$template_id);
|
|
|
|
}else{
|
|
|
|
$param['html'] = $handleInfo['other'];
|
|
|
|
$param['html_style'] = null;
|
|
|
|
$typeSource = $this->getType($source,$is_list,$is_custom,BTemplate::COMMON_HEAD,$template_id);
|
|
|
|
}
|
|
|
|
//查看当前数据是否还存在
|
|
|
|
$condition = ['project_id'=>$this->user['project_id'],'template_id'=>$template_id,'is_list'=>$is_list,'is_custom'=>$is_custom,'source'=>$typeSource,'common_type'=>$type];
|
|
|
|
$info = $templateComModel->read($condition);
|
|
|
|
if($info === false){
|
|
|
|
$data = array_merge($param,$condition);
|
|
|
|
$templateComModel->add($data);
|
|
|
|
}else{
|
|
|
|
$templateComModel->edit($param,$condition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($commonInfo);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存时获取获取设置的类型
|
|
|
|
* @remark :(非定制)保存时获取获取设置的类型
|
|
|
|
* @name :getType
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/21 17:29
|
|
|
|
*/
|
|
|
|
public function getType($source,$is_list,$is_custom = 0){
|
|
|
|
$type = BTemplate::SOURCE_HOME;//首页公共头部底部
|
|
|
|
public function getType($source,$is_list,$is_custom = BTemplate::IS_NO_CUSTOM,$CommonType = BTemplate::COMMON_HEAD,$template_id = 0){
|
|
|
|
if($template_id == 0){
|
|
|
|
return $this->success($source);
|
|
|
|
}
|
|
|
|
$type = BTemplate::SOURCE_COM;//公共头部底部
|
|
|
|
$is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER;
|
|
|
|
if($is_custom == BTemplate::IS_CUSTOM){//拓展模块为首页头部
|
|
|
|
if($is_custom == BTemplate::IS_CUSTOM || $is_head == BTemplate::IS_NO_HEADER){//拓展模块为首页头部
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
|
|
//查看页面是否设置自定义头部底部
|
|
|
|
if($is_head != BTemplate::IS_NO_HEADER) {
|
|
|
|
$pageSettingModel = new PageSetting();
|
|
|
|
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
|
|
|
|
if ($pageInfo === false) {
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
|
|
if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::TYPE_PRODUCT_DETAIL;}}
|
|
|
|
else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::TYPE_PRODUCT_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::TYPE_BLOG_DETAIL;}}
|
|
|
|
else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::TYPE_BLOG_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::TYPE_NEWS_DETAIL;}}
|
|
|
|
else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::TYPE_NEWS_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_CUSTOM_PAGE;}}
|
|
|
|
$pageSettingModel = new PageSetting();
|
|
|
|
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id'],'type'=>$CommonType]);
|
|
|
|
if ($pageInfo === false) {
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
|
|
if($source == BTemplate::SOURCE_HOME){if ($pageInfo['home'] != 0){$type = BTemplate::SOURCE_HOME;}}
|
|
|
|
if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}
|
|
|
|
else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::SOURCE_PRODUCT;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::SOURCE_BLOG;}}
|
|
|
|
else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::SOURCE_BLOG;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::SOURCE_NEWS;}}
|
|
|
|
else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::SOURCE_NEWS;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::SOURCE_KEYWORD;}}
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -215,8 +272,8 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
//字符串截取
|
|
|
|
$param['head_html'] = characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s');
|
|
|
|
$param['footer_html'] = characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s');
|
|
|
|
$param['head_css'] = characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s');
|
|
|
|
$param['footer_css'] = characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s');
|
|
|
|
$param['head_style'] = characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s');
|
|
|
|
$param['footer_style'] = characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s');
|
|
|
|
$footer_other = str_replace('<header','',characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<header/s'));
|
|
|
|
$param['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);
|
|
|
|
return $this->success($param);
|
|
...
|
...
|
@@ -269,24 +326,42 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
if($info === false){
|
|
|
|
$html = '';
|
|
|
|
}else{
|
|
|
|
//扩展模块获取头部
|
|
|
|
if($is_custom == BTemplate::IS_CUSTOM){
|
|
|
|
$type = $this->param['type'];
|
|
|
|
}else{
|
|
|
|
$type = $this->getCustomizedType($this->param['type'],$is_list);
|
|
|
|
}
|
|
|
|
$commonTemplateModel = new BTemplateCommon();
|
|
|
|
$commonInfo = $commonTemplateModel->read(['template_id' => 0,'type'=>$type,'is_custom'=>$is_custom,'is_list'=>$is_list]);
|
|
|
|
if($commonInfo !== false){
|
|
|
|
$info['main_html'] = $this->handleAllHtml($commonInfo,$info['main_html']);
|
|
|
|
}
|
|
|
|
$html = $info['main_html'];
|
|
|
|
$commonInfo = $this->getCustomizeTemplateComHtml($this->param['type'],$is_custom,$is_list);
|
|
|
|
$html = $this->handleAllHtml($commonInfo,$info['main_html']);
|
|
|
|
}
|
|
|
|
//更新头部底部
|
|
|
|
return $this->success(['html'=>$html]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :定制获取头部底部
|
|
|
|
* @name :getCustomizedCommonHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/29 13:13
|
|
|
|
*/
|
|
|
|
public function getCustomizeTemplateComHtml($type,$is_custom,$is_list,$template_id = 0){
|
|
|
|
$data = ['head_html'=>'','head_style'=>'','footer_html'=>'','footer_style'=>'','other'=>''];
|
|
|
|
$param = ['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type,'is_custom'=>$is_custom,'is_list'=>$is_list];
|
|
|
|
$commonTemplateModel = new BTemplateCom();
|
|
|
|
$commonList = $commonTemplateModel->list($param);
|
|
|
|
if(!empty($commonList)){
|
|
|
|
foreach ($commonList as $v){
|
|
|
|
if($v['common_type'] == BTemplate::COMMON_HEAD){
|
|
|
|
$data['head_html'] = $v['html'];
|
|
|
|
$data['head_style'] = $v['html_style'];
|
|
|
|
}elseif ($v['common_type'] == BTemplate::COMMON_FOOTER){
|
|
|
|
$data['footer_html'] = $v['html'];
|
|
|
|
$data['footer_style'] = $v['html_style'];
|
|
|
|
}else{
|
|
|
|
$data['other'] = $v['html'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :返回整个html截取代码
|
|
|
|
* @name :handleAllHtml
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -329,7 +404,7 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
$bTemplateMainModel->edit(['main_html'=>$this->param['html']],['id'=>$mainInfo['id']]);
|
|
|
|
}
|
|
|
|
//更新头部底部
|
|
|
|
$this->saveCustomizeCommon($this->param['html'],$this->param['type'],$is_list,$is_custom);
|
|
|
|
$this->saveTemplateCom($this->param['html'],0,$this->param['type'],$is_list,$is_custom);
|
|
|
|
}catch (\Exception $exception){
|
|
|
|
$this->fail('保存失败,请联系开发人员');
|
|
|
|
}
|
|
...
|
...
|
@@ -337,73 +412,6 @@ class InitHtmlLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :定制代码更新头部信息
|
|
|
|
* @name :saveCustomizeCommon
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/6 10:29
|
|
|
|
*/
|
|
|
|
public function saveCustomizeCommon($html,$source,$is_list,$is_custom){
|
|
|
|
if($is_custom == BTemplate::IS_CUSTOM){
|
|
|
|
$type = $source;
|
|
|
|
}else{
|
|
|
|
$type = $this->getCustomizedType($source,$is_list);
|
|
|
|
}
|
|
|
|
$templateCommonModel = new BTemplateCommon();
|
|
|
|
$commonInfo = $templateCommonModel->read(['template_id'=>0,'type'=>$type,'is_custom'=>$is_custom,'is_list'=>$is_list]);//查看当前头部是否存在
|
|
|
|
$handleInfo = $this->handleCommonParam($html);
|
|
|
|
if($commonInfo === false){
|
|
|
|
$data = [
|
|
|
|
'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],
|
|
|
|
'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'],
|
|
|
|
'type'=>$type,'template_id'=>0, 'project_id'=>$this->user['project_id'],
|
|
|
|
'is_custom'=>$is_custom,'is_list'=>$is_list
|
|
|
|
];
|
|
|
|
$templateCommonModel->add($data);
|
|
|
|
}else{
|
|
|
|
$data = [
|
|
|
|
'head_html'=>$handleInfo['head_html'], 'head_css'=>$handleInfo['head_css'],
|
|
|
|
'footer_html'=>$handleInfo['footer_html'], 'footer_css'=>$handleInfo['footer_css'],
|
|
|
|
];
|
|
|
|
$templateCommonModel->edit($data,['id'=>$commonInfo['id']]);
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :定制页面头部类型---根据source获取type类型
|
|
|
|
* @name :getType
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/16 11:20
|
|
|
|
*/
|
|
|
|
public function getCustomizedType($source,$is_list){
|
|
|
|
$type = BTemplate::TYPE_HOME;
|
|
|
|
if($source == BTemplate::SOURCE_PRODUCT){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_PRODUCT_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_PRODUCT_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($source == BTemplate::SOURCE_BLOG){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_BLOG_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_BLOG_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($source == BTemplate::SOURCE_NEWS){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_NEWS_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_NEWS_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :前端获取设置模块(侧边栏)
|
|
|
|
* @name :getInitModuleMain
|
|
|
|
* @author :lyh
|
...
|
...
|
|