public function view() { $entity = $this->entityManager->find('Concrete\\Core\\Entity\\Express\\Entity', $this->exEntityID); if (is_object($entity)) { $category = $entity->getAttributeKeyCategory(); $list = new EntryList($entity); if ($this->displayLimit > 0) { $list->setItemsPerPage(intval($this->displayLimit)); } $set = unserialize($this->columns); $defaultSortColumn = $set->getDefaultSortColumn(); if ($this->request->query->has($list->getQuerySortDirectionParameter())) { $direction = $this->request->query->get($list->getQuerySortDirectionParameter()); } else { $direction = $defaultSortColumn->getColumnDefaultSortDirection(); } if ($this->request->query->has($list->getQuerySortColumnParameter())) { $value = $this->request->query->get($list->getQuerySortColumnParameter()); $column = $entity->getResultColumnSet(); $value = $column->getColumnByKey($value); if (is_object($value)) { $list->sanitizedSortBy($value->getColumnKey(), $direction); } } else { $list->sanitizedSortBy($defaultSortColumn->getColumnKey(), $direction); } if ($this->request->query->has('keywords') && $this->enableSearch) { $list->filterByKeywords($this->request->query->get('keywords')); } $tableSearchProperties = array(); $searchPropertiesSelected = (array) json_decode($this->searchProperties); foreach ($searchPropertiesSelected as $akID) { $ak = $category->getAttributeKeyByID($akID); if (is_object($ak)) { $tableSearchProperties[] = $ak; $type = $ak->getAttributeType(); $cnt = $type->getController(); $cnt->setRequestArray($_REQUEST); $cnt->setAttributeKey($ak); $cnt->searchForm($list); } } $result = new Result($set, $list); $pagination = $list->getPagination(); if ($pagination->getTotalPages() > 1) { $pagination = $pagination->renderDefaultView(); $this->set('pagination', $pagination); } $this->set('list', $list); $this->set('result', $result); $this->set('entity', $entity); $this->set('tableSearchProperties', $tableSearchProperties); $this->set('detailPage', $this->getDetailPageObject()); } }