aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/new.php
blob: 31b0c79513bee32d65795a12b670535cca0067a7 (plain)
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
<?php
/**
 * Create a new page
 *
 * @package ElggPages
 */

gatekeeper();

$container_guid = (int) get_input('guid');
$container = get_entity($container_guid);
if (!$container) {

}

$parent_page = null;
$page_owner = $container;
if (elgg_instanceof($container, 'object')) {
	$parent_page = $container;
	$page_owner = $container->getContainerEntity();
}

elgg_set_page_owner_guid($page_owner->getGUID());

$title = elgg_echo('pages:add');
elgg_push_breadcrumb($title);

$vars = pages_prepare_form_vars(null, $parent_page->getGUID());
$content = elgg_view_form('pages/edit', array(), $vars);

$body = elgg_view_layout('content', array(
	'filter' => '',
	'buttons' => '',
	'content' => $content,
	'title' => $title,
));

echo elgg_view_page($title, $body);