mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-11 23:54:10 +02:00
Pages Plugin: expand improvments #27. and fixed delete action
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="3%"></td>
|
||||
<td><?php echo __('Name', 'pages'); ?></td>
|
||||
<td><?php echo __('Author', 'pages'); ?></td>
|
||||
<td><?php echo __('Status', 'pages'); ?></td>
|
||||
@@ -32,12 +33,28 @@
|
||||
if ($page['parent'] != '') { $dash = Html::arrow('right').' '; } else { $dash = ""; }
|
||||
?>
|
||||
<?php if ($page['slug'] != 'error404') { ?>
|
||||
<tr>
|
||||
<?php
|
||||
$expand = PagesAdmin::$pages->select('[slug="'.(string)$page['parent'].'"]', null);
|
||||
if ($page['parent'] !== '' && isset($expand['expand']) && $expand['expand'] == '1') { $visibility = 'style="display:none;"'; } else { $visibility = ''; }
|
||||
?>
|
||||
<tr <?php echo $visibility; ?> <?php if(trim($page['parent']) !== '') {?> rel="children_<?php echo $page['parent']; ?>" <?php } ?>>
|
||||
<td>
|
||||
<?php
|
||||
if (count(PagesAdmin::$pages->select('[parent="'.(string)$page['slug'].'"]', 'all')) > 0) {
|
||||
if (isset($page['expand']) && $page['expand'] == '1') {
|
||||
echo '<a href="javascript:;" class="btn-expand parent" rel="'.$page['slug'].'">+</a>';
|
||||
} else {
|
||||
echo '<a href="javascript:;" class="btn-expand parent" rel="'.$page['slug'].'">-</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$parent = (trim($page['parent']) == '') ? '' : $page['parent'].'/';
|
||||
$_parent = (trim($page['parent']) == '') ? '' : $page['parent'];
|
||||
$parent = (trim($page['parent']) == '') ? '' : $page['parent'].'/';
|
||||
echo (trim($page['parent']) == '') ? '' : ' ';
|
||||
echo $dash.Html::anchor(Html::toText($page['title']), $site_url.$parent.$page['slug'], array('target' => '_blank'));
|
||||
echo $dash.Html::anchor(Html::toText($page['title']), $site_url.$parent.$page['slug'], array('target' => '_blank', 'rel' => 'children_'.$_parent));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
@@ -68,6 +85,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
|
Reference in New Issue
Block a user