]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1334. Move the page parent input to pages/input/parent.
authorBrett Profitt <brett.profitt@gmail.com>
Sun, 16 Dec 2012 19:45:48 +0000 (14:45 -0500)
committerBrett Profitt <brett.profitt@gmail.com>
Sun, 16 Dec 2012 19:45:48 +0000 (14:45 -0500)
mod/pages/actions/pages/edit.php
mod/pages/views/default/forms/pages/edit.php
mod/pages/views/default/pages/input/parent.php [moved from mod/pages/views/default/input/parent.php with 71% similarity]

index 29fbf022b57c9974445c34caa797a1a637bf25dd..40215e02e05252a91e6cef1a629263a5544f306e 100644 (file)
@@ -72,7 +72,7 @@ if (sizeof($input) > 0) {
 $page->container_guid = $container_guid;
 
 if ($parent_guid && $parent_guid != $page_guid) {
-       // Check if parent isn't below of the page in the tree
+       // Check if parent isn't below the page in the tree
        if ($page_guid) {
                $tree_page = get_entity($parent_guid);
                while ($tree_page->parent_guid > 0 && $page_guid != $tree_page->guid) {
index 653a7ee47817751dc008dfdaa6012130b54304d6..e14ff19ec76d7073e8bd127d7f8f5eca5a86d7ec 100644 (file)
@@ -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";
+       }
+
 ?>
 <div>
        <label><?php echo elgg_echo("pages:$name") ?></label>
@@ -30,7 +38,7 @@ 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,
similarity index 71%
rename from mod/pages/views/default/input/parent.php
rename to mod/pages/views/default/pages/input/parent.php
index f354129fe35cf53b74fd04fcbd5940cfa5f8424c..c5ee3c3fb73508a9fd55e27f70451021f5655aca 100644 (file)
@@ -2,10 +2,10 @@
 /**
  * Parent picker
  *
- * @uses $vars['value'] The current value, if any
+ * @uses $vars['value']          The current value, if any
  * @uses $vars['options_values']
- * @uses $vars['name'] The name of the input field
- * @uses $vars['entity'] Optional. The child entity (uses container_guid)
+ * @uses $vars['name']           The name of the input field
+ * @uses $vars['entity']         Optional. The child entity (uses container_guid)
  */
 
 elgg_load_library('elgg:pages');
@@ -28,7 +28,7 @@ foreach ($pages as $page) {
 }
 
 $defaults = array(
-       'class' => 'elgg-input-parent-picker',
+       'class' => 'elgg-pages-input-parent-picker',
        'options_values' => $options,
 );