Fix when Moodle not at root

Fix to make form reload correctly when installation not at root of server. 

Previously
http://127.0.0.1/moodle24/course/modedit.php?add=customlabel...
would reload as 
http://127.0.0.1/course/modedit.php?add=customlabel...