aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/views/default/forms
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/views/default/forms')
-rw-r--r--mod/pages/views/default/forms/pages/edit.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php
index 9469f5eb9..e14ff19ec 100644
--- a/mod/pages/views/default/forms/pages/edit.php
+++ b/mod/pages/views/default/forms/pages/edit.php
@@ -18,6 +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";
+ }
+
?>
<div>
<label><?php echo elgg_echo("pages:$name") ?></label>
@@ -26,9 +38,10 @@ foreach ($variables as $name => $type) {
echo '<br />';
}
- echo elgg_view("input/$type", array(
+ echo elgg_view($input_view, array(
'name' => $name,
'value' => $vars[$name],
+ 'entity' => ($name == 'parent_guid') ? $vars['entity'] : null,
));
?>
</div>
@@ -52,7 +65,7 @@ echo elgg_view('input/hidden', array(
'name' => 'container_guid',
'value' => $vars['container_guid'],
));
-if ($vars['parent_guid']) {
+if (!$vars['guid']) {
echo elgg_view('input/hidden', array(
'name' => 'parent_guid',
'value' => $vars['parent_guid'],