Other changes

This commit is contained in:
Dimo Belov 2018-07-10 23:51:48 +03:00
parent b290209a41
commit b276e543a7
3 changed files with 23 additions and 13 deletions

View File

@ -76,12 +76,6 @@
<textarea id="jseditor" style="display:none;"><?php echo $page->contentRaw(false) ?></textarea>
</div>
<div class="form-group mt-2">
<button id="jsbuttonSave" type="button" class="btn btn-primary"><?php echo $L->g('Publish') ?></button>
<button id="jsbuttonDraft" type="button" class="btn btn-secondary"><?php echo $L->g('Save as draft') ?></button>
<a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard" class="btn btn-secondary"><?php echo $L->g('Cancel') ?></a>
</div>
</div>
<!-- TABS IMAGES -->
@ -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()
));
?>
?>
</div>
<div class="form-group mt-2">
<button id="jsbuttonSave" type="button" class="btn btn-primary">
<?php echo $L->g('Publish') ?>
</button>
<button id="jsbuttonDraft" type="button" class="btn btn-secondary">
<?php echo $L->g('Save as draft') ?>
</button>
<a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard" class="btn btn-secondary">
<?php echo $L->g('Cancel') ?>
</a>
</div>
<!-- Modal for Categories -->
<div id="jscategoryModal" class="modal fade" tabindex="-1" role="dialog">

View File

@ -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]);
}
}

View File

@ -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()
{