include sticky and static pages to the categories
This commit is contained in:
parent
bdf585b8db
commit
54868df652
|
@ -21,16 +21,22 @@ class Categories extends dbList {
|
||||||
$this->db[$key]['list'] = array();
|
$this->db[$key]['list'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a database with published pages
|
// Get pages database
|
||||||
$db = $pages->getPublishedDB(false);
|
$db = $pages->getDB(false);
|
||||||
foreach ($db as $pageKey=>$pageFields) {
|
foreach ($db as $pageKey=>$pageFields) {
|
||||||
if (!empty($pageFields['category'])) {
|
if (!empty($pageFields['category'])) {
|
||||||
$categoryKey = $pageFields['category'];
|
$categoryKey = $pageFields['category'];
|
||||||
if (isset($this->db[$categoryKey]['list'])) {
|
if (isset($this->db[$categoryKey]['list'])) {
|
||||||
|
if (
|
||||||
|
($db[$pageKey]['type']=='published') ||
|
||||||
|
($db[$pageKey]['type']=='sticky') ||
|
||||||
|
($db[$pageKey]['type']=='static')
|
||||||
|
) {
|
||||||
array_push($this->db[$categoryKey]['list'], $pageKey);
|
array_push($this->db[$categoryKey]['list'], $pageKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $this->save();
|
return $this->save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue