-
Notifications
You must be signed in to change notification settings - Fork 8
/
ding_loan.module
55 lines (50 loc) · 1.14 KB
/
ding_loan.module
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
<?php
/**
* @file
* User loan listing and renewal functionallity.
*/
/**
* Implements hook_ctools_plugin_directory().
*
* It simply tells panels where to find the .inc files that define various
* args, contexts, content_types. In this case the subdirectories of
* ctools_plugin_example/panels are used.
*/
function ding_loan_ctools_plugin_directory($module, $plugin) {
if ($module == 'ctools' && !empty($plugin)) {
return "plugins/$plugin";
}
}
/**
* Implements hook_ding_provider_user().
*/
function ding_loan_ding_provider_user() {
return array(
'loan' => array(
'required' => TRUE,
'install time setup' => TRUE,
),
);
}
/**
* Callback function for sorting loans.
*/
function ding_loan_sort_expiry($a, $b) {
if ($a->expiry == $b->expiry) {
return 0;
}
return ($a->expiry < $b->expiry) ? -1 : 1;
}
/**
* Implements hook_ding_session_cache_defaults().
*
* Set default ding_session_cache settings and tell ding_session_cache that this
* module supports it.
*/
function ding_loan_ding_session_cache_defaults() {
return array(
'titel' => 'Ding loans',
'enabled' => TRUE,
'expire' => 3600,
);
}