From e11663532862ff17ece85c43c1a4ee0338c1356e Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 22 Jan 2018 00:21:47 +0100 Subject: [PATCH] Remove subpages for static pages --- bl-kernel/admin/themes/default/init.php | 3 ++- bl-kernel/admin/views/content.php | 24 +++++++++++++----------- bl-kernel/admin/views/edit-content.php | 3 ++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/bl-kernel/admin/themes/default/init.php b/bl-kernel/admin/themes/default/init.php index cdc2ce1b..e2a6c873 100644 --- a/bl-kernel/admin/themes/default/init.php +++ b/bl-kernel/admin/themes/default/init.php @@ -167,11 +167,12 @@ class HTML { $id = 'js'.$args['name']; $type = isset($args['type']) ? $args['type'] : 'text'; $class = empty($args['class']) ? '' : 'class="'.$args['class'].'"'; + $disabled = empty($args['disabled']) ? '' : 'disabled'; $html = '
'; $html .= ''; $html .= '
'; - $html .= ''; if(isset($args['addEmptySpace'])) { $html .= ''; } diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php index 85b77620..f1dc76ed 100644 --- a/bl-kernel/admin/views/content.php +++ b/bl-kernel/admin/views/content.php @@ -52,21 +52,22 @@ function table($status, $icon='arrow-circle-o-down') { foreach ($list as $pageKey) { $page = buildPage($pageKey); if ($page) { - echo ' - - ' - .($page->title()?$page->title():''.$Language->g('Empty title').' ') - .' - - '.$page->position().''; + if ($page->isParent() || $status!='published') { + echo ' + + ' + .($page->title()?$page->title():''.$Language->g('Empty title').' ') + .' + + '.$page->position().''; - $friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$page->key() : '/'.$Url->filters('page').'/'.$page->key(); - echo ''.$friendlyURL.''; - echo ''; + $friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$page->key() : '/'.$Url->filters('page').'/'.$page->key(); + echo ''.$friendlyURL.''; + echo ''; - if ($page->isParent()) { foreach ($page->children() as $childKey) { $child = buildPage($childKey); + if ($child->published()) { echo ' @@ -79,6 +80,7 @@ function table($status, $icon='arrow-circle-o-down') { $friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$child->key() : '/'.$Url->filters('page').'/'.$child->key(); echo ''.$friendlyURL.''; echo ''; + } } } } diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index 0baa4e84..fa05efd4 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -177,7 +177,8 @@ echo '
'; 'class'=>'uk-width-1-1 uk-form-medium', 'options'=>$options, 'selected'=>$page->parentKey(), - 'tip'=>'' + 'tip'=>'', + 'disabled'=>$page->status()=='static' )); echo '
';