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,21 +52,22 @@ function table($status, $icon='arrow-circle-o-down') {
foreach ($list as $pageKey) {
$page = buildPage($pageKey);
if ($page) {
echo '<tr>
<td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
.'</a>
</td>
<td class="uk-text-center">'.$page->position().'</td>';
if ($page->isParent() || $status!='published') {
echo '<tr>
<td>
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
.'</a>
</td>
<td class="uk-text-center">'.$page->position().'</td>';
$friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$page->key() : '/'.$Url->filters('page').'/'.$page->key();
echo '<td><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
echo '</tr>';
$friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$page->key() : '/'.$Url->filters('page').'/'.$page->key();
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">
@ -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 '<td><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>';
echo '</tr>';
}
}
}
}

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>';