diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php
index 9812ba83..f81f640c 100644
--- a/bl-kernel/admin/views/edit-content.php
+++ b/bl-kernel/admin/views/edit-content.php
@@ -76,12 +76,6 @@
-
-
@@ -140,7 +134,7 @@
echo Bootstrap::formSelect(array(
'name'=>'type',
'label'=>'Type',
- 'selected'=>$page->status(),
+ 'selected'=>$page->type(),
'options'=>array(
''=>'- Default -',
'sticky'=>'Sticky',
@@ -179,8 +173,19 @@
'placeholder'=>'',
'value'=>$page->template()
));
- ?>
+ ?>
+
diff --git a/bl-kernel/dbpages.class.php b/bl-kernel/dbpages.class.php
index df14d23d..c16e6b49 100644
--- a/bl-kernel/dbpages.class.php
+++ b/bl-kernel/dbpages.class.php
@@ -93,7 +93,7 @@ class dbPages extends dbJSON
// Set type of the page
if ($args['status']=='static') {
- $args['type'] = 'page';
+ $args['type'] = 'static';
}
// Set type to the variables
@@ -346,7 +346,7 @@ class dbPages extends dbJSON
{
$tmp = $this->db;
foreach ($tmp as $key=>$fields) {
- if ($fields['status']!='published') {
+ if ($fields['status']!='published' || $fields['type'] != "") {
unset($tmp[$key]);
}
}
@@ -362,7 +362,7 @@ class dbPages extends dbJSON
{
$tmp = $this->db;
foreach ($tmp as $key=>$fields) {
- if ($fields['status']!='static') {
+ if ($fields['type']!='static') {
unset($tmp[$key]);
}
}
@@ -408,7 +408,7 @@ class dbPages extends dbJSON
{
$tmp = $this->db;
foreach ($tmp as $key=>$fields) {
- if($fields['status']!='sticky') {
+ if($fields['type']!='sticky') {
unset($tmp[$key]);
}
}
diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php
index 3c78b191..0abbcf1d 100644
--- a/bl-kernel/page.class.php
+++ b/bl-kernel/page.class.php
@@ -399,7 +399,7 @@ class Page {
// (boolean) Returns TRUE if the page is static, FALSE otherwise
public function isStatic()
{
- return ($this->getValue('status')=='static');
+ return ($this->getValue('type')=='static');
}
// (string) Returns status of the page
@@ -408,6 +408,11 @@ class Page {
return $this->getValue('status');
}
+ public function type()
+ {
+ return $this->getValue('type');
+ }
+
// Returns the title field
public function title()
{