From ca6d78009cedc34044af093d6e860095c1b088ff Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 22 Jan 2018 20:33:53 +0100 Subject: [PATCH] Fix manage content --- bl-kernel/admin/views/content.php | 6 +++--- bl-kernel/page.class.php | 22 +++++++++++++++------- install.php | 2 ++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php index f1dc76ed..fdc6af39 100644 --- a/bl-kernel/admin/views/content.php +++ b/bl-kernel/admin/views/content.php @@ -52,7 +52,7 @@ function table($status, $icon='arrow-circle-o-down') { foreach ($list as $pageKey) { $page = buildPage($pageKey); if ($page) { - if ($page->isParent() || $status!='published') { + if (!$page->isChild() || $status!='published') { echo ' ' @@ -71,7 +71,7 @@ function table($status, $icon='arrow-circle-o-down') { echo ' - ' + ' .($child->title()?$child->title():''.$Language->g('Empty title').' ') .' @@ -111,7 +111,7 @@ if ($Url->pageNumber()==1) { table('scheduled', 'clock-o'); table('static', 'thumb-tack'); } -table('published', 'circle-o'); +table('published', 'chevron-right'); echo ' diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php index 95495a14..825a8f6d 100644 --- a/bl-kernel/page.class.php +++ b/bl-kernel/page.class.php @@ -417,12 +417,6 @@ class Page { return false; } - // Returns TURE if the page has a parent, FALSE otherwise - public function hasParent() - { - return $this->parentKey()!==false; - } - // Returns the parent method output, if the page doesn't have a parent returns FALSE public function parentMethod($method) { @@ -435,24 +429,38 @@ class Page { return false; } + // Returns TURE if the page has a parent, FALSE otherwise + public function hasParent() + { + return $this->parentKey()!==false; + } + + // Returns TRUE if the page is a child, FALSE otherwise + public function isChild() + { + return $this->parentKey()!==false; + } + // Returns an array with all children's key public function children() { return $this->getValue('children'); } + // Returns an array with all children's key public function subpages() { return $this->children(); } - // Returns TRUE if the page has subpages/children, FALSE otherwise + // Returns TRUE if the page has children public function hasSubpages() { $subpages = $this->subpages(); return !empty($subpages); } + // Returns TRUE if the page is a parent public function isParent() { return $this->hasSubpages(); diff --git a/install.php b/install.php index 10db7849..0f202a4f 100644 --- a/install.php +++ b/install.php @@ -609,9 +609,11 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { +