]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11543 Printing nice list of categories for parent category drop-down
authornicolasconnault <nicolasconnault>
Wed, 10 Oct 2007 06:21:37 +0000 (06:21 +0000)
committernicolasconnault <nicolasconnault>
Wed, 10 Oct 2007 06:21:37 +0000 (06:21 +0000)
course/editcategory_form.php

index 65fdeddc80ed7d532c937029c7fa93daae1116ef..78b76c910ceb1e265f5a8e24681e33edd23c61fc 100644 (file)
@@ -8,11 +8,9 @@ class editcategory_form extends moodleform {
         $mform =& $this->_form;
         
         // get list of categories to use as parents, with site as the first one
-        $categories = get_categories();
         $options = array(get_string('top'));
-        foreach ($categories as $catid => $cat) {
-            $options[$catid] = format_string($cat->name);
-        }
+        $parents = array();
+        make_categories_list($options, $parents);
         
         $mform->addElement('select', 'parent', get_string('parentcategory'), $options);
         $mform->addElement('text', 'name', get_string('categoryname'), array('size'=>'30'));