class documentation
class ZMSCharformatManager(object): (source)
Manages character formats (charformats) for ZMS rich-text editing, including XML import/export, CRUD operations, and reordering.
| Method | del |
Delete a character format by id. |
| Method | get |
Return the configured character format definitions. |
| Method | import |
Import one or more character formats from XML data. |
| Method | manage_change |
Handle ZMI actions for creating, editing, and deleting char formats. |
| Method | move |
Move a character format to another list position. |
| Method | set |
Create or update a character format definition. |
| Instance Variable | charformats |
Undocumented |
| Method | _import |
Import a single character format definition from parsed XML data. |
Delete a character format by id.
| Parameters | |
| id:str | Character format identifier. |
| Returns | |
| str | Empty string for legacy callers. |
Import one or more character formats from XML data.
| Parameters | |
| xml:str | XML string or uploaded file-like object. |
Handle ZMI actions for creating, editing, and deleting char formats.
| Parameters | |
| lang:str | Active UI language. |
| btn:str | Submitted button id. |
| REQUEST:ZPublisher.HTTPRequest | The active HTTP request. |
| RESPONSE:ZPublisher.HTTPResponse | The active HTTP response. |
| Returns | |
| object | Redirect response or XML export payload. |
Move a character format to another list position.
| Parameters | |
| id:str | Character format identifier. |
| pos:int | Target list position. |
def setCharformat(self, oldId, newId, newIconClazz, newDisplay, newTag='', newAttrs='', newJS=''):
(source)
¶
Create or update a character format definition.
| Parameters | |
| old | Existing character format id to replace. |
| new | Target character format id. |
| new | Icon CSS class. |
| new | Display label. |
| new | HTML tag wrapper. |
| new | HTML attributes. |
| new | Client-side JavaScript hook. |
| Returns | |
| str | The persisted character format id. |