mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-01 11:29:59 +08:00
Merge branch 'dev' of gitee.com:zongzhige/shopxo into dev
This commit is contained in:
commit
e43fe7ae0a
@ -89,8 +89,9 @@ class Article extends Common
|
||||
{
|
||||
MyViewAssign('home_seo_site_description', $ret['data'][0]['seo_desc']);
|
||||
}
|
||||
|
||||
MyViewAssign('article', $ret['data'][0]);
|
||||
$article = $ret['data'][0];
|
||||
$this->PluginsHook($id, $article);
|
||||
MyViewAssign('article', $article);
|
||||
return MyView();
|
||||
}
|
||||
|
||||
@ -98,5 +99,33 @@ class Article extends Common
|
||||
MyViewAssign('msg', '文章不存在或已删除');
|
||||
return MyView('public/tips_error');
|
||||
}
|
||||
|
||||
/**
|
||||
* 钩子处理
|
||||
* @author whats
|
||||
* @blog
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [int] $article_id [文章id]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function PluginsHook($article_id, &$article)
|
||||
{
|
||||
$hook_arr = [
|
||||
//文章内容内部钩子
|
||||
'plugins_view_article_detail_content_within',
|
||||
];
|
||||
foreach($hook_arr as $hook_name)
|
||||
{
|
||||
MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name,
|
||||
[
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => false,
|
||||
'article_id' => $article_id,
|
||||
'article' => &$article,
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -25,6 +25,19 @@
|
||||
<hr class="am-article-divider" />
|
||||
</div>
|
||||
<div class="am-article am-scrollable-horizontal">{{$article.content|raw}}</div>
|
||||
<!-- 文章详情内部钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_article_detail_content_within</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if !empty($plugins_view_article_detail_content_within_data) and is_array($plugins_view_article_detail_content_within_data)}}
|
||||
{{foreach $plugins_view_article_detail_content_within_data as $hook}}
|
||||
{{if is_string($hook) or is_int($hook)}}
|
||||
{{$hook|raw}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 左侧内容 -->
|
||||
|
Loading…
Reference in New Issue
Block a user