Fix Warning: Illegal string offset 'class' ...

This PR fix:
Warning: Illegal string offset 'class' in ../libraries/cms/html/html.php on line 965
Warning: Illegal string offset 'class' in .../libraries/cms/html/html.php on line 966

+ a bit code style and prevert issues like we have for the calender field.
Merge pull request #708 from zero-24/patch-1

Fix Warning: Illegal string offset 'class' ...