diff options
author | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-06-17 13:22:53 +0000 |
---|---|---|
committer | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-06-17 13:22:53 +0000 |
commit | 5fbc2b89624fa01c117a7595b96e2e320c6440f3 (patch) | |
tree | 0b5d2a2efcbb0608f754bb854132e394649a7014 | |
parent | 9cc850e2f2f141ec8daf17e68c63543082fc0e5b (diff) | |
download | php-ssrs-5fbc2b89624fa01c117a7595b96e2e320c6440f3.zip php-ssrs-5fbc2b89624fa01c117a7595b96e2e320c6440f3.tar.gz php-ssrs-5fbc2b89624fa01c117a7595b96e2e320c6440f3.tar.bz2 |
Render DeviceInfo with SID translation
-rwxr-xr-x | library/SSRS/Report.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/library/SSRS/Report.php b/library/SSRS/Report.php index e6220da..aa8d543 100755 --- a/library/SSRS/Report.php +++ b/library/SSRS/Report.php @@ -9,7 +9,6 @@ * @license * @version 0.1 */ - require_once('Soap/NTLM.php'); require_once('Soap/Exception.php'); require_once('Object/Abstract.php'); @@ -282,7 +281,7 @@ class SSRS_Report { $renderParams = array( 'Format' => $format, - 'DeviceInfo' => $this->renderXmlOptions($deviceInfo), + 'DeviceInfo' => $this->renderDeviceInfo($deviceInfo), 'PaginationMode' => $PaginationMode ); @@ -309,22 +308,34 @@ class SSRS_Report { } /** + * Translate deviceInfo array into XML + * Look out for translation entities + * @param array $deviceInfo + */ + public function renderDeviceInfo(array $deviceInfo) { + $translations = array('_SID_' => $this->_sessionId); + return $this->renderXmlOptions($deviceInfo, $translations); + } + + /** * Takes an array of options and converts them to an XML string recursively * @param array $options + * @param array $translations * @return string $xml */ - public function renderXmlOptions(array $options) { + public function renderXmlOptions(array $options, $translations = array()) { $xml = ''; foreach ($options AS $key => $value) { switch (true) { case is_array($value): - $value = $this->renderXmlOptions($value); + $value = $this->renderXmlOptions($value, $translations); break; case is_bool($value): $value = ($value) ? 'true' : 'false'; break; default: - $value = htmlentities((string) $value); + $value = strtr($value, $translations); + $value = htmlentities($value); } $key = preg_replace('/[^a-z0-9_\-]+/i', '_', $key); |