bludit/bl-kernel/admin/views/manage-posts.php

61 lines
1.7 KiB
PHP
Raw Normal View History

2015-10-19 00:45:58 +02:00
<?php
HTML::title(array('title'=>$L->g('Manage posts'), 'icon'=>'folder'));
2016-09-25 22:38:03 +02:00
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'new-post"><i class="uk-icon-plus"></i> '.$L->g('Add a new post').'</a>';
2015-10-19 00:45:58 +02:00
echo '
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>'.$L->g('Title').'</th>
<th class="uk-text-center">'.$L->g('Published date').'</th>
<th>'.$L->g('Friendly URL').'</th>
</tr>
</thead>
<tbody>
';
foreach($posts as $Post)
{
$status = false;
if($Post->scheduled()) {
$status = $Language->g('Scheduled');
2015-05-05 03:00:01 +02:00
}
2015-10-19 00:45:58 +02:00
elseif(!$Post->published()) {
$status = $Language->g('Draft');
}
echo '<tr>';
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($status?'<span class="label-draft">'.$status.'</span>':'').($Post->title()?$Post->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ').'</a></td>';
echo '<td class="uk-text-center">'.$Post->dateRaw().'</td>';
2016-05-10 02:27:05 +02:00
$friendlyURL = Text::isEmpty($Url->filters('post')) ? '/'.$Post->key() : '/'.$Url->filters('post').'/'.$Post->key();
echo '<td><a target="_blank" href="'.$Post->permalink().'">'.$friendlyURL.'</a></td>';
2015-10-19 00:45:58 +02:00
echo '</tr>';
}
2015-05-05 03:00:01 +02:00
2015-10-19 00:45:58 +02:00
echo '
</tbody>
2015-07-20 05:14:12 +02:00
</table>
2015-10-19 00:45:58 +02:00
';
?>
2015-07-20 05:14:12 +02:00
<div id="paginator">
<ul>
2015-10-19 00:45:58 +02:00
<?php
if(Paginator::get('showNewer')) {
echo '<li class="previous"><a href="'.HTML_PATH_ADMIN_ROOT.'manage-posts?page='.Paginator::get('prevPage').'">« '.$Language->g('Prev page').'</a></li>';
}
2015-07-20 05:14:12 +02:00
2015-10-19 00:45:58 +02:00
echo '<li class="list">'.(Paginator::get('currentPage')+1).' / '.(Paginator::get('numberOfPages')+1).'</li>';
2015-07-20 05:14:12 +02:00
2015-10-19 00:45:58 +02:00
if(Paginator::get('showOlder')) {
echo '<li class="next"><a href="'.HTML_PATH_ADMIN_ROOT.'manage-posts?page='.Paginator::get('nextPage').'">'.$Language->g('Next page').' »</a></li>';
}
?>
2015-07-20 05:14:12 +02:00
</ul>
</div>