0
|
1 <?php
|
|
2
|
|
3
|
|
4
|
|
5 /**
|
|
6 * Process variables for digitalobject-item.tpl.php.
|
|
7 *
|
|
8 * The $variables array contains the following arguments:
|
|
9 * - $results: Search results array.
|
|
10 * - $module: Module the search results came from (module implementing
|
|
11 * hook_search_info()).
|
|
12 *
|
|
13 * @see search-results.tpl.php
|
|
14 */
|
|
15 function template_preprocess_digitalobjects_item(&$variables) {
|
|
16
|
|
17 $variables['objdata'] = digitalobjects_readMetadata($variables['objid']);
|
|
18
|
|
19 $accessType=isset($variables['objdata']['md']['accessType']) ?$variables['objdata']['md']['accessType']: 'mpiwg';
|
|
20 if (!user_access("view restricted content") && $accessType!="free"){
|
|
21 $variables['access']=false;
|
|
22 } else {
|
|
23 $variables['access']=true;
|
|
24 }
|
|
25
|
|
26
|
|
27 }
|
|
28
|
|
29 function template_preprocess_digitalobjects_item_short(&$variables) {
|
|
30
|
|
31 $variables['objdata'] = digitalobjects_readMetadata($variables['objid'],$format="short");
|
|
32
|
|
33
|
|
34 $accessType=isset($variables['objdata']['md']['accessType']) ?$variables['objdata']['md']['accessType']: 'mpiwg';
|
|
35 if (!user_access("view restricted content") && $accessType!="free"){
|
|
36 $variables['access']=false;
|
|
37 } else {
|
|
38 $variables['access']=true;
|
|
39 }
|
|
40
|
|
41
|
|
42 } |