From 1dc08b85b1c203c64d470490d933cf5710e11d75 Mon Sep 17 00:00:00 2001
From: toyomoyo <toyomoyo>
Date: Mon, 20 Aug 2007 01:59:50 +0000
Subject: [PATCH] MDL-4384, fixed undefined function call, hide the add sub
 category form in non-editing mode

---
 course/category.php | 2 +-
 course/index.php    | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/course/category.php b/course/category.php
index 2fc9e66cb7..25f02d240f 100644
--- a/course/category.php
+++ b/course/category.php
@@ -275,7 +275,7 @@
     }
 
 /// print option to add a subcategory
-    if (has_capability('moodle/category:create', $context)) {
+    if (has_capability('moodle/category:create', $context) && $creatorediting) {
         $cat->id = $id;
         $mform->set_data($cat);
         $mform->display();
diff --git a/course/index.php b/course/index.php
index 44ac487f93..6ac5a79ef6 100644
--- a/course/index.php
+++ b/course/index.php
@@ -75,7 +75,6 @@
                           $strcategories, '', '', true, update_categories_button());
             print_heading($strcategories);
             print_box_start('categorybox');
-            print_category_create_form();
             print_whole_category_list();
             print_box_end();
             print_course_search();
@@ -85,7 +84,6 @@
                     build_navigation(array(array('name'=>$strfulllistofcourses, 'link'=>'','type'=>'misc'))),
                          '', '', true, update_categories_button());
             print_box_start('courseboxes');
-            print_category_create_form();
             print_courses(0);
             print_box_end();
         }
-- 
2.39.5