Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 2064 lines (117 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Xlsx  - X-Ref

__construct()   X-Ref
Create a new Xlsx Reader instance.


canRead($pFilename)   X-Ref
Can the current IReader read the file?

param: string $pFilename
return: bool

listWorksheetNames($pFilename)   X-Ref
Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.

param: string $pFilename
return: array

listWorksheetInfo($pFilename)   X-Ref
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).

param: string $pFilename
return: array

castToBoolean($c)   X-Ref
No description

castToError($c)   X-Ref
No description

castToString($c)   X-Ref
No description

castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)   X-Ref
No description

getFromZipArchive(ZipArchive $archive, $fileName = '')   X-Ref

param: string $fileName
return: string

load($pFilename)   X-Ref
Loads Spreadsheet from file.

param: string $pFilename
return: Spreadsheet

readColor($color, $background = false)   X-Ref
No description

readStyle(Style $docStyle, $style)   X-Ref

param: SimpleXMLElement|stdClass $style

readBorder(Border $docBorder, $eleBorder)   X-Ref

param: SimpleXMLElement $eleBorder

parseRichText($is)   X-Ref

param: SimpleXMLElement | null $is
return: RichText

readRibbon(Spreadsheet $excel, $customUITarget, $zip)   X-Ref

param: mixed $customUITarget
param: mixed $zip

getArrayItem($array, $key = 0)   X-Ref
No description

dirAdd($base, $add)   X-Ref
No description

toCSSArray($style)   X-Ref
No description

stripWhiteSpaceFromStyleString($string)   X-Ref
No description

boolean($value)   X-Ref
No description

readHyperLinkDrawing($objDrawing, $cellAnchor, $hyperlinks)   X-Ref

param: \PhpOffice\PhpSpreadsheet\Worksheet\Drawing $objDrawing
param: SimpleXMLElement $cellAnchor
param: array $hyperlinks

readProtection(Spreadsheet $excel, SimpleXMLElement $xmlWorkbook)   X-Ref
No description

readFormControlProperties(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData)   X-Ref
No description

readPrinterSettings(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData)   X-Ref
No description

castXsdBooleanToBool($xsdBoolean)   X-Ref
Convert an 'xsd:boolean' XML value to a PHP boolean value.
A valid 'xsd:boolean' XML value can be one of the following
four values: 'true', 'false', '1', '0'.  It is case sensitive.

Note that just doing '(bool) $xsdBoolean' is not safe,
since '(bool) "false"' returns true.

param: string $xsdBoolean An XML string value of type 'xsd:boolean'
return: bool  Boolean value

getWorkbookBaseName(ZipArchive $zip)   X-Ref

param: ZipArchive $zip Opened zip archive
return: string basename of the used excel workbook

readSheetProtection(Worksheet $docSheet, SimpleXMLElement $xmlSheet)   X-Ref
No description