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.