Remove subpages for static pages

This commit is contained in:
Diego Najar 2018-01-22 00:21:47 +01:00
parent f2c59ee70b
commit e116635328
3 changed files with 17 additions and 13 deletions

View File

@ -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 = '<div class="uk-form-row">';
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
$html .= '<div class="uk-form-controls">';
$html .= '<select id="'.$id.'" name="'.$args['name'].'" '.$class.'>';
$html .= '<select id="'.$id.'" name="'.$args['name'].'" '.$class.' '.$disabled.'>';
if(isset($args['addEmptySpace'])) {
$html .= '<option value=""></option>';
}

View File

@ -52,6 +52,7 @@ function table($status, $icon='arrow-circle-o-down') {
foreach ($list as $pageKey) {
$page = buildPage($pageKey);
if ($page) {
if ($page->isParent() || $status!='published') {
echo '<tr>
<td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
@ -64,9 +65,9 @@ function table($status, $icon='arrow-circle-o-down') {
echo '<td><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
echo '</tr>';
if ($page->isParent()) {
foreach ($page->children() as $childKey) {
$child = buildPage($childKey);
if ($child->published()) {
echo '<tr>
<td class="child-title">
@ -83,6 +84,7 @@ function table($status, $icon='arrow-circle-o-down') {
}
}
}
}
} else {
foreach ($list as $pageKey) {
$page = buildPage($pageKey);

View File

@ -177,7 +177,8 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>$options,
'selected'=>$page->parentKey(),
'tip'=>''
'tip'=>'',
'disabled'=>$page->status()=='static'
));
echo '<hr>';