Yeah, well I can add it manually. I just wanted something that would check if the category that is being added has a child and if yes, change into a dropdown. The code I had, didn't work but unfortunately I deleted it. I knew I added it into the function of the file described above and used the function getChildNodes but that threw out an error (something to do with $this cannot be used there).
But I guess I'll have to do it manually