Remove subpages for static pages
This commit is contained in:
parent
f2c59ee70b
commit
e116635328
|
@ -167,11 +167,12 @@ class HTML {
|
||||||
$id = 'js'.$args['name'];
|
$id = 'js'.$args['name'];
|
||||||
$type = isset($args['type']) ? $args['type'] : 'text';
|
$type = isset($args['type']) ? $args['type'] : 'text';
|
||||||
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
|
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
|
||||||
|
$disabled = empty($args['disabled']) ? '' : 'disabled';
|
||||||
|
|
||||||
$html = '<div class="uk-form-row">';
|
$html = '<div class="uk-form-row">';
|
||||||
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
|
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
|
||||||
$html .= '<div class="uk-form-controls">';
|
$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'])) {
|
if(isset($args['addEmptySpace'])) {
|
||||||
$html .= '<option value=""></option>';
|
$html .= '<option value=""></option>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,21 +52,22 @@ function table($status, $icon='arrow-circle-o-down') {
|
||||||
foreach ($list as $pageKey) {
|
foreach ($list as $pageKey) {
|
||||||
$page = buildPage($pageKey);
|
$page = buildPage($pageKey);
|
||||||
if ($page) {
|
if ($page) {
|
||||||
echo '<tr>
|
if ($page->isParent() || $status!='published') {
|
||||||
<td>
|
echo '<tr>
|
||||||
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
|
<td>
|
||||||
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
|
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-'.$icon.'"></i> '
|
||||||
.'</a>
|
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
|
||||||
</td>
|
.'</a>
|
||||||
<td class="uk-text-center">'.$page->position().'</td>';
|
</td>
|
||||||
|
<td class="uk-text-center">'.$page->position().'</td>';
|
||||||
|
|
||||||
$friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$page->key() : '/'.$Url->filters('page').'/'.$page->key();
|
$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 '<td><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
if ($page->isParent()) {
|
|
||||||
foreach ($page->children() as $childKey) {
|
foreach ($page->children() as $childKey) {
|
||||||
$child = buildPage($childKey);
|
$child = buildPage($childKey);
|
||||||
|
if ($child->published()) {
|
||||||
echo '<tr>
|
echo '<tr>
|
||||||
<td class="child-title">
|
<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();
|
$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 '<td><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,8 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
|
||||||
'class'=>'uk-width-1-1 uk-form-medium',
|
'class'=>'uk-width-1-1 uk-form-medium',
|
||||||
'options'=>$options,
|
'options'=>$options,
|
||||||
'selected'=>$page->parentKey(),
|
'selected'=>$page->parentKey(),
|
||||||
'tip'=>''
|
'tip'=>'',
|
||||||
|
'disabled'=>$page->status()=='static'
|
||||||
));
|
));
|
||||||
|
|
||||||
echo '<hr>';
|
echo '<hr>';
|
||||||
|
|
Loading…
Reference in New Issue