-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
58 lines (51 loc) · 1.46 KB
/
functions.php
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Get a list of the current search collection filters in use.
*
* @package Omeka\Function\Search
* @uses Omeka_View_Helper_SearchFilters::searchFilters()
* @params array $params Params to override the ones read from the request.
* @return string
*/
function collection_search_filters(array $params = null)
{
return get_view()->collectionSearchFilters($params);
}
function collection_theme()
{
if ($cp = get_advanced_settings_by_collection()) {
return (empty($cp['theme']) ? __('Default') : $cp['theme']);
}
}
function collection_per_page()
{
if ($cp = get_advanced_settings_by_collection()) {
return (empty($cp['per_page']) ? get_option('per_page_public') : $cp['per_page']);
}
}
function collection_google_analytics_id()
{
if ($cp = get_advanced_settings_by_collection()) {
return (empty($cp['tracking_id']) ? __('N/a') : $cp['tracking_id']);
}
}
function collection_items_sort_field()
{
if ($cp = get_advanced_settings_by_collection()) {
return (empty($cp['items_sort_field']) ? null : $cp['items_sort_field']);
}
}
function collection_items_sort_dir()
{
if ($cp = get_advanced_settings_by_collection()) {
return ($cp['items_sort_dir'] == 'a' ? __('Ascending') : __('Descending'));
}
}
function get_advanced_settings_by_collection($collection = null)
{
if (!$collection) {
$collection = get_current_record('collection');
}
return get_db()->getTable('CollectionsPlus')->find($collection->id);
}
?>