danielebarchiesi@0
|
1 <?php
|
danielebarchiesi@0
|
2
|
danielebarchiesi@0
|
3 /**
|
danielebarchiesi@0
|
4 * @file
|
danielebarchiesi@0
|
5 * Contains theme registry and theme implementations for the context tool.
|
danielebarchiesi@0
|
6 */
|
danielebarchiesi@0
|
7
|
danielebarchiesi@0
|
8 /**
|
danielebarchiesi@0
|
9 * Implements hook_theme()
|
danielebarchiesi@0
|
10 */
|
danielebarchiesi@0
|
11 function ctools_context_theme(&$theme) {
|
danielebarchiesi@0
|
12 $theme['ctools_context_list'] = array(
|
danielebarchiesi@0
|
13 'variables' => array('object' => NULL),
|
danielebarchiesi@0
|
14 'file' => 'includes/context.theme.inc',
|
danielebarchiesi@0
|
15 );
|
danielebarchiesi@0
|
16 $theme['ctools_context_list_no_table'] = array(
|
danielebarchiesi@0
|
17 'variables' => array('object' => NULL),
|
danielebarchiesi@0
|
18 'file' => 'includes/context.theme.inc',
|
danielebarchiesi@0
|
19 );
|
danielebarchiesi@0
|
20 $theme['ctools_context_item_form'] = array(
|
danielebarchiesi@0
|
21 'render element' => 'form',
|
danielebarchiesi@0
|
22 // 'variables' => array('form' => NULL),
|
danielebarchiesi@0
|
23 'file' => 'includes/context.theme.inc',
|
danielebarchiesi@0
|
24 );
|
danielebarchiesi@0
|
25 $theme['ctools_context_item_row'] = array(
|
danielebarchiesi@0
|
26 'variables' => array('type' => NULL, 'form' => NULL, 'position' => NULL, 'count' => NULL, 'with_tr' => TRUE),
|
danielebarchiesi@0
|
27 'file' => 'includes/context.theme.inc',
|
danielebarchiesi@0
|
28 );
|
danielebarchiesi@0
|
29
|
danielebarchiesi@0
|
30 // For the access plugin
|
danielebarchiesi@0
|
31 $theme['ctools_access_admin_add'] = array(
|
danielebarchiesi@0
|
32 'render element' => 'form',
|
danielebarchiesi@0
|
33 'file' => 'includes/context-access-admin.inc',
|
danielebarchiesi@0
|
34 );
|
danielebarchiesi@0
|
35 }
|
danielebarchiesi@0
|
36
|
danielebarchiesi@0
|
37 /**
|
danielebarchiesi@0
|
38 * Theme the form item for the context entry.
|
danielebarchiesi@0
|
39 */
|
danielebarchiesi@0
|
40 function theme_ctools_context_item_row($vars) {
|
danielebarchiesi@0
|
41 $type = $vars['type'];
|
danielebarchiesi@0
|
42 $form = $vars['form'];
|
danielebarchiesi@0
|
43 $position = $vars['position'];
|
danielebarchiesi@0
|
44 $count = $vars['count'];
|
danielebarchiesi@0
|
45 $with_tr = $vars['with_tr'];
|
danielebarchiesi@0
|
46 $output = '<td class="title"> ' . render($form['title']) . '</td>';
|
danielebarchiesi@0
|
47 if (!empty($form['position'])) {
|
danielebarchiesi@0
|
48 $output .= '<td class="position"> ' . render($form['position']) . '</td>';
|
danielebarchiesi@0
|
49 }
|
danielebarchiesi@0
|
50 $output .= '<td class="operation">' . render($form['settings']);
|
danielebarchiesi@0
|
51 $output .= render($form['remove']) . '</td>';
|
danielebarchiesi@0
|
52
|
danielebarchiesi@0
|
53 if ($with_tr) {
|
danielebarchiesi@0
|
54 $output = '<tr id="' . $type . '-row-' . $position . '" class="draggable ' . $type . '-row ' . ($count % 2 ? 'even' : 'odd') . '">' . $output . '</tr>';
|
danielebarchiesi@0
|
55 }
|
danielebarchiesi@0
|
56 return $output;
|
danielebarchiesi@0
|
57 }
|
danielebarchiesi@0
|
58
|
danielebarchiesi@0
|
59 /**
|
danielebarchiesi@0
|
60 * Display the context item.
|
danielebarchiesi@0
|
61 */
|
danielebarchiesi@0
|
62 function theme_ctools_context_item_form($vars) {
|
danielebarchiesi@0
|
63 $form = $vars['form'];
|
danielebarchiesi@0
|
64
|
danielebarchiesi@0
|
65 $output = '';
|
danielebarchiesi@0
|
66 $type = $form['#ctools_context_type'];
|
danielebarchiesi@0
|
67 $module = $form['#ctools_context_module'];
|
danielebarchiesi@0
|
68 $cache_key = $form['#cache_key'];
|
danielebarchiesi@0
|
69
|
danielebarchiesi@0
|
70 $type_info = ctools_context_info($type);
|
danielebarchiesi@0
|
71
|
danielebarchiesi@0
|
72 if (!empty($form[$type]) && empty($form['#only_buttons'])) {
|
danielebarchiesi@0
|
73 $count = 0;
|
danielebarchiesi@0
|
74 $rows = '';
|
danielebarchiesi@0
|
75 foreach (array_keys($form[$type]) as $id) {
|
danielebarchiesi@0
|
76 if (!is_numeric($id)) {
|
danielebarchiesi@0
|
77 continue;
|
danielebarchiesi@0
|
78 }
|
danielebarchiesi@0
|
79 $theme_vars = array();
|
danielebarchiesi@0
|
80 $theme_vars['type'] = $type;
|
danielebarchiesi@0
|
81 $theme_vars['form'] = $form[$type][$id];
|
danielebarchiesi@0
|
82 $theme_vars['position'] = $id;
|
danielebarchiesi@0
|
83 $theme_vars['count'] = $count++;
|
danielebarchiesi@0
|
84 $rows .= theme('ctools_context_item_row', $theme_vars);
|
danielebarchiesi@0
|
85 }
|
danielebarchiesi@0
|
86
|
danielebarchiesi@0
|
87 $output .= '<table id="' . $type . '-table">';
|
danielebarchiesi@0
|
88 $output .= '<thead>';
|
danielebarchiesi@0
|
89 $output .= '<tr>';
|
danielebarchiesi@0
|
90 $output .= '<th class="title">' . $type_info['title'] . '</th>';
|
danielebarchiesi@0
|
91 if (!empty($type_info['sortable']) && $count) {
|
danielebarchiesi@0
|
92 $output .= '<th class="position">' . t('Weight') . '</th>';
|
danielebarchiesi@0
|
93 }
|
danielebarchiesi@0
|
94 $output .= '<th class="operation">' . t('Operation') . '</th>';
|
danielebarchiesi@0
|
95 $output .= '</tr>';
|
danielebarchiesi@0
|
96 $output .= '</thead>';
|
danielebarchiesi@0
|
97 $output .= '<tbody>';
|
danielebarchiesi@0
|
98
|
danielebarchiesi@0
|
99 $output .= $rows;
|
danielebarchiesi@0
|
100
|
danielebarchiesi@0
|
101 $output .= '</tbody>';
|
danielebarchiesi@0
|
102 $output .= '</table>';
|
danielebarchiesi@0
|
103 }
|
danielebarchiesi@0
|
104
|
danielebarchiesi@0
|
105 if (!empty($form['buttons'])) {
|
danielebarchiesi@0
|
106 // Display the add context item.
|
danielebarchiesi@0
|
107 $row = array();
|
danielebarchiesi@0
|
108 $row[] = array('data' => render($form['buttons'][$type]['item']), 'class' => array('title'));
|
danielebarchiesi@0
|
109 $row[] = array('data' => render($form['buttons'][$type]['add']), 'class' => array('add'), 'width' => "60%");
|
danielebarchiesi@0
|
110 $output .= '<div class="buttons">';
|
danielebarchiesi@0
|
111 $output .= render($form['buttons'][$type]);
|
danielebarchiesi@0
|
112 $theme_vars = array();
|
danielebarchiesi@0
|
113 $theme_vars['header'] = array();
|
danielebarchiesi@0
|
114 $theme_vars['rows'] = array($row);
|
danielebarchiesi@0
|
115 $theme_vars['attributes'] = array('id' => $type . '-add-table');
|
danielebarchiesi@0
|
116 $output .= theme('table', $theme_vars);
|
danielebarchiesi@0
|
117 $output .= '</div>';
|
danielebarchiesi@0
|
118 }
|
danielebarchiesi@0
|
119 if (!empty($form['description'])) {
|
danielebarchiesi@0
|
120 $output .= render($form['description']);
|
danielebarchiesi@0
|
121 }
|
danielebarchiesi@0
|
122
|
danielebarchiesi@0
|
123 if (!empty($type_info['sortable'])) {
|
danielebarchiesi@0
|
124 drupal_add_tabledrag($type . '-table', 'order', 'sibling', 'drag-position');
|
danielebarchiesi@0
|
125 }
|
danielebarchiesi@0
|
126
|
danielebarchiesi@0
|
127 return $output;
|
danielebarchiesi@0
|
128 }
|
danielebarchiesi@0
|
129
|
danielebarchiesi@0
|
130 /**
|
danielebarchiesi@0
|
131 * Create a visible list of all the contexts available on an object.
|
danielebarchiesi@0
|
132 * Assumes arguments, relationships and context objects.
|
danielebarchiesi@0
|
133 *
|
danielebarchiesi@0
|
134 * Contexts must be preloaded.
|
danielebarchiesi@0
|
135 */
|
danielebarchiesi@0
|
136 function theme_ctools_context_list($vars) {
|
danielebarchiesi@0
|
137 $object = $vars['object'];
|
danielebarchiesi@0
|
138 $header = $vars['header'];
|
danielebarchiesi@0
|
139 $description = (!empty($vars['description'])) ? $vars['description'] : NULL;
|
danielebarchiesi@0
|
140 $titles = array();
|
danielebarchiesi@0
|
141 $output = '';
|
danielebarchiesi@0
|
142 $count = 1;
|
danielebarchiesi@0
|
143
|
danielebarchiesi@0
|
144 $contexts = ctools_context_load_contexts($object);
|
danielebarchiesi@0
|
145
|
danielebarchiesi@0
|
146 // Describe 'built in' contexts.
|
danielebarchiesi@0
|
147 if (!empty($object->base_contexts)) {
|
danielebarchiesi@0
|
148 foreach ($object->base_contexts as $id => $context) {
|
danielebarchiesi@0
|
149 $output .= '<tr>';
|
danielebarchiesi@0
|
150 $output .= '<td valign="top"><em>' . t('Built in context') . '</em></td>';
|
danielebarchiesi@0
|
151 $desc = check_plain($context->identifier);
|
danielebarchiesi@0
|
152 if (isset($context->keyword)) {
|
danielebarchiesi@0
|
153 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $context->keyword));
|
danielebarchiesi@0
|
154 foreach (ctools_context_get_converters('%' . $context->keyword . ':', $context) as $keyword => $title) {
|
danielebarchiesi@0
|
155 $desc .= '<br />' . t('@keyword --> @title', array('@keyword' => $keyword, '@title' => $title));
|
danielebarchiesi@0
|
156 }
|
danielebarchiesi@0
|
157 $desc .= '</div>';
|
danielebarchiesi@0
|
158
|
danielebarchiesi@0
|
159 }
|
danielebarchiesi@0
|
160 if (isset($context->description)) {
|
danielebarchiesi@0
|
161 $desc .= '<div class="description">' . filter_xss_admin($context->description) . '</div>';
|
danielebarchiesi@0
|
162 }
|
danielebarchiesi@0
|
163 $output .= '<td>' . $desc . '</td>';
|
danielebarchiesi@0
|
164 $output .= '</tr>';
|
danielebarchiesi@0
|
165 $titles[$id] = $context->identifier;
|
danielebarchiesi@0
|
166 }
|
danielebarchiesi@0
|
167 }
|
danielebarchiesi@0
|
168
|
danielebarchiesi@0
|
169 // First, make a list of arguments. Arguments are pretty simple.
|
danielebarchiesi@0
|
170 if (!empty($object->arguments)) {
|
danielebarchiesi@0
|
171 foreach ($object->arguments as $argument) {
|
danielebarchiesi@0
|
172 $output .= '<tr>';
|
danielebarchiesi@0
|
173 $output .= '<td valign="top"><em>' . t('Argument @count', array('@count' => $count)) . '</em></td>';
|
danielebarchiesi@0
|
174 $desc = check_plain($argument['identifier']);
|
danielebarchiesi@0
|
175 if (isset($argument['keyword'])) {
|
danielebarchiesi@0
|
176 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $argument['keyword']));
|
danielebarchiesi@0
|
177 if (isset($contexts[ctools_context_id($argument, 'argument')])) {
|
danielebarchiesi@0
|
178 foreach (ctools_context_get_converters('%' . $argument['keyword'] . ':', $contexts[ctools_context_id($argument, 'argument')]) as $keyword => $title) {
|
danielebarchiesi@0
|
179 $desc .= '<br />' . t('@keyword --> @title', array('@keyword' => $keyword, '@title' => $title));
|
danielebarchiesi@0
|
180 }
|
danielebarchiesi@0
|
181 }
|
danielebarchiesi@0
|
182 $desc .= '</div>';
|
danielebarchiesi@0
|
183 }
|
danielebarchiesi@0
|
184 $output .= '<td>' . $desc . '</td>';
|
danielebarchiesi@0
|
185 $output .= '</tr>';
|
danielebarchiesi@0
|
186 $titles[ctools_context_id($argument, 'argument')] = $argument['identifier'];
|
danielebarchiesi@0
|
187 $count++;
|
danielebarchiesi@0
|
188 }
|
danielebarchiesi@0
|
189 }
|
danielebarchiesi@0
|
190
|
danielebarchiesi@0
|
191 $count = 1;
|
danielebarchiesi@0
|
192 // Then, make a nice list of contexts.
|
danielebarchiesi@0
|
193 if (!empty($object->contexts)) {
|
danielebarchiesi@0
|
194 foreach ($object->contexts as $context) {
|
danielebarchiesi@0
|
195 $output .= '<tr>';
|
danielebarchiesi@0
|
196 $output .= '<td valign="top"><em>' . t('Context @count', array('@count' => $count)) . '</em></td>';
|
danielebarchiesi@0
|
197 $desc = check_plain($context['identifier']);
|
danielebarchiesi@0
|
198 if (isset($context['keyword'])) {
|
danielebarchiesi@0
|
199 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $context['keyword']));
|
danielebarchiesi@0
|
200 foreach (ctools_context_get_converters('%' . $context['keyword'] . ':', $contexts[ctools_context_id($context, 'context')]) as $keyword => $title) {
|
danielebarchiesi@0
|
201 $desc .= '<br />' . t('@keyword --> @title', array('@keyword' => $keyword, '@title' => $title));
|
danielebarchiesi@0
|
202 }
|
danielebarchiesi@0
|
203 $desc .= '</div>';
|
danielebarchiesi@0
|
204 }
|
danielebarchiesi@0
|
205 $output .= '<td>' . $desc . '</td>';
|
danielebarchiesi@0
|
206 $output .= '</tr>';
|
danielebarchiesi@0
|
207 $titles[ctools_context_id($context)] = $context['identifier'];
|
danielebarchiesi@0
|
208 $count++;
|
danielebarchiesi@0
|
209 }
|
danielebarchiesi@0
|
210 }
|
danielebarchiesi@0
|
211
|
danielebarchiesi@0
|
212 // And relationships
|
danielebarchiesi@0
|
213 if (!empty($object->relationships)) {
|
danielebarchiesi@0
|
214 foreach ($object->relationships as $relationship) {
|
danielebarchiesi@0
|
215 $output .= '<tr>';
|
danielebarchiesi@0
|
216 if (is_array($relationship['context'])) {
|
danielebarchiesi@0
|
217 $rtitles = array();
|
danielebarchiesi@0
|
218 foreach ($relationship['context'] as $cid) {
|
danielebarchiesi@0
|
219 $rtitles[$cid] = $titles[$cid];
|
danielebarchiesi@0
|
220 }
|
danielebarchiesi@0
|
221 $title = implode(' + ', $rtitles);
|
danielebarchiesi@0
|
222 }
|
danielebarchiesi@0
|
223 else {
|
danielebarchiesi@0
|
224 $title = $titles[$relationship['context']];
|
danielebarchiesi@0
|
225 }
|
danielebarchiesi@0
|
226 $output .= '<td valign="top"><em>' . t('From "@title"', array('@title' => $title)) . '</em></td>';
|
danielebarchiesi@0
|
227 $desc = check_plain($relationship['identifier']);
|
danielebarchiesi@0
|
228 if (isset($relationship['keyword'])) {
|
danielebarchiesi@0
|
229 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $relationship['keyword']));
|
danielebarchiesi@0
|
230 foreach (ctools_context_get_converters('%' . $relationship['keyword'] . ':', $contexts[ctools_context_id($relationship, 'relationship')]) as $keyword => $title) {
|
danielebarchiesi@0
|
231 $desc .= '<br />' . t('@keyword --> @title', array('@keyword' => $keyword, '@title' => $title));
|
danielebarchiesi@0
|
232 }
|
danielebarchiesi@0
|
233 $desc .= '</div>';
|
danielebarchiesi@0
|
234 }
|
danielebarchiesi@0
|
235 $output .= '<td>' . $desc . '</td>';
|
danielebarchiesi@0
|
236 $output .= '</tr>';
|
danielebarchiesi@0
|
237 $titles[ctools_context_id($relationship, 'relationship')] = $relationship['identifier'];
|
danielebarchiesi@0
|
238 $count++;
|
danielebarchiesi@0
|
239 }
|
danielebarchiesi@0
|
240 }
|
danielebarchiesi@0
|
241
|
danielebarchiesi@0
|
242 $head = '';
|
danielebarchiesi@0
|
243 if ($header) {
|
danielebarchiesi@0
|
244 if ($description) {
|
danielebarchiesi@0
|
245 $header .= '<div class="description">' . $description . '</div>';
|
danielebarchiesi@0
|
246 }
|
danielebarchiesi@0
|
247 $head .= '<thead><tr>';
|
danielebarchiesi@0
|
248 $head .= '<th colspan="2">' . $header . '</th>';
|
danielebarchiesi@0
|
249 $head .= '</tr></thead>';
|
danielebarchiesi@0
|
250 }
|
danielebarchiesi@0
|
251
|
danielebarchiesi@0
|
252 return $output ? "<table>$head<tbody>$output</tbody></table>\n" : "<table>$head</table>\n";
|
danielebarchiesi@0
|
253 }
|
danielebarchiesi@0
|
254
|
danielebarchiesi@0
|
255 /**
|
danielebarchiesi@0
|
256 * ctools_context_list() but not in a table format because tabledrag
|
danielebarchiesi@0
|
257 * won't let us have tables within tables and still drag.
|
danielebarchiesi@0
|
258 */
|
danielebarchiesi@0
|
259 function theme_ctools_context_list_no_table($vars) {
|
danielebarchiesi@0
|
260 $object = $vars['object'];
|
danielebarchiesi@0
|
261 ctools_add_css('context');
|
danielebarchiesi@0
|
262 $titles = array();
|
danielebarchiesi@0
|
263 $output = '';
|
danielebarchiesi@0
|
264 $count = 1;
|
danielebarchiesi@0
|
265 // Describe 'built in' contexts.
|
danielebarchiesi@0
|
266 if (!empty($object->base_contexts)) {
|
danielebarchiesi@0
|
267 foreach ($object->base_contexts as $id => $context) {
|
danielebarchiesi@0
|
268 $output .= '<div class="ctools-context-holder clearfix">';
|
danielebarchiesi@0
|
269 $output .= '<div class="ctools-context-title">' . t('Built in context') . '</div>';
|
danielebarchiesi@0
|
270 $desc = check_plain($context->identifier);
|
danielebarchiesi@0
|
271 if (isset($context->keyword)) {
|
danielebarchiesi@0
|
272 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $context->keyword)) . '</div>';
|
danielebarchiesi@0
|
273 }
|
danielebarchiesi@0
|
274 if (isset($context->description)) {
|
danielebarchiesi@0
|
275 $desc .= '<div class="description">' . filter_xss_admin($context->description) . '</div>';
|
danielebarchiesi@0
|
276 }
|
danielebarchiesi@0
|
277 $output .= '<div class="ctools-context-content">' . $desc . '</div>';
|
danielebarchiesi@0
|
278 $output .= '</div>';
|
danielebarchiesi@0
|
279 $titles[$id] = $context->identifier;
|
danielebarchiesi@0
|
280 $count++;
|
danielebarchiesi@0
|
281 }
|
danielebarchiesi@0
|
282 }
|
danielebarchiesi@0
|
283
|
danielebarchiesi@0
|
284 // First, make a list of arguments. Arguments are pretty simple.
|
danielebarchiesi@0
|
285 if (!empty($object->arguments)) {
|
danielebarchiesi@0
|
286 foreach ($object->arguments as $argument) {
|
danielebarchiesi@0
|
287 $output .= '<div class="ctools-context-holder clearfix">';
|
danielebarchiesi@0
|
288 $output .= '<div class="ctools-context-title">' . t('Argument @count', array('@count' => $count)) . '</div>';
|
danielebarchiesi@0
|
289 $desc = check_plain($argument['identifier']);
|
danielebarchiesi@0
|
290 if (isset($argument['keyword'])) {
|
danielebarchiesi@0
|
291 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $argument['keyword'])) . '</div>';
|
danielebarchiesi@0
|
292 }
|
danielebarchiesi@0
|
293 $output .= '<div class="ctools-context-content">' . $desc . '</div>';
|
danielebarchiesi@0
|
294 $output .= '</div>';
|
danielebarchiesi@0
|
295 $titles[ctools_context_id($argument, 'argument')] = $argument['identifier'];
|
danielebarchiesi@0
|
296 $count++;
|
danielebarchiesi@0
|
297 }
|
danielebarchiesi@0
|
298 }
|
danielebarchiesi@0
|
299 $count = 1;
|
danielebarchiesi@0
|
300 // Then, make a nice list of contexts.
|
danielebarchiesi@0
|
301 if (!empty($object->contexts)) {
|
danielebarchiesi@0
|
302 foreach ($object->contexts as $context) {
|
danielebarchiesi@0
|
303 $output .= '<div class="ctools-context-holder clearfix">';
|
danielebarchiesi@0
|
304 $output .= '<div class="ctools-context-title">' . t('Context @count', array('@count' => $count)) . '</div>';
|
danielebarchiesi@0
|
305 $desc = check_plain($context['identifier']);
|
danielebarchiesi@0
|
306 if (isset($context['keyword'])) {
|
danielebarchiesi@0
|
307 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $context['keyword'])) . '</div>';
|
danielebarchiesi@0
|
308 }
|
danielebarchiesi@0
|
309 $output .= '<div class="ctools-context-content">' . $desc . '</div>';
|
danielebarchiesi@0
|
310 $output .= '</div>';
|
danielebarchiesi@0
|
311 $titles[ctools_context_id($context)] = $context['identifier'];
|
danielebarchiesi@0
|
312 $count++;
|
danielebarchiesi@0
|
313 }
|
danielebarchiesi@0
|
314 }
|
danielebarchiesi@0
|
315 // And relationships
|
danielebarchiesi@0
|
316 if (!empty($object->relationships)) {
|
danielebarchiesi@0
|
317 foreach ($object->relationships as $relationship) {
|
danielebarchiesi@0
|
318 $output .= '<div class="ctools-context-holder clearfix">';
|
danielebarchiesi@0
|
319 if (is_array($relationship['context'])) {
|
danielebarchiesi@0
|
320 $rtitles = array();
|
danielebarchiesi@0
|
321 foreach ($relationship['context'] as $cid) {
|
danielebarchiesi@0
|
322 $rtitles[$cid] = $titles[$cid];
|
danielebarchiesi@0
|
323 }
|
danielebarchiesi@0
|
324 $title = implode(' + ', $rtitles);
|
danielebarchiesi@0
|
325 }
|
danielebarchiesi@0
|
326 else {
|
danielebarchiesi@0
|
327 $title = $titles[$relationship['context']];
|
danielebarchiesi@0
|
328 }
|
danielebarchiesi@0
|
329
|
danielebarchiesi@0
|
330 $output .= '<div class="ctools-context-title">' . t('From "@title"', array('@title' => $title)) . '</div>';
|
danielebarchiesi@0
|
331 $desc = check_plain($relationship['identifier']);
|
danielebarchiesi@0
|
332 if (isset($relationship['keyword'])) {
|
danielebarchiesi@0
|
333 $desc .= '<div class="description">' . t('Keyword: %@keyword', array('@keyword' => $relationship['keyword'])) . '</div>';
|
danielebarchiesi@0
|
334 }
|
danielebarchiesi@0
|
335 $output .= '<div class="ctools-context-content">' . $desc . '</div>';
|
danielebarchiesi@0
|
336 $output .= '</div>';
|
danielebarchiesi@0
|
337 $titles[ctools_context_id($relationship, 'relationship')] = $relationship['identifier'];
|
danielebarchiesi@0
|
338 $count++;
|
danielebarchiesi@0
|
339 }
|
danielebarchiesi@0
|
340 }
|
danielebarchiesi@0
|
341
|
danielebarchiesi@0
|
342 return $output;
|
danielebarchiesi@0
|
343 }
|
danielebarchiesi@0
|
344
|