aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/pages/pages/new.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/pages/pages/new.php')
-rw-r--r--mod/pages/pages/pages/new.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/mod/pages/pages/pages/new.php b/mod/pages/pages/pages/new.php
new file mode 100644
index 000000000..7cab2facb
--- /dev/null
+++ b/mod/pages/pages/pages/new.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Create a new page
+ *
+ * @package ElggPages
+ */
+
+gatekeeper();
+
+$container_guid = (int) get_input('guid');
+$container = get_entity($container_guid);
+if (!$container) {
+
+}
+
+$parent_guid = 0;
+$page_owner = $container;
+if (elgg_instanceof($container, 'object')) {
+ $parent_guid = $container->getGUID();
+ $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_guid);
+$content = elgg_view_form('pages/edit', array(), $vars);
+
+$body = elgg_view_layout('content', array(
+ 'filter' => '',
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);