PHP DOMNode -> setAttribute() max-width confusion

While adding some custom code into Mahara, I came across what seems like a very odd PHP bug today, so odd that I put it down to user error, but just can’t seem to find what the user error is! Imagine the code below with some embed code from youtube or picasa as the value of $embedCode.
$embedCode = "<embed .................></embed>";
$dom = new DOMDocument();
$allElements = $dom->getElementsByTagName('*');
$firstElement = $allElements->item(2);
firstElement->setAttribute("style", "max-width:100%");
echo $dom->saveHTML();

The line that plays up is the one including setAttribute(“style”, “max-width:100%”).

It works on pretty much all other possible css values, but doesn’t seem to like max-width nor min-width. I can set the style to hold color or background values, or text-align, but not max-width! What gives? Why does PHP seem to have CSS max-width?

EDIT: I have since uncovered the cause of this. My text string was being passed through a Mahara function clean_html() which strips out various things, including max-width style definitions. The solution is to clean_html() before I apply my max-width and hey presto, everything works as expected.

Moodle Moot UK 2010 – Mahoodle

Our Mahara Honeymoon

Southampton Solent University

Why Mahara?

  • met all requirementts
  • easy to customise
  • integration with Moodle
  • LEAP2A
  • No commercial tie-in
  • If it breaks, they can (hopefully) fix it

In Mahara tweaking the helpfiles so instead of being ‘what button to press’ instructions, becomes a structured/scaffolded way to guide and advise students on what and how to do it.

There is an unbranded  version of the video available, and Solent are happy to give the source files to people wanting to tweak it. Might be good promotional video for Kent’s Mahara launch.

Created a ‘sample student’ with portfolio and other shared resources to act as a guide for what can be done.

Angela Jay – Lewisham College

New users, only been using for several months. Use Mahoodle for entire student portal.


  • reflective log
  • self-promotion
  • community
  • communication

Taking good practice from the pilot year to use as a showcase once they go live to give other staff ideas of what they can do with Mahara.

Examples of e-portfolios available on

Moodle Moot Uk 2010 – Enhancing Moodle (e-portfolios)

Two sessions, one by Newham and one by TDM.


Purchased Moodle from ULCC  Nov 2008, launched for staff Dec 2008.

Live for students and staff Mar 2009 (MIS integration).

E-learning advisors in place to develop VLE and provide staff support.

Over 200 staff given 1 hour of 1-2-1 compulsory training. Followed by 2 hours group sessions.

Developing podcasting (videos in Moodle course) and e-assessment.

Nice use of images through the moodle course makes it look more interesting and more accessible.

Held off mahara to not introduce it at same time as moodle. Mahara fits into Newham’s ‘progression and employability skills’ subject.

10MB of storage space per student.

Derrin Kent – Mahara for Beginners

See this presentation online at:

very simplistic youtube video explaining what an e-portfolio is

Mahara not just a presentation tool but also creates a personalised learning environment.

Learners set their own learning agendas, build their own content and their own stories.

Open data standard, Leap2a – approx 15 organisations involved. Zipfolder with atom manifest.