mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 13:06:22 +05:30
Improve filter
This commit is contained in:
parent
2101bcda76
commit
27da6f193b
4 changed files with 21 additions and 9 deletions
|
|
@ -55,7 +55,7 @@ $(function() {
|
|||
<span><a target="_blank" href="<?php echo $sp->url;?>"><?php echo $sp->title;?></a></span>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<span><a class="btn btn-primary btn-xs" href="<?php echo $sp->url;?>/edit?destination=admin/pages/<?php echo $sp->parent;?>"><?php echo i18n('Edit');?></a> <a class="btn btn-danger btn-xs" href="<?php echo $sp->url;?>/delete?destination=admin/pages/<?php echo $sp->parent;?>"><?php echo i18n('Delete');?></a></span>
|
||||
<span><a class="btn btn-primary btn-xs" href="<?php echo $sp->url;?>/edit?destination=admin/pages/<?php echo $sp->parentSlug;?>"><?php echo i18n('Edit');?></a> <a class="btn btn-danger btn-xs" href="<?php echo $sp->url;?>/delete?destination=admin/pages/<?php echo $sp->parentSlug;?>"><?php echo i18n('Delete');?></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
|
||||
<ul class="nav nav-pills">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" aria-current="page" href="<?php echo $static->url;?>"><?php echo i18n('View');?></a>
|
||||
</li>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
<div class="callout callout-info">
|
||||
<div>
|
||||
<h2 class="post-index"><?php echo $static->title ?></h2>
|
||||
<div><?php echo $static->description;?></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
<th><?php echo i18n('Operations');?></th>
|
||||
</tr>
|
||||
<?php foreach ($draftPages as $d): ?>
|
||||
<?php $count = count(find_subpage($d->md)); ?>
|
||||
<?php $count = count(find_subpage($d->slug)); ?>
|
||||
<tr>
|
||||
<td><?php echo $d->title ?></td>
|
||||
<td><?php echo format_date($d->lastMod) ?></td>
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
<th><?php echo i18n('Static_pages');?></th>
|
||||
</tr>
|
||||
<?php foreach ($draftSubpages as $sp): ?>
|
||||
<?php $parent = find_page($sp->parent);?>
|
||||
<?php $parent = find_page($sp->parentSlug);?>
|
||||
<tr>
|
||||
<td><?php echo $sp->title ?></td>
|
||||
<td><?php echo format_date($sp->lastMod) ?></td>
|
||||
|
|
|
|||
|
|
@ -51,8 +51,14 @@ function get_static_subpages($static = null)
|
|||
if ($static != null) {
|
||||
$stringLen = strlen($static);
|
||||
return array_filter($_sub_page, function ($sub_page) use ($static, $stringLen) {
|
||||
$x = explode("/", $sub_page['dirname']);
|
||||
if (strpos($x[2], $static) !== false) {
|
||||
$x = str_replace('content/static/', '', $sub_page['dirname']);
|
||||
$y = explode('.', $x);
|
||||
if (isset($y[1])) {
|
||||
$z = $y[1];
|
||||
} else {
|
||||
$z = $x;
|
||||
}
|
||||
if ($z == $static) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -125,8 +131,14 @@ function get_draft_subpages($static = null)
|
|||
if ($static != null) {
|
||||
$stringLen = strlen($static);
|
||||
return array_filter($_draftSubpage, function ($sub_page) use ($static, $stringLen) {
|
||||
$x = explode("/", $sub_page['dirname']);
|
||||
if (strpos($x[2], $static) !== false) {
|
||||
$x = str_replace('content/static/', '', $sub_page['dirname']);
|
||||
$y = explode('.', $x);
|
||||
if (isset($y[1])) {
|
||||
$z = $y[1];
|
||||
} else {
|
||||
$z = $x;
|
||||
}
|
||||
if ($z == $static) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue