Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Class: StyleManager  - X-Ref


__construct(StyleRegistry $styleRegistry, AbstractOptions $options)   X-Ref
No description

getStylesXMLFileContent(int $numWorksheets)   X-Ref
Returns the content of the "styles.xml" file, given a list of styles.

param: int $numWorksheets Number of worksheets created

getContentXmlFontFaceSectionContent()   X-Ref
Returns the contents of the "<office:font-face-decls>" section, inside "content.xml" file.


getContentXmlAutomaticStylesSectionContent(array $worksheets)   X-Ref
Returns the contents of the "<office:automatic-styles>" section, inside "content.xml" file.

param: Worksheet[] $worksheets

getTableColumnStylesXMLContent()   X-Ref
No description

getStyledTableColumnXMLContent(int $maxNumColumns)   X-Ref
No description

getStylesSectionContent()   X-Ref
Returns the content of the "<office:styles>" section, inside "styles.xml" file.


getMasterStylesSectionContent(int $numWorksheets)   X-Ref
Returns the content of the "<office:master-styles>" section, inside "styles.xml" file.

param: int $numWorksheets Number of worksheets created

getFontFaceSectionContent()   X-Ref
Returns the content of the "<office:font-face-decls>" section, inside "styles.xml" file.


getAutomaticStylesSectionContent(int $numWorksheets)   X-Ref
Returns the content of the "<office:automatic-styles>" section, inside "styles.xml" file.

param: int $numWorksheets Number of worksheets created

getStyleSectionContent(Style $style)   X-Ref
Returns the contents of the "<style:style>" section, inside "<office:automatic-styles>" section.


getTextPropertiesSectionContent(Style $style)   X-Ref
Returns the contents of the "<style:text-properties>" section, inside "<style:style>" section.


getFontSectionContent(Style $style)   X-Ref
Returns the contents of the fonts definition section, inside "<style:text-properties>" section.


getParagraphPropertiesSectionContent(Style $style)   X-Ref
Returns the contents of the "<style:paragraph-properties>" section, inside "<style:style>" section.


getCellAlignmentSectionContent(Style $style)   X-Ref
Returns the contents of the cell alignment definition for the "<style:paragraph-properties>" section.


getCellVerticalAlignmentSectionContent(Style $style)   X-Ref
Returns the contents of the cell vertical alignment definition for the "<style:paragraph-properties>" section.


transformCellAlignment(string $cellAlignment)   X-Ref
Even though "left" and "right" alignments are part of the spec, and interpreted
respectively as "start" and "end", using the recommended values increase compatibility
with software that will read the created ODS file.


transformCellVerticalAlignment(string $cellVerticalAlignment)   X-Ref
Spec uses 'middle' rather than 'center'
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1420236_253892949.


getTableCellPropertiesSectionContent(Style $style)   X-Ref
Returns the contents of the "<style:table-cell-properties>" section, inside "<style:style>" section.


getWrapTextXMLContent(bool $shouldWrapText)   X-Ref
Returns the contents of the wrap text definition for the "<style:table-cell-properties>" section.


getBorderXMLContent(Border $border)   X-Ref
Returns the contents of the borders definition for the "<style:table-cell-properties>" section.


getBackgroundColorXMLContent(string $bgColor)   X-Ref
Returns the contents of the background color definition for the "<style:table-cell-properties>" section.