class documentation

class ZMSCharformatManager(object): (source)

View In Hierarchy

Manages character formats (charformats) for ZMS rich-text editing, including XML import/export, CRUD operations, and reordering.

Method delCharformat Delete a character format by id.
Method getCharFormats Return the configured character format definitions.
Method importCharformatXml Import one or more character formats from XML data.
Method manage_changeCharformat Handle ZMI actions for creating, editing, and deleting char formats.
Method moveCharformat Move a character format to another list position.
Method setCharformat Create or update a character format definition.
Instance Variable charformats Undocumented
Method _importCharformatXml Import a single character format definition from parsed XML data.
def delCharformat(self, id): (source)

Delete a character format by id.

Parameters
id:strCharacter format identifier.
Returns
strEmpty string for legacy callers.
def getCharFormats(self): (source)

Return the configured character format definitions.

Returns
listCharacter format definitions.
def importCharformatXml(self, xml): (source)

Import one or more character formats from XML data.

Parameters
xml:strXML string or uploaded file-like object.
def manage_changeCharformat(self, lang, btn, REQUEST, RESPONSE): (source)

Handle ZMI actions for creating, editing, and deleting char formats.

Parameters
lang:strActive UI language.
btn:strSubmitted button id.
REQUEST:ZPublisher.HTTPRequestThe active HTTP request.
RESPONSE:ZPublisher.HTTPResponseThe active HTTP response.
Returns
objectRedirect response or XML export payload.
def moveCharformat(self, id, pos): (source)

Move a character format to another list position.

Parameters
id:strCharacter format identifier.
pos:intTarget list position.
def setCharformat(self, oldId, newId, newIconClazz, newDisplay, newTag='', newAttrs='', newJS=''): (source)

Create or update a character format definition.

Parameters
oldId:strExisting character format id to replace.
newId:strTarget character format id.
newIconClazz:strIcon CSS class.
newDisplay:strDisplay label.
newTag:strHTML tag wrapper.
newAttrs:strHTML attributes.
newJS:strClient-side JavaScript hook.
Returns
strThe persisted character format id.
charformats = (source)

Undocumented

def _importCharformatXml(self, item): (source)

Import a single character format definition from parsed XML data.

Parameters
item:dictParsed character format description.