title = "Content List"
url = "/staff/contents/:slug"
layout = "staff"
is_hidden = 0
[contentType]
slug="{{ :slug }}"
==
user){
return redirect('/staff/login');
}
}
function onEnd()
{
$this['content_type_id'] = null;
if(!isset($this->contentType) || !$this->contentType){
return redirect('/staff/management');
}
if(isset($this->contentType) && $this->contentType){
$this->page['title']= $this->contentType->title;
$this['content_type_id'] = $this->contentType->id;
}
$this->prepareVars();
}
function onLoadMoreFeeds() {
$this->prepareVars();
}
function prepareVars() {
$options = post('Filter', [
'page' => 1,
'content_type_id' => $this['content_type_id']
]);
$this['contentList'] = StaffContentManagementContent::listFrontEnd($options);
$this['pageNumber'] = $this['contentList']->currentPage() + 1;
$this['lastPage'] = $this['contentList']->lastPage();
$this['content_type_id'] = $options['content_type_id'];
}
?>
==
{% if contentType.slug == 'staff-notices' %}
{% partial 'staff/notices' %}
{% else %}
{% partial 'staff/circulars' %}
{% endif %}