|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the CCDNForum ForumBundle |
|
5
|
|
|
* |
|
6
|
|
|
* (c) CCDN (c) CodeConsortium <http://www.codeconsortium.com/> |
|
7
|
|
|
* |
|
8
|
|
|
* Available on github <http://www.github.com/codeconsortium/> |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace CCDNForum\ForumBundle\Controller; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* |
|
18
|
|
|
* @category CCDNForum |
|
19
|
|
|
* @package ForumBundle |
|
20
|
|
|
* |
|
21
|
|
|
* @author Reece Fowell <[email protected]> |
|
22
|
|
|
* @license http://opensource.org/licenses/MIT MIT |
|
23
|
|
|
* @version Release: 2.0 |
|
24
|
|
|
* @link https://github.com/codeconsortium/CCDNForumForumBundle |
|
25
|
|
|
* |
|
26
|
|
|
*/ |
|
27
|
|
|
class UserBoardController extends BaseController |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* |
|
31
|
|
|
* @access public |
|
32
|
|
|
* @param string $forumName |
|
33
|
|
|
* @param int $boardId |
|
34
|
|
|
* @return RedirectResponse|RenderResponse |
|
|
|
|
|
|
35
|
|
|
*/ |
|
36
|
|
|
public function showAction($forumName, $boardId) |
|
37
|
|
|
{ |
|
38
|
|
|
$this->isFound($forum = $this->getForumModel()->findOneForumByName($forumName)); |
|
|
|
|
|
|
39
|
|
|
$this->isFound($board = $this->getBoardModel()->findOneBoardByIdWithCategory($boardId)); |
|
|
|
|
|
|
40
|
|
|
$this->isAuthorised($this->getAuthorizer()->canShowBoard($board, $forum)); |
|
41
|
|
|
$itemsPerPage = $this->getPageHelper()->getTopicsPerPageOnBoards(); |
|
42
|
|
|
$stickyTopics = $this->getTopicModel()->findAllTopicsStickiedByBoardId($boardId, true); |
|
43
|
|
|
$topicsPager = $this->getTopicModel()->findAllTopicsPaginatedByBoardId($boardId, $this->getQuery('page', 1), $itemsPerPage, true); |
|
44
|
|
|
|
|
45
|
|
|
return $this->renderResponse('CCDNForumForumBundle:User:Board/show.html.', array( |
|
46
|
|
|
'crumbs' => $this->getCrumbs()->addUserBoardShow($forum, $board), |
|
47
|
|
|
'forum' => $forum, |
|
48
|
|
|
'forumName' => $forumName, |
|
49
|
|
|
'board' => $board, |
|
50
|
|
|
'pager' => $topicsPager, |
|
51
|
|
|
'posts_per_page' => $this->container->getParameter('ccdn_forum_forum.topic.user.show.posts_per_page'), // for working out last page per topic. |
|
52
|
|
|
'sticky_topics' => $stickyTopics, |
|
53
|
|
|
)); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.