setData('userLabel', SessionManager::getSession()->getUserLabel()); } /** * Gets the path to the layout * @return array */ protected function getLayout() { $this->setData('homeUrl', $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID)->getUrl('ProctoringHome')); $this->setData('logout', $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID)->getUrl('ProctoringLogout')); return ['layout.tpl', 'taoProctoring']; } /** * Gets the data table request options * * @param array $defaults * @return array */ protected function getRequestOptions(array $defaults = []) { $defaults = array_merge($this->getDefaultOptions(), $defaults); $page = $this->hasRequestParameter('page') ? $this->getRequestParameter('page') : $defaults['page']; $rows = $this->hasRequestParameter('rows') ? $this->getRequestParameter('rows') : $defaults['rows']; $sortBy = $this->hasRequestParameter('sortby') ? $this->getRequestParameter('sortby') : $defaults['sortby']; $sortOrder = $this->hasRequestParameter('sortorder') ? $this->getRequestParameter('sortorder') : $defaults['sortorder']; $filter = $this->hasRequestParameter('filter') ? $this->getRequestParameter('filter') : $defaults['filter']; $filterquery = $this->hasRequestParameter('filterquery') ? $this->getRequestParameter('filterquery') : $defaults['filter']; $periodStart = $this->hasRequestParameter('periodStart') ? $this->getRequestParameter('periodStart') : $defaults['periodStart']; $periodEnd = $this->hasRequestParameter('periodEnd') ? $this->getRequestParameter('periodEnd') : $defaults['periodEnd']; $detailed = $this->hasRequestParameter('detailed') ? $this->getRequestParameter('detailed') : 'false'; $detailed = filter_var($detailed, FILTER_VALIDATE_BOOLEAN); return array( 'page' => $page, 'rows' => $rows, 'sortBy' => $sortBy, 'sortOrder' => $sortOrder, 'filter' => $filter ? $filter : $filterquery, 'periodStart' => $periodStart, 'detailed' => $detailed, 'periodEnd' => $periodEnd ); } /** * @return array */ private function getDefaultOptions() { $today = new DateTime(); return [ 'page' => DataTableHelper::DEFAULT_PAGE, 'rows' => DataTableHelper::DEFAULT_ROWS, 'sortby' => 'id', 'sortorder' => DataTableHelper::DEFAULT_SORT_ORDER, 'filter' => null, 'periodStart' => $today->format('Y-m-d'), 'periodEnd' => $today->format('Y-m-d') ]; } }