Ojs\JournalBundle\Controller\BoardController::indexAction PHP 메소드

indexAction() 공개 메소드

Lists all Board entities.
public indexAction ( Request $request )
$request Symfony\Component\HttpFoundation\Request
    public function indexAction(Request $request)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        $eventDispatcher = $this->get('event_dispatcher');
        if (!$this->isGranted('VIEW', $journal, 'boards')) {
            throw new AccessDeniedException("You not authorized for view this journal's boards!");
        }
        $source = new Entity('OjsJournalBundle:Board');
        $grid = $this->get('grid')->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction[] = $gridAction->showAction('ojs_journal_board_show', ['id', 'journalId' => $journal->getId()], null, ['icon' => 'users', 'title' => 'add.user']);
        if ($this->isGranted('EDIT', $journal, 'boards')) {
            $rowAction[] = $gridAction->editAction('ojs_journal_board_edit', ['id', 'journalId' => $journal->getId()]);
            $rowAction[] = $gridAction->deleteAction('ojs_journal_board_delete', ['id', 'journalId' => $journal->getId()]);
        }
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);
        $listEvent = new ListEvent();
        $listEvent->setGrid($grid);
        $eventDispatcher->dispatch(BoardEvents::LISTED, $listEvent);
        $grid = $listEvent->getGrid();
        return $grid->getGridResponse('OjsJournalBundle:Board:index.html.twig');
    }