function PHPExcel_Writer_Excel5_Worksheet::_writeUrlWeb in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php \PHPExcel_Writer_Excel5_Worksheet::_writeUrlWeb()
* Used to write http, ftp and mailto hyperlinks. * The link type ($options) is 0x03 is the same as absolute dir ref without * sheet. However it is differentiated by the $unknown2 data stream. * * @access private * *
Parameters
integer $row1 Start row: * @param integer $col1 Start column * @param integer $row2 End row * @param integer $col2 End column * @param string $url URL string * @return integer
See also
_writeUrl()
1 call to PHPExcel_Writer_Excel5_Worksheet::_writeUrlWeb()
- PHPExcel_Writer_Excel5_Worksheet::_writeUrlRange in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel5/ Worksheet.php - * This is the more general form of _writeUrl(). It allows a hyperlink to be * written to a range of cells. This function also decides the type of hyperlink * to be written. These are either, Web (http, ftp, mailto), Internal * (Sheet1!A1) or…
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel5/ Worksheet.php, line 1026
Class
- PHPExcel_Writer_Excel5_Worksheet
- PHPExcel_Writer_Excel5_Worksheet
Code
function _writeUrlWeb($row1, $col1, $row2, $col2, $url) {
$record = 0x1b8;
// Record identifier
$length = 0x0;
// Bytes to follow
// Pack the undocumented parts of the hyperlink stream
$unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000");
$unknown2 = pack("H*", "E0C9EA79F9BACE118C8200AA004BA90B");
// Pack the option flags
$options = pack("V", 0x3);
// Convert URL to a null terminated wchar string
$url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY));
$url = $url . "\0\0\0";
// Pack the length of the URL
$url_len = pack("V", strlen($url));
// Calculate the data length
$length = 0x34 + strlen($url);
// Pack the header data
$header = pack("vv", $record, $length);
$data = pack("vvvv", $row1, $row2, $col1, $col2);
// Write the packed data
$this
->_append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url);
return 0;
}