-
Notifications
You must be signed in to change notification settings - Fork 0
/
flexiform.pages.inc
44 lines (38 loc) · 1021 Bytes
/
flexiform.pages.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
<?php
/**
* @file
* Page and page title callbacks for flexiform.
*/
/**
* Page callback for flexiform submission pages.
*/
function flexiform_page_wrapper($flexiform, $display, $base_entity_id = NULL) {
if (!is_object($flexiform)) {
$flexiform = flexiform_load($flexiform);
}
if (!$flexiform) {
return drupal_not_found();
}
$context = array(
'base_entity_id' => $base_entity_id,
'args' => array_slice(func_get_args(), 3),
);
return $flexiform->getDisplay($display)->build($context);
}
/**
* Page callback for flexiform pages that might be modals.
*/
function flexiform_modal_page_wrapper($flexiform, $display, $js = FALSE, $base_entity_id = NULL) {
if (!is_object($flexiform)) {
$flexiform = flexiform_load($flexiform);
}
if (!$flexiform) {
return drupal_not_found();
}
$context = array(
'base_entity_id' => $base_entity_id,
'js' => $js,
'args' => array_slice(func_get_args(), 4),
);
return $flexiform->getDisplay($display)->build($context);
}