echo $Language->g('Posted By') . ' ' . $Post->user('username') . ' ' . $Post->date(); ?> </p> </div> <!-- Plugins Post End --> <?php Theme::plugins('postEnd'); ?> <hr> <?php } ?> <!-- Pager --> <ul class="pager"> <?php if (Paginator::get('showNewer')) { echo '<li class="previous"><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('prevPage') . '">Previous</a></li>'; } if (Paginator::get('showOlder')) { echo '<li class="next"><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('nextPage') . '">Next</a></li>'; } ?> </ul> </div> </div> </div>
$status = false; if ($Post->scheduled()) { $status = $Language->g('Scheduled'); } 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>'; echo '<td><a target="_blank" href="' . $Post->permalink() . '">' . $Url->filters('post') . '/' . $Post->key() . '</a></td>'; echo '</tr>'; } echo ' </tbody> </table> '; ?> <div id="paginator"> <ul> <?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>'; } echo '<li class="list">' . (Paginator::get('currentPage') + 1) . ' / ' . (Paginator::get('numberOfPages') + 1) . '</li>'; 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>'; } ?> </ul> </div>
<?php $tags = $Post->tags(true); foreach ($tags as $tagKey => $tagName) { echo '<li><a href="' . HTML_PATH_ROOT . $Url->filters('tag') . '/' . $tagKey . '">' . $tagName . '</a></li>'; } ?> </ul> </footer> <!-- Plugins Post End --> <?php Theme::plugins('postEnd'); ?> </article> <?php } ?> <!-- Pagination --> <ul class="actions pagination"> <?php if (Paginator::get('showNewer')) { echo '<li><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('prevPage') . '" class="button big previous">Previous Page</a></li>'; } if (Paginator::get('showOlder')) { echo '<li><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('nextPage') . '" class="button big next">Next Page</a></li>'; } ?> </ul>
/** * search * * @return Response */ public function search() { $query = Input::get('q'); $page = Input::get('page'); $posts = []; if ($query) { $posts = Post::search($query); } if (count($posts)) { $url = sprintf('/search?q=%s&page=:page', rawurlencode($query)); $paginator = Paginator::get($posts, $page, $url); } else { $paginator = null; } $html = Layout::find('search')->render(['search' => true, 'query' => $query, 'paginator' => $paginator]); return Response::make($html); }
$tags = $Post->tags(true); foreach ($tags as $tagKey => $tagName) { echo '<li><a href="' . HTML_PATH_ROOT . $Url->filters('tag') . '/' . $tagKey . '">' . $tagName . '</a></li>'; } ?> </ul> </footer> <!-- Plugins Post End --> <?php Theme::plugins('postEnd'); ?> </article> <?php } ?> <!-- Pagination --> <ul class="actions pagination"> <?php if (Paginator::get('showNewer')) { echo '<li><a href="' . Paginator::urlPrevPage() . '" class="button previous">Previous Page</a></li>'; } if (Paginator::get('showOlder')) { echo '<li><a href="' . Paginator::urlNextPage() . '" class="button next">Next Page</a></li>'; } ?> </ul>
/** * look * * @param string $current * @param string $itype * @param string $down * @return string */ public function look($current = '', $itype = '', $down = '') { if (self::$_instance->is_link($current)) { $link = self::$_instance->readlink($current); $current = $link[1] . '/'; } if (!self::$_instance->is_dir($current)) { return ListData::getListNotFoundData(); } if (!self::$_instance->is_readable($current)) { return ListData::getListDenyData(); } $add = isset($_GET['add_archive']) ? $_GET['add_archive'] : ''; $pg = isset($_GET['pg']) ? $_GET['pg'] : 1; $html = ListData::getListData($current, $itype, $down, $pg, $add); if ($html) { if ($itype == 'time') { $out = '&time'; } elseif ($itype == 'type') { $out = '&type'; } elseif ($itype == 'size') { $out = '&size'; } elseif ($itype == 'chmod') { $out = '&chmod'; } elseif ($itype == 'uid') { $out = '&uid'; } elseif ($itype == 'gid') { $out = '&gid'; } else { $out = ''; } $out .= $down ? '&down' : '&up'; return $html . Paginator::get($pg, ListData::$getListCountPages, '&c=' . $current . $out . $add); } else { return ListData::getListEmptyData(); } }
public function testEmpty() { $res = Paginator::get([]); $this->assertNull($res['next_url']); }