-
Notifications
You must be signed in to change notification settings - Fork 0
/
culturefeed_uitpas.blocks.inc
178 lines (133 loc) · 4.56 KB
/
culturefeed_uitpas.blocks.inc
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* @file
* Block implementations for Culturefeed uitpas.
*/
/**
* Implements hook_block_info().
*/
function culturefeed_uitpas_block_info() {
return array(
'uitpas_event_details_advantages' => array(
'info' => t('Culturefeed uitpas: event details advantages'),
'cache' => DRUPAL_NO_CACHE,
),
'uitpas_profile_summary' => array(
'info' => t('Culturefeed uitpas: profile (summary)'),
'cache' => DRUPAL_NO_CACHE,
),
'uitpas_promotions_highlight' => array(
'info' => t('Culturefeed uitpas: promotions highlight'),
'cache' => DRUPAL_NO_CACHE,
),
'uitpas_recent_actions' => array(
'info' => t('Culturefeed uitpas: recent actions'),
'cache' => DRUPAL_NO_CACHE,
),
'uitpas_user_register' => array(
'info' => t('Culturefeed uitpas: register for logged in users.'),
'cache' => DRUPAL_NO_CACHE,
),
'uitpas_register' => array(
'info' => t('Culturefeed uitpas: register for not authenticated users.'),
'cache' => DRUPAL_NO_CACHE,
),
);
}
/**
* Implements hook_block_configure().
*/
function culturefeed_uitpas_block_configure($delta = '') {
$form = array();
switch ($delta) {
case 'uitpas_profile_summary':
module_load_include('inc', 'culturefeed_uitpas', 'includes/profile_summary');
culturefeed_uitpas_profile_summary_settings_get($form);
break;
case 'uitpas_promotions_highlight':
module_load_include('inc', 'culturefeed_uitpas', 'includes/promotions_highlight');
culturefeed_uitpas_promotions_highlights_settings_get($form);
break;
case 'uitpas_recent_actions':
module_load_include('inc', 'culturefeed_uitpas', 'includes/recent_actions');
culturefeed_uitpas_recent_actions_settings_get($form);
break;
}
return $form;
}
/**
* Implements hook_block_save().
*/
function culturefeed_uitpas_block_save($delta = '', $edit = array()) {
switch ($delta) {
case 'uitpas_profile_summary':
module_load_include('inc', 'culturefeed_uitpas', 'includes/profile_summary');
culturefeed_uitpas_profile_summary_settings_save($edit);
break;
case 'uitpas_promotions_highlight':
module_load_include('inc', 'culturefeed_uitpas', 'includes/promotions_highlight');
culturefeed_uitpas_promotions_highlights_settings_save($edit);
break;
case 'uitpas_recent_actions':
module_load_include('inc', 'culturefeed_uitpas', 'includes/recent_actions');
culturefeed_uitpas_recent_actions_settings_save($edit);
break;
}
}
/**
* Implements hook_block_view().
*/
function culturefeed_uitpas_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'uitpas_event_details_advantages':
module_load_include('inc', 'culturefeed_uitpas', 'includes/event_details_advantages');
$content = culturefeed_uitpas_event_details_advantages_get();
if ($content) {
$block['subject'] = t("UiTPAS Advantages");
$block['content'] = $content;
}
break;
case 'uitpas_profile_summary':
module_load_include('inc', 'culturefeed_uitpas', 'includes/profile_summary');
$content = culturefeed_uitpas_profile_summary_get();
if ($content) {
$block['subject'] = t("My UiTPAS");
$block['content'] = $content;
}
break;
case 'uitpas_promotions_highlight':
module_load_include('inc', 'culturefeed_uitpas', 'includes/promotions_highlight');
$content = culturefeed_uitpas_promotions_highlight_get();
if ($content) {
$block['subject'] = t("Spotlight promotions");
$block['content'] = $content;
}
break;
case 'uitpas_recent_actions':
module_load_include('inc', 'culturefeed_uitpas', 'includes/recent_actions');
$content = culturefeed_uitpas_recent_actions_get();
if ($content) {
$block['subject'] = t('Recent actions');
$block['content'] = $content;
}
break;
case 'uitpas_user_register':
module_load_include('inc', 'culturefeed_uitpas', 'includes/user_register');
$content = culturefeed_uitpas_user_register_cta_get();
if ($content) {
$block['subject'] = t('Already own an UiTPAS?');
$block['content'] = $content;
}
break;
case 'uitpas_register':
module_load_include('inc', 'culturefeed_uitpas', 'includes/user_register');
$content = culturefeed_uitpas_user_register_get(true);
if ($content) {
$block['subject'] = t('Already own an UiTPAS ?');
$block['content'] = $content;
}
break;
}
return $block;
}