Krang::BulkEdit::Xinha - Class for Xinha-based bulk editing


Krang::BulkEdit::Xinha - Class for Xinha-based bulk editing


This class implements methods to handle bulk editing via the Xinha WYSIWYG editor. Its methods are used for elementclasses specifying the string 'xinha' for their 'bulk_edit' attribute.

If there are sibling classes that also have 'bulk_edit => xinha', then the Bulk Edit Selector will have an additional member named ``All WYSIWYG Elements''. Selecting ``All WYSIGWYG Elements'' will pass all elements of sibling classes having 'bulk_edit => xinha' to the Xinha bulk editor.

Xinha-based bulk edit classes map to HTMLElements via their attribute 'bulk_edit_tag', which may be any of the allowed block-level elements. Allowed block-level elements are configurable. The default configuration resides in Krang::BulkEdit::Xinha::Config. Different configurations may be achieved through subclassing.

For some elementclasses Xinha's formatblock selector will contain the corresponding display_names. This pertains to element classes whose 'bulk_edit_tag' is one of:

Allowed block-level HTMLElements that do not have their own elementclass will end up in the default 'paragraph' elementclass. When no elementclass with 'bulk_edit_tag => p' is found, a class name'd 'paragraph' will be looked up. If none exists, Krang croaks.

This default behavior means that, say, HTMLTableElments will end up in the 'paragraph' element class unless some element class specially caters for table elements by specifying 'bulk_edit_tag => table'.

In this case - when the HTMLTableElement ends up in the paragraph element - the 'table' start and end tags will be part of the element's data. For HTMLElements having their own element class, the start and end tags are not part of the element's data, hence are not stored in the database.


Xinha's toolbar and the set of allowed HTMLElements (and allowed attributes of allowed HTMLElements) may be configured by subclassing Krang::BulkEdit::Xinha::Config which provides the default configuration.