/** * Generates list of all banned visitors in the system. * * @param Request $request Incoming request. * @return string Rendered page content. */ public function indexAction(Request $request) { $operator = $this->getOperator(); $page = array('errors' => array()); // Prepare list of all banned visitors $blocked_list = array(); foreach (Ban::all() as $ban) { $blocked_list[] = array('banid' => $ban->id, 'created' => $ban->created, 'till' => $ban->till, 'address' => $ban->address, 'comment' => $ban->comment); } $page['title'] = getlocal('Ban List'); $page['menuid'] = 'bans'; $pagination = setup_pagination($blocked_list); $page['pagination'] = $pagination['info']; $page['pagination.items'] = $pagination['items']; $page = array_merge($page, prepare_menu($operator)); $this->getAssetManager()->attachJs('js/compiled/bans.js'); return $this->render('bans', $page); }