aboutsummaryrefslogtreecommitdiff
path: root/mod/pages
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-20 07:09:38 +0200
committerSem <sembrestels@riseup.net>2012-07-20 07:09:38 +0200
commit07b599a683760d2542014bb04a681463420a3565 (patch)
treecfcd06671529eeec7790fb70a8d490094d7942c9 /mod/pages
parentea0140d87534c3b10e489d13a1449ebb79da832d (diff)
parent174763bcbcd20812dc09f27b64908f9d71b523b9 (diff)
downloadelgg-07b599a683760d2542014bb04a681463420a3565.tar.gz
elgg-07b599a683760d2542014bb04a681463420a3565.tar.bz2
Merge branch 'lorea-preprod'
Conflicts: .gitmodules
Diffstat (limited to 'mod/pages')
-rw-r--r--mod/pages/lib/pages.php22
-rw-r--r--mod/pages/pages/pages/view.php3
-rw-r--r--mod/pages/start.php5
-rw-r--r--mod/pages/views/default/pages/sidebar/navigation.php6
4 files changed, 19 insertions, 17 deletions
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index 3f27118a6..9a9ba12e9 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -103,16 +103,18 @@ function pages_register_navigation_tree($container) {
'metadata_value' => $parent->getGUID(),
'limit' => 0,
));
-
- foreach ($children as $child) {
- elgg_register_menu_item('pages_nav', array(
- 'name' => $child->getGUID(),
- 'text' => $child->title,
- 'href' => $child->getURL(),
- 'parent_name' => $parent->getGUID(),
- ));
- array_push($stack, $child);
+
+ if ($children) {
+ foreach ($children as $child) {
+ elgg_register_menu_item('pages_nav', array(
+ 'name' => $child->getGUID(),
+ 'text' => $child->title,
+ 'href' => $child->getURL(),
+ 'parent_name' => $parent->getGUID(),
+ ));
+ array_push($stack, $child);
+ }
}
}
}
-} \ No newline at end of file
+}
diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php
index 6b9d03f49..e1c3fdbfd 100644
--- a/mod/pages/pages/pages/view.php
+++ b/mod/pages/pages/pages/view.php
@@ -9,7 +9,8 @@ $page_guid = get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
register_error(elgg_echo('noaccess'));
- forward();
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward('');
}
elgg_set_page_owner_guid($page->getContainerGUID());
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 834e98870..6b0ad38b0 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -30,7 +30,6 @@ function pages_init() {
// Register some actions
$action_base = elgg_get_plugins_path() . 'pages/actions/pages';
elgg_register_action("pages/edit", "$action_base/edit.php");
- elgg_register_action("pages/editwelcome", "$action_base/editwelcome.php");
elgg_register_action("pages/delete", "$action_base/delete.php");
// Extend the main css view
@@ -106,10 +105,6 @@ function pages_page_handler($page) {
elgg_load_library('elgg:pages');
- // add the jquery treeview files for navigation
- elgg_load_js('jquery-treeview');
- elgg_load_css('jquery-treeview');
-
if (!isset($page[0])) {
$page[0] = 'all';
}
diff --git a/mod/pages/views/default/pages/sidebar/navigation.php b/mod/pages/views/default/pages/sidebar/navigation.php
index fe017b1a7..65eb500c8 100644
--- a/mod/pages/views/default/pages/sidebar/navigation.php
+++ b/mod/pages/views/default/pages/sidebar/navigation.php
@@ -5,6 +5,11 @@
* @uses $vars['page'] Page object if manually setting selected item
*/
+// add the jquery treeview files for navigation
+elgg_load_js('jquery-treeview');
+elgg_load_css('jquery-treeview');
+
+
$selected_page = elgg_extract('page', $vars, false);
if ($selected_page) {
$url = $selected_page->getURL();
@@ -51,4 +56,3 @@ if ($selected_page) {
});
</script>
-