-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfieldContents.php
More file actions
35 lines (25 loc) · 1.03 KB
/
fieldContents.php
File metadata and controls
35 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* @author James Baster <james@jarofgreen.co.uk>
* @copyright City of Edinburgh Council & James Baster
* @license Open Source under the 3-clause BSD License
* @url https://github.com/City-Outdoors/City-Outdoors-Web
*/
require 'includes/src/global.php';
$currentUser = getCurrentUser();
$collection = Collection::loadByFieldContentsSlug($_GET['s']);
if (!$collection) die('Not found!');
$fieldToDisplay = $collection->getFieldByFieldContentsSlug($_GET['s']);
if (!$fieldToDisplay) die('Not found!');
$page = isset($_GET['page']) ? max(intval($_GET['page']),1) : 1;
$itemSearch = new ItemSearch();
$itemSearch->setPaging($page, 10);
$itemSearch->inCollection($collection);
$itemSearch->fieldHasValue($fieldToDisplay);
$tpl = getSmarty($currentUser);
$tpl->assign('collection', $collection);
$tpl->assign('fieldToDisplay', $fieldToDisplay);
$tpl->assign('itemSearch', $itemSearch);
$tpl->assign('inCollectionTab',true);
$tpl->assign('inFieldContentsSlug', $fieldToDisplay->getFieldContentsSlug());
$tpl->display('fieldContents.htm');