<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,12 +18,6 @@ class CMSAdminSectionController extends AdminComponent {
 	**/
 	public function controller_global() {
 	  $this-&gt;model = $this-&gt;current_user-&gt;allowed_sections_model;
-		if(!$this-&gt;current_user-&gt;allowed_sections_ids) $this-&gt;tree_collection = array(&quot;None&quot;);
-		foreach($this-&gt;model-&gt;tree() as $section){
-			$tmp = str_pad(&quot;&quot;, $section-&gt;get_level(), &quot;*&quot;, STR_PAD_LEFT);
-			$tmp = str_replace(&quot;*&quot;, &quot;&amp;nbsp;&amp;nbsp;&quot;, $tmp);
-			$this-&gt;tree_collection[$section-&gt;id] = $tmp.$section-&gt;title;
-		}
 	}
 
 	/**
@@ -42,15 +36,18 @@ class CMSAdminSectionController extends AdminComponent {
 
 	/*new edit function - so include the link, video partials etc*/
 	public function edit() {
-		$this-&gt;page = new $this-&gt;model_class(WaxUrl::get(&quot;id&quot;));
-		$files = new WildfireFile();
-		$this-&gt;all_links = $files-&gt;find_all_files();
-		$this-&gt;link_partial = $this-&gt;render_partial(&quot;apply_links&quot;);
-		//parent edit function - this handles the save etc
+    $model = new $this-&gt;model_class(WaxUrl::get(&quot;id&quot;));
+		$this-&gt;possible_parents = array(&quot;None&quot;);
+		$remove_ids = array();
+		foreach($model-&gt;tree() as $section) $remove_ids[] = $section-&gt;id; //only the subtree of the current node
+		foreach($this-&gt;model-&gt;tree() as $section){ //all sections
+		  if(!in_array($section-&gt;id, $remove_ids)){
+  			$tmp = str_pad(&quot;&quot;, $section-&gt;get_level(), &quot;*&quot;, STR_PAD_LEFT);
+  			$tmp = str_replace(&quot;*&quot;, &quot;&amp;nbsp;&amp;nbsp;&quot;, $tmp);
+  			$this-&gt;possible_parents[$section-&gt;id] = $tmp.$section-&gt;title;
+		  }
+		}
 		parent::edit();
-		$this-&gt;flash_files = $files-&gt;flash_files();
-		$this-&gt;video_partial = $this-&gt;render_partial(&quot;apply_video&quot;);
-		$this-&gt;form = $this-&gt;render_partial(&quot;form&quot;);
 	}
 
 	/**</diff>
      <filename>lib/controller/CMSAdminSectionController.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@
     &lt;fieldset class=&quot;content_options&quot;&gt;
       &lt;?=medium(text_field($model, &quot;title&quot;))?&gt;
       &lt;hr /&gt;
-      &lt;?=small(select($model, &quot;parent_id&quot;, array_diff_key($tree_collection, array($model-&gt;primval=&gt;&quot;&quot;)), array(), &quot;Parent Section&quot;))?&gt;
+      &lt;?=small(select($model, &quot;parent_id&quot;, $possible_parents, array(), &quot;Parent Section&quot;))?&gt;
       &lt;?=small(select($model, &quot;default_page_id&quot;, options_from_collection($model-&gt;published_content, &quot;id&quot;, &quot;title&quot;, &quot;None&quot;), array(), &quot;Default Content&quot;))?&gt;
       &lt;hr /&gt;
       &lt;?=large(text_area($model, &quot;introduction&quot;, array(), &quot;Introduction&quot;))?&gt;</diff>
      <filename>view/CMSAdminSectionController/_form.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e139e9175134023ace9499bd3ff9a56a33a382d2</id>
    </parent>
  </parents>
  <author>
    <name>Sheldon Els</name>
    <email>sheldon.els@gmail.com</email>
  </author>
  <url>http://github.com/phpwax/wildfire/commit/dfcb58da253cbe0eaae3cec203cabce2ceab21a9</url>
  <id>dfcb58da253cbe0eaae3cec203cabce2ceab21a9</id>
  <committed-date>2009-06-18T10:06:21-07:00</committed-date>
  <authored-date>2009-06-18T10:06:21-07:00</authored-date>
  <message>sections can't be crazy recursive loops anymore.</message>
  <tree>e4809692f501270108415f6113528489a045f75b</tree>
  <committer>
    <name>Sheldon Els</name>
    <email>sheldon.els@gmail.com</email>
  </committer>
</commit>
