From e8330243e2c76c70b53aab15d1c5631760b7c412 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 16 Dec 2012 14:45:48 -0500 Subject: Refs #1334. Move the page parent input to pages/input/parent. --- mod/pages/views/default/forms/pages/edit.php | 10 ++++++- mod/pages/views/default/input/parent.php | 37 -------------------------- mod/pages/views/default/pages/input/parent.php | 37 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 38 deletions(-) delete mode 100644 mod/pages/views/default/input/parent.php create mode 100644 mod/pages/views/default/pages/input/parent.php (limited to 'mod/pages/views') diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php index 653a7ee47..e14ff19ec 100644 --- a/mod/pages/views/default/forms/pages/edit.php +++ b/mod/pages/views/default/forms/pages/edit.php @@ -18,10 +18,18 @@ foreach ($variables as $name => $type) { if (($type == 'access' || $type == 'write_access') && !$can_change_access) { continue; } + // don't show parent picker input for top or new pages. if ($name == 'parent_guid' && (!$vars['parent_guid'] || !$vars['guid'])) { continue; } + + if ($type == 'parent') { + $input_view = "pages/input/$type"; + } else { + $input_view = "input/$type"; + } + ?>
@@ -30,7 +38,7 @@ foreach ($variables as $name => $type) { echo '
'; } - echo elgg_view("input/$type", array( + echo elgg_view($input_view, array( 'name' => $name, 'value' => $vars[$name], 'entity' => ($name == 'parent_guid') ? $vars['entity'] : null, diff --git a/mod/pages/views/default/input/parent.php b/mod/pages/views/default/input/parent.php deleted file mode 100644 index f354129fe..000000000 --- a/mod/pages/views/default/input/parent.php +++ /dev/null @@ -1,37 +0,0 @@ -getContainerEntity(); -} - -$pages = pages_get_navigation_tree($container); -$options = array(); - -foreach ($pages as $page) { - $spacing = ""; - for ($i = 0; $i < $page['depth']; $i++) { - $spacing .= "--"; - } - $options[$page['guid']] = "$spacing " . $page['title']; -} - -$defaults = array( - 'class' => 'elgg-input-parent-picker', - 'options_values' => $options, -); - -$vars = array_merge($defaults, $vars); - -echo elgg_view('input/dropdown', $vars); diff --git a/mod/pages/views/default/pages/input/parent.php b/mod/pages/views/default/pages/input/parent.php new file mode 100644 index 000000000..c5ee3c3fb --- /dev/null +++ b/mod/pages/views/default/pages/input/parent.php @@ -0,0 +1,37 @@ +getContainerEntity(); +} + +$pages = pages_get_navigation_tree($container); +$options = array(); + +foreach ($pages as $page) { + $spacing = ""; + for ($i = 0; $i < $page['depth']; $i++) { + $spacing .= "--"; + } + $options[$page['guid']] = "$spacing " . $page['title']; +} + +$defaults = array( + 'class' => 'elgg-pages-input-parent-picker', + 'options_values' => $options, +); + +$vars = array_merge($defaults, $vars); + +echo elgg_view('input/dropdown', $vars); -- cgit v1.2.3