Added "random" tab
This commit is contained in:
parent
aab67f4b6c
commit
f2947a2550
2 changed files with 16 additions and 0 deletions
|
@ -178,6 +178,19 @@ class PostController
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @route /random
|
||||||
|
* @route /random/{page}
|
||||||
|
* @validate page \d*
|
||||||
|
*/
|
||||||
|
public function randomAction($page = 1)
|
||||||
|
{
|
||||||
|
$this->listAction('order:random', $page);
|
||||||
|
$this->context->viewName = 'post-list';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @route /post/upload
|
* @route /post/upload
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
||||||
$nav []= ['Browse', \Chibi\UrlHelper::route('post', 'list')];
|
$nav []= ['Browse', \Chibi\UrlHelper::route('post', 'list')];
|
||||||
|
|
||||||
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
||||||
|
$nav []= ['Random', \Chibi\UrlHelper::route('post', 'random')];
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
||||||
$nav []= ['Favorites', \Chibi\UrlHelper::route('post', 'favorites')];
|
$nav []= ['Favorites', \Chibi\UrlHelper::route('post', 'favorites')];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue