Fixed the HTML display in the export webservice page. (Trac #58)

SVN:trunk[199]
This commit is contained in:
Denis Flaven
2009-12-21 09:41:31 +00:00
parent abcb687ccc
commit 460f8234f8
3 changed files with 47 additions and 0 deletions

View File

@@ -32,6 +32,21 @@ if (!empty($sExpression))
{
case 'html':
$oP = new nice_web_page("iTop - Export");
// The HTML output is made for pages located in the /pages/ folder
// since this page is in a different folder, let's adjust the HTML 'base' attribute
// to make the relative hyperlinks in the page work
$sServerName = $_SERVER['SERVER_NAME'];
$sProtocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
if ($sProtocol == 'http')
{
$sPort = ($_SERVER['SERVER_PORT'] == 80) ? '' : ':'.$_SERVER['SERVER_PORT'];
}
else
{
$sPort = ($_SERVER['SERVER_PORT'] == 443) ? '' : ':'.$_SERVER['SERVER_PORT'];
}
$sUrl = "$sProtocol://{$sServerName}{$sPort}/pages/";
$oP->set_base($sUrl);
cmdbAbstractObject::DisplaySet($oP, $oSet, array('menu' => false));
break;