XOOPS/XoopsCore — pull request #185 by geekwright (2014-08-12 19:26:33+00:00)
Title: Begin implementing arbitrary attribute support in form elements

HTML5 introduced many new attributes, including custom data attributes. Also, some popular javascript libraries rely on the ability to include custom attributes. The only way available to add a new or nonstandard attribute in Xoops\Form\Element was the setExtra() method. Additionally, huge amounts of code exist within the form element render methods to perform the basic task of rendering attributes.

This change introduces the following Element methods:
- setAttribute() - sets a named attribute
- getAttribute() - get a named attribute
- hasAttribute() - determine if an named attribute exists
- addAttribute() - add to a multi-valued attribute, such as class
- renderAttributeString() - render all attributes to a string

These methods provide a generic mechanism to introduce any attribute into a form element without additional coding or manual building of attribute strings.

For example: `$element->addAttribute('disabled');`

At present, the base Element class is converted, along with Text and direct subclasses, Button, and TextArea. Additional conversion will follow.