Forums | Mahara Community

Developers /
Scripted profile icon creation


anonymous profile picture
Account deleted
Posts: 7

28 April 2010, 14:49

I'm working on writing a script to automatically update students' profile icons in their Mahara profile with the images stored on our school's servers.  I started digging through how the images are stored on disk and where the appropriate entries need to be made in the database but I stopped and decided that I should first ask: Is there an API for artefact interaction that would help me do this.  I can hack it together myself but if there is an API it would make my life a lot easier (not to mention more version compatible :).

Thanks!

anonymous profile picture
Account deleted
Posts: 808

29 April 2010, 18:07

Hi David,

You might find it useful to look at auth/xmlrpc/lib.php starting line 275-ish where there's some code that updates a user's profile icon from their Moodle profile icon.

It would be nice if some of that stuff were shifted into a new function called update_profile_icon or something in the ArtefactTypeProfileIcon class, but no one's done that yet unfortunately.

R.

anonymous profile picture
Account deleted
Posts: 7

30 April 2010, 11:02

Thanks Richard! 

That was exactly what I needed.  It's not the well formatted, easy to read documentation that I had hoped for but it gives me an example of basically what I want to do.  We'll see how well it actually works in practice ;)

David

3 results