From 73ed4ae8513af1cc6e795b125cc1f319a965bfb4 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 12 Mar 2010 17:03:51 +0000 Subject: Merged Cash's bugfixes from the 1.7 branch (3288:5377). git-svn-id: http://code.elgg.org/elgg/trunk@5378 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/pages/actions/pages/edit.php | 12 ++++++++++++ mod/pages/index.php | 2 +- mod/pages/languages/en.php | 2 +- mod/pages/views/default/forms/pages/edit.php | 14 ++++++++++++++ mod/pages/views/default/pages/welcome.php | 2 +- mod/pages/world.php | 2 +- 6 files changed, 30 insertions(+), 4 deletions(-) (limited to 'mod/pages') diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php index 84aed61d6..a966232a8 100644 --- a/mod/pages/actions/pages/edit.php +++ b/mod/pages/actions/pages/edit.php @@ -52,6 +52,12 @@ // New instance, so set container_guid $container_guid = get_input('container_guid', $_SESSION['user']->getGUID()); $page->container_guid = $container_guid; + + // cache data in session in case data from form does not validate + $_SESSION['page_description'] = $input['description']; + $_SESSION['page_tags'] = get_input('tags'); + $_SESSION['page_read_access'] = (int)get_input('access_id'); + $_SESSION['page_write_access'] = (int)get_input('write_access_id'); } // Have we got it? Can we edit it? @@ -96,6 +102,12 @@ // Now save description as an annotation $page->annotate('page', $page->description, $page->access_id); + + // clear cache + unset($_SESSION['page_description']); + unset($_SESSION['page_tags']); + unset($_SESSION['page_read_access']); + unset($_SESSION['page_write_access']); system_message(elgg_echo("pages:saved")); diff --git a/mod/pages/index.php b/mod/pages/index.php index 0e4601cef..5b31c6347 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -41,7 +41,7 @@ set_context('search'); - $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'full_view' => FALSE)); + $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); set_context($context); diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php index d94ca8431..75d1bba9b 100644 --- a/mod/pages/languages/en.php +++ b/mod/pages/languages/en.php @@ -27,7 +27,7 @@ 'pages:history' => "Page history", 'pages:view' => "View page", 'pages:welcome' => "Edit welcome message", - 'pages:welcomemessage' => "Welcome to this Elgg pages plugin. This feature allows you to create pages on any topic and select who can view them and edit them.", + 'pages:welcomemessage' => "Welcome to the pages tool of %s. This tool allows you to create pages on any topic and select who can view them and edit them.", 'pages:welcomeerror' => "There was a problem saving your welcome message", 'pages:welcomeposted' => "Your welcome message has been posted", 'pages:navigation' => "Page navigation", diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php index 2b57fe814..2ad454073 100644 --- a/mod/pages/views/default/forms/pages/edit.php +++ b/mod/pages/views/default/forms/pages/edit.php @@ -25,6 +25,20 @@ $vars['entity']->access_id = 0; $vars['entity']->write_access_id = 0; } + + // pull in sticky values from session + if (isset($_SESSION['page_description'])) { + $vars['entity']->description = $_SESSION['page_description']; + $vars['entity']->tags = $_SESSION['page_tags']; + $vars['entity']->access_id = $_SESSION['page_read_access']; + $vars['entity']->write_access_id = $_SESSION['page_write_access']; + + // clear them + unset($_SESSION['page_description']); + unset($_SESSION['page_tags']); + unset($_SESSION['page_read_access']); + unset($_SESSION['page_write_access']); + } } ?>
diff --git a/mod/pages/views/default/pages/welcome.php b/mod/pages/views/default/pages/welcome.php index deefdba30..e4a465fdd 100644 --- a/mod/pages/views/default/pages/welcome.php +++ b/mod/pages/views/default/pages/welcome.php @@ -22,7 +22,7 @@ ?> -

+

sitename); ?>

'object', 'subtypes' => 'page_top', 'limit' => $limit, 'full_view' => FALSE)); + $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); set_context($context); -- cgit v1.2.3