diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-30 21:48:24 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-30 21:48:24 +0000 |
commit | c27eac2d2a970e76a1204757bbe15da8efb2870c (patch) | |
tree | 7f524d3ee95391163293d9f77a945e2915c3e8ac /mod/pages | |
parent | f49fdf4e1c80fe5bde922c25bdd6ca0e2c912ddb (diff) | |
download | elgg-c27eac2d2a970e76a1204757bbe15da8efb2870c.tar.gz elgg-c27eac2d2a970e76a1204757bbe15da8efb2870c.tar.bz2 |
Refs #1439: Using new page_owner functions in all of core
git-svn-id: http://code.elgg.org/elgg/trunk@7140 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages')
-rw-r--r-- | mod/pages/edit.php | 2 | ||||
-rw-r--r-- | mod/pages/history.php | 2 | ||||
-rw-r--r-- | mod/pages/index.php | 8 | ||||
-rw-r--r-- | mod/pages/new.php | 4 | ||||
-rw-r--r-- | mod/pages/start.php | 6 | ||||
-rw-r--r-- | mod/pages/view.php | 6 | ||||
-rw-r--r-- | mod/pages/views/default/forms/pages/edit.php | 4 | ||||
-rw-r--r-- | mod/pages/views/default/pages/groupprofile_pages.php | 2 | ||||
-rw-r--r-- | mod/pages/views/default/widgets/pages/view.php | 4 | ||||
-rw-r--r-- | mod/pages/welcome.php | 4 | ||||
-rw-r--r-- | mod/pages/world.php | 6 |
11 files changed, 24 insertions, 24 deletions
diff --git a/mod/pages/edit.php b/mod/pages/edit.php index cc9955bc9..30207a7b9 100644 --- a/mod/pages/edit.php +++ b/mod/pages/edit.php @@ -15,7 +15,7 @@ if ($container = $pages->container_guid) { set_page_owner($container); } -$page_owner = page_owner_entity(); +$page_owner = elgg_get_page_owner(); if ($page_owner === false || is_null($page_owner)) { $page_owner = get_loggedin_user(); diff --git a/mod/pages/history.php b/mod/pages/history.php index 06e877c42..dfbe3ab59 100644 --- a/mod/pages/history.php +++ b/mod/pages/history.php @@ -25,7 +25,7 @@ $offset = (int)get_input('offset'); $page_guid = get_input('page_guid'); $pages = get_entity($page_guid); -add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); +add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); $title = $pages->title . ": " . elgg_echo("pages:history"); $content = elgg_view_title($title); diff --git a/mod/pages/index.php b/mod/pages/index.php index 2afae36df..50d11af1d 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -10,13 +10,13 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); global $CONFIG; // Add menus -$owner = page_owner_entity(); +$owner = elgg_get_page_owner(); if (!($owner instanceof ElggGroup)) { - add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); + add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); add_submenu_item(elgg_echo('pages:all'),$CONFIG->wwwroot."mod/pages/world.php", 'pageslinksgeneral'); } if (($owner instanceof ElggEntity) && (can_write_to_container(0,$owner->guid))){ - add_submenu_item(elgg_echo('pages:new'), $CONFIG->url . "pg/pages/new/?container_guid=" . page_owner(), 'pagesactions'); + add_submenu_item(elgg_echo('pages:new'), $CONFIG->url . "pg/pages/new/?container_guid=" . elgg_get_page_owner_guid(), 'pagesactions'); add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/" . $owner->username, 'pagesactions'); } @@ -38,7 +38,7 @@ $context = get_context(); set_context('search'); -$objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); +$objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); set_context($context); diff --git a/mod/pages/new.php b/mod/pages/new.php index bf2640301..2003b183e 100644 --- a/mod/pages/new.php +++ b/mod/pages/new.php @@ -13,7 +13,7 @@ global $CONFIG; if ($container = (int) get_input('container_guid')) { set_page_owner($container); } -$page_owner = page_owner_entity(); +$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()); @@ -28,7 +28,7 @@ if(get_input('parent_guid')){ } global $CONFIG; -add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); +add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); $title = elgg_echo("pages:new"); $area2 .= elgg_view_title($title); diff --git a/mod/pages/start.php b/mod/pages/start.php index 80c1607a2..3dcacd457 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -82,7 +82,7 @@ function pages_submenus() { global $CONFIG; - $page_owner = page_owner_entity(); + $page_owner = elgg_get_page_owner(); // Group submenu option if ($page_owner instanceof ElggGroup && get_context() == 'groups') { @@ -310,8 +310,8 @@ function pages_write_permission_check($hook, $entity_type, $returnvalue, $params function pages_container_permission_check($hook, $entity_type, $returnvalue, $params) { if (get_context() == "pages") { - if (page_owner()) { - if (can_write_to_container(get_loggedin_userid(), page_owner())) return true; + if (elgg_get_page_owner_guid()) { + if (can_write_to_container(get_loggedin_userid(), elgg_get_page_owner_guid())) return true; } if ($page_guid = get_input('page_guid',0)) { $entity = get_entity($page_guid); diff --git a/mod/pages/view.php b/mod/pages/view.php index 2efcf4f04..24684bff7 100644 --- a/mod/pages/view.php +++ b/mod/pages/view.php @@ -28,10 +28,10 @@ if ($container) { } global $CONFIG; -// add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); +// add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); if ($pages->canEdit()) { - add_submenu_item(elgg_echo('pages:newchild'),"{$CONFIG->wwwroot}pg/pages/new/?parent_guid={$pages->getGUID()}&container_guid=" . page_owner(), 'pagesactions'); + add_submenu_item(elgg_echo('pages:newchild'),"{$CONFIG->wwwroot}pg/pages/new/?parent_guid={$pages->getGUID()}&container_guid=" . elgg_get_page_owner_guid(), 'pagesactions'); $delete_url = elgg_add_action_tokens_to_url("{$CONFIG->wwwroot}action/pages/delete?page={$pages->getGUID()}"); add_submenu_item(elgg_echo('pages:delete'), $delete_url, 'pagesactions', true); } @@ -44,7 +44,7 @@ if ($parent_page = get_entity(get_input("page_guid"))) { $title = $pages->title; // Breadcrumbs -$body = elgg_view('pages/breadcrumbs', array('page_owner' => page_owner_entity(), 'parent' => $parent)); +$body = elgg_view('pages/breadcrumbs', array('page_owner' => elgg_get_page_owner(), 'parent' => $parent)); $body .= elgg_view_title($pages->title); $body .= elgg_view_entity($pages, true); diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php index bdd721b82..0d066bf80 100644 --- a/mod/pages/views/default/forms/pages/edit.php +++ b/mod/pages/views/default/forms/pages/edit.php @@ -8,7 +8,7 @@ $parent_guid = get_input('parent_guid'); $container_guid = get_input('container_guid'); if (!$container_guid) { - $container_guid = page_owner(); + $container_guid = elgg_get_page_owner_guid(); } $new_page = false; @@ -86,7 +86,7 @@ if ($container_guid) { } ?> <input type="hidden" name="parent_guid" value="<?php if (!$new_page) echo $vars['entity']->parent_guid; else echo $parent_guid; ?>" /> - <input type="hidden" name="owner_guid" value="<?php if (!$new_page) echo $vars['entity']->owner_guid; else echo page_owner(); ?>" /> + <input type="hidden" name="owner_guid" value="<?php if (!$new_page) echo $vars['entity']->owner_guid; else echo elgg_get_page_owner_guid(); ?>" /> <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> </p> diff --git a/mod/pages/views/default/pages/groupprofile_pages.php b/mod/pages/views/default/pages/groupprofile_pages.php index 17c1d87ed..8069cdd8b 100644 --- a/mod/pages/views/default/pages/groupprofile_pages.php +++ b/mod/pages/views/default/pages/groupprofile_pages.php @@ -13,7 +13,7 @@ if ($vars['entity']->pages_enable != 'no') { <h2><?php echo elgg_echo("pages:groupprofile"); ?></h2> <?php - $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => 5, 'full_view' => FALSE)); + $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => 5, 'full_view' => FALSE)); if($objects) echo $objects; diff --git a/mod/pages/views/default/widgets/pages/view.php b/mod/pages/views/default/widgets/pages/view.php index 9d5a89aea..d51fd008a 100644 --- a/mod/pages/views/default/widgets/pages/view.php +++ b/mod/pages/views/default/widgets/pages/view.php @@ -17,10 +17,10 @@ if (!$num_display) { $num_display = 4; } -$pages = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $num_display, 'full_view' => FALSE)); +$pages = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => $num_display, 'full_view' => FALSE)); if ($pages) { - $pagesurl = $vars['url'] . "pg/pages/owned/" . page_owner_entity()->username; + $pagesurl = $vars['url'] . "pg/pages/owned/" . elgg_get_page_owner()->username; $pages .= "<div class=\"pages_widget_singleitem_more\"><a href=\"{$pagesurl}\">" . elgg_echo('pages:more') . "</a></div>"; } diff --git a/mod/pages/welcome.php b/mod/pages/welcome.php index 10628b175..759114965 100644 --- a/mod/pages/welcome.php +++ b/mod/pages/welcome.php @@ -15,7 +15,7 @@ if ($container = (int) get_input('container_guid')) { set_page_owner($container); } -$page_owner = page_owner_entity(); +$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()); @@ -24,7 +24,7 @@ if ($page_owner === false || is_null($page_owner)) { //get the owners welcome message if it exists $welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'container_guid' => $page_owner->getGUID(), 'limit' => 1)); global $CONFIG; -add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); +add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); $title = elgg_echo("pages:welcome"); $area2 .= elgg_view_title($title); diff --git a/mod/pages/world.php b/mod/pages/world.php index 8a8ede68d..0b411b8b2 100644 --- a/mod/pages/world.php +++ b/mod/pages/world.php @@ -10,7 +10,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); global $CONFIG; // Get the current page's owner -$page_owner = page_owner_entity(); +$page_owner = elgg_get_page_owner(); if ($page_owner === false || is_null($page_owner)) { $page_owner = get_loggedin_user(); set_page_owner($_SESSION['guid']); @@ -21,7 +21,7 @@ if (($page_owner instanceof ElggEntity) && ($page_owner->canWriteToContainer())) } if(isloggedin()) { - add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral'); + add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), $CONFIG->url . "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral'); } add_submenu_item(elgg_echo('pages:all'),$CONFIG->wwwroot."mod/pages/world.php", 'pageslinksgeneral'); @@ -29,7 +29,7 @@ add_submenu_item(elgg_echo('pages:all'),$CONFIG->wwwroot."mod/pages/world.php", $limit = get_input("limit", 10); $offset = get_input("offset", 0); -$title = sprintf(elgg_echo("pages:all"),page_owner_entity()->name); +$title = sprintf(elgg_echo("pages:all"),elgg_get_page_owner()->name); // Get objects $context = get_context(); |