(no commit message)
authorheidi valles <hvalles@ocad.ca>
Tue, 20 Jun 2006 14:58:07 +0000 (14:58 -0000)
committerheidi valles <hvalles@ocad.ca>
Tue, 20 Jun 2006 14:58:07 +0000 (14:58 -0000)
docs/tools/links/categories_edit.php

index 908f2dd..214e607 100644 (file)
@@ -88,16 +88,22 @@ require(AT_INCLUDE_PATH.'header.inc.php');
                                $current_cat_id = $categories[$cat_id]['cat_parent'];\r
                                $exclude = true; /* exclude the children */\r
                                \r
+                               //remove the current cat_id and it's sub cats from list, don't want to print them out.\r
+                               foreach ($categories[$current_cat_id]['children'] as $id=>$child) {\r
+                                       if ($child == $cat_id) {\r
+                                               unset($categories[$current_cat_id]['children'][$id]);\r
+                                       }\r
+                               }\r
+                               unset($categories[$cat_id]);\r
+\r
                                $auth = manage_links();\r
                                if ($auth == LINK_CAT_AUTH_ALL) {\r
                                        echo '<option value="0-'.LINK_CAT_COURSE.'-'.$_SESSION['course_id'].'">&nbsp;&nbsp;&nbsp;[ '._AT('cats_none').' ]&nbsp;&nbsp;&nbsp;</option>';\r
                                        echo '<option value="0-'.LINK_CAT_COURSE.'-'.$_SESSION['course_id'].'"></option>';\r
                                }\r
-\r
                                select_link_categories($categories, 0, $current_cat_id, $exclude, 0, TRUE);\r
                        ?></select>\r
        </div>\r
-\r
        <div class="row buttons">\r
                <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />\r
                <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>"  />\r