function PHPExcel_Writer_Excel5_Worksheet::_writeUrlInternal in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php \PHPExcel_Writer_Excel5_Worksheet::_writeUrlInternal()
* Used to write internal reference hyperlinks such as "Sheet1!A1". * * @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::_writeUrlInternal()
- 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 1071
Class
- PHPExcel_Writer_Excel5_Worksheet
- PHPExcel_Writer_Excel5_Worksheet
Code
function _writeUrlInternal($row1, $col1, $row2, $col2, $url) {
$record = 0x1b8;
// Record identifier
$length = 0x0;
// Bytes to follow
// Strip URL type
$url = preg_replace('/^internal:/', '', $url);
// Pack the undocumented parts of the hyperlink stream
$unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000");
// Pack the option flags
$options = pack("V", 0x8);
// Convert the URL type and to a null terminated wchar string
$url .= "\0";
// character count
$url_len = PHPExcel_Shared_String::CountCharacters($url);
$url_len = pack('V', $url_len);
$url = PHPExcel_Shared_String::ConvertEncoding($url, 'UTF-16LE', 'UTF-8');
// Calculate the data length
$length = 0x24 + 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 . $url_len . $url);
return 0;
}