aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/new.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/new.php')
-rw-r--r--mod/pages/new.php49
1 files changed, 21 insertions, 28 deletions
diff --git a/mod/pages/new.php b/mod/pages/new.php
index 2175572b2..8a51d9f03 100644
--- a/mod/pages/new.php
+++ b/mod/pages/new.php
@@ -1,43 +1,36 @@
<?php
/**
- * Create a new Page
+ * Create a new page
*
* @package ElggPages
*/
-require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
gatekeeper();
-global $CONFIG;
-// Get the current page's owner
-if ($container = (int) get_input('container_guid')) {
- set_page_owner($container);
-}
-$page_owner = elgg_get_page_owner();
-if ($page_owner === false || is_null($page_owner)) {
- $page_owner = get_loggedin_user();
- set_page_owner($page_owner->getGUID());
+$container_guid = get_input('guid');
+
+$container = get_entity($container_guid);
+if (!$container) {
+
}
-//if it is a sub page, provide a link back to parent
-if(get_input('parent_guid')){
- $parent = get_entity(get_input('parent_guid'));
+$page_owner = $container;
+if (elgg_instanceof($container, 'object')) {
+ $page_owner = $container->getContainerEntity();
+}
- // Breadcrumbs
- $area2 .= elgg_view('pages/breadcrumbs', array('page_owner' => $page_owner, 'parent' => $parent, 'add' => true));
- }
+elgg_set_page_owner_guid($page_owner->getGUID);
- global $CONFIG;
-add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+$title = elgg_echo('pages:add');
+elgg_push_breadcrumb($title);
-$title = elgg_echo("pages:new");
-$area2 .= elgg_view_title($title);
-$area2 .= elgg_view("forms/pages/edit");
+$content = elgg_view("forms/pages/edit");
-$params = array(
- 'content' => $area2,
- 'sidebar' => $area1
-);
-$body = elgg_view_layout('one_column_with_sidebar', $params);
+$body = elgg_view_layout('content', array(
+ 'filter' => '',
+ 'buttons' => '',
+ 'content' => $content,
+ 'title' => $title,
+));
-echo elgg_view_page($title, $body); \ No newline at end of file
+echo elgg_view_page($title, $body);