diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/pages/actions/pages/editwelcome.php | 9 | ||||
-rw-r--r-- | mod/pages/index.php | 4 | ||||
-rw-r--r-- | mod/pages/start.php | 3 | ||||
-rw-r--r-- | mod/pages/views/default/forms/pages/editwelcome.php | 2 | ||||
-rw-r--r-- | mod/pages/welcome.php | 2 | ||||
-rw-r--r-- | mod/pages/world.php | 1 |
6 files changed, 11 insertions, 10 deletions
diff --git a/mod/pages/actions/pages/editwelcome.php b/mod/pages/actions/pages/editwelcome.php index dd832cb28..113eb956a 100644 --- a/mod/pages/actions/pages/editwelcome.php +++ b/mod/pages/actions/pages/editwelcome.php @@ -16,7 +16,7 @@ gatekeeper(); // Get group fields $message = get_input("pages_welcome"); -$owner_guid = get_input("owner_guid"); +$container_guid = get_input("owner_guid"); $object_guid = get_input("object_guid"); $access_id = (int) get_input("access_id"); @@ -37,7 +37,7 @@ if($object_guid){ } } else { //it is a new welcome object - if ($owner_guid) { + if ($container_guid) { $welcome = new ElggObject(); // Tell the system it's a pages welcome message $welcome->subtype = "pages_welcome"; @@ -46,7 +46,7 @@ if($object_guid){ $welcome->access_id = $access_id; // Set the owner - $welcome->owner_guid = $owner_guid; + $welcome->container_guid = $container_guid; // save if (!$welcome->save()){ @@ -59,5 +59,4 @@ if($object_guid){ } } -// Forward to the main blog page -forward("pg/pages/owned/" . get_user($owner_guid)->username);
\ No newline at end of file +forward("pg/pages/owned/" . get_entity($container_guid)->username);
\ No newline at end of file diff --git a/mod/pages/index.php b/mod/pages/index.php index 93e3428d5..2afae36df 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -17,7 +17,7 @@ if (!($owner instanceof ElggGroup)) { } 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'); - if ($owner instanceof ElggUser) add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/", 'pagesactions'); + add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/" . $owner->username, 'pagesactions'); } // access check for closed groups @@ -43,7 +43,7 @@ $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top set_context($context); //get the owners latest welcome message -$welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'owner_guid' => $owner->guid, 'limit' => 1)); +$welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'container_guid' => $owner->guid, 'limit' => 1)); $body = elgg_view_title($title); $body .= elgg_view("pages/welcome", array('entity' => $welcome_message)); diff --git a/mod/pages/start.php b/mod/pages/start.php index 6fd0ef26d..1deaec76b 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -108,6 +108,9 @@ function pages_page_handler($page) { break; case "welcome" : + if (isset($page[1])) { + set_input('username', $page[1]); + } include($CONFIG->pluginspath . "pages/welcome.php"); break; diff --git a/mod/pages/views/default/forms/pages/editwelcome.php b/mod/pages/views/default/forms/pages/editwelcome.php index 41721484b..e6d1f925a 100644 --- a/mod/pages/views/default/forms/pages/editwelcome.php +++ b/mod/pages/views/default/forms/pages/editwelcome.php @@ -15,7 +15,7 @@ if($vars['entity']) { } else { $current_message = ''; $object_guid = ''; - $access_id = ACCESS_PRIVATE; + $access_id = ACCESS_PUBLIC; } $page_owner = $vars['owner']->guid; diff --git a/mod/pages/welcome.php b/mod/pages/welcome.php index 54a9e7b53..f486f646d 100644 --- a/mod/pages/welcome.php +++ b/mod/pages/welcome.php @@ -22,7 +22,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', 'owner_guid' => $page_owner->getGUID(), 'limit' => 1)); +$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'); diff --git a/mod/pages/world.php b/mod/pages/world.php index 5a406b32b..7f32fbdec 100644 --- a/mod/pages/world.php +++ b/mod/pages/world.php @@ -18,7 +18,6 @@ if ($page_owner === false || is_null($page_owner)) { if (($page_owner instanceof ElggEntity) && ($page_owner->canWriteToContainer())){ add_submenu_item(elgg_echo('pages:new'), $CONFIG->url . "pg/pages/new/", 'pagesactions'); - add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/", 'pagesactions'); } if(isloggedin()) { |