| @@ 15-19 (lines=5) @@ | ||
| 12 | public function view() { |
|
| 13 | $sectionIDs = array_map(array('General', 'intval'), explode(',', General::sanitize($this->_context[0]))); |
|
| 14 | ||
| 15 | if (empty($sectionIDs)) { |
|
| 16 | $this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST; |
|
| 17 | $this->_Result['error'] = __('No section id found'); |
|
| 18 | return; |
|
| 19 | } |
|
| 20 | ||
| 21 | $options = (new SectionsInfos)->fetch($sectionIDs); |
|
| 22 | ||
| @@ 23-26 (lines=4) @@ | ||
| 20 | ||
| 21 | $options = (new SectionsInfos)->fetch($sectionIDs); |
|
| 22 | ||
| 23 | if (empty($options)) { |
|
| 24 | $this->_Result['status'] = Page::HTTP_STATUS_NOT_FOUND; |
|
| 25 | $this->_Result['error'] = __('No section found'); |
|
| 26 | } |
|
| 27 | ||
| 28 | $this->_Result['sections'] = $options; |
|
| 29 | } |
|
| @@ 37-41 (lines=5) @@ | ||
| 34 | ->execute() |
|
| 35 | ->next(); |
|
| 36 | ||
| 37 | if (empty($section)) { |
|
| 38 | $this->_Result['status'] = Page::HTTP_STATUS_NOT_FOUND; |
|
| 39 | $this->_Result['error'] = __('Section not found'); |
|
| 40 | return; |
|
| 41 | } |
|
| 42 | ||
| 43 | $query = General::sanitize($_GET['query']); |
|
| 44 | $entries = array(); |
|
| @@ 46-50 (lines=5) @@ | ||
| 43 | $query = General::sanitize($_GET['query']); |
|
| 44 | $entries = array(); |
|
| 45 | $filterableFields = $section->fetchFilterableFields(); |
|
| 46 | if (empty($filterableFields)) { |
|
| 47 | $this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST; |
|
| 48 | $this->_Result['error'] = __('Section not filterable'); |
|
| 49 | return; |
|
| 50 | } |
|
| 51 | ||
| 52 | $primaryField = $section->fetchVisibleColumns(); |
|
| 53 | if (empty($primaryField)) { |
|