I'll look into the escaping bug and check out your patch, thanks!
Currently, templates are limited to course config stuff. We have plans to implement a backup/restore mechanism but, as you've found, it isn't trivial. Specially because course creation triggered by the enrolment plugin (LDAP, DB, etc) could happen on a user's login, and that would be a serious problem.
Penny will probably be working on reworking somer of the backup/restore internals soonish. When that goes through, we'll have the road cleared out for this...
LDAP enrolment 1.5+ bugs
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.