Forums | Mahara Community
Support
/
Views for learners
17 September 2010, 3:12
Hi
We need to add 7 views (templates) into all learners portfolios (350) is there a quick way of doing this rather than logging in as a user and manually copying each view.
Thanks
Kevin
17 September 2010, 3:36
Hi Kevin,
How comfortable are you with development? This is pretty easy to do with a bit of php once you've created your templates.
I assume that you want your views to be edittable by students afterwards and that you're aware that, once copied, they would be difficult to remove and/or modify.
Andrew
17 September 2010, 4:13
Hi Andrew
Thanks for your reply, I'm not by any means an expert but am able to do a little with some guidance. So if you could provide that guidance, that would be great. Yes we do want them to be editable by students, what do you mean when you say "once copied they would be difficult to remove and/or modify". We currently have the views as globally copiable views (templates).
Thanks for your help
Kevin
17 September 2010, 4:53
Hi Kevin,
Have a look at lib/view.php - there's a function called create_from_template which should point you in the right direction.
There are examples of where it's called in auth/user.php. You can only use it with a template, so you'd have to convert an existing view to a template to use the function, or to break down the contents of create_from_template to do the same kind of thing.
Good luck,
Andrew