- MakeHyperlink now returns absolute URLs (including server name & port)

- Fixed the handling of the "menu" option in the DisplayBlocks
- removed unneeded GetUIPage functions

SVN:trunk[269]
This commit is contained in:
Denis Flaven
2010-01-18 16:06:02 +00:00
parent 920a98a902
commit 3276961866
5 changed files with 56 additions and 49 deletions

View File

@@ -14,7 +14,7 @@ abstract class cmdbAbstractObject extends CMDBObject
public static function GetUIPage()
{
return './UI.php';
return '../pages/UI.php';
}
public static function ComputeUIPage($sClass)
@@ -40,6 +40,9 @@ abstract class cmdbAbstractObject extends CMDBObject
$oAppContext = new ApplicationContext();
$sExtClassNameAtt = MetaModel::GetNameAttributeCode($sObjClass);
$sPage = self::ComputeUIPage($sObjClass);
$sAbsoluteUrl = utils::GetAbsoluteUrl(false); // False => Don't get the query string
$sAbsoluteUrl = substr($sAbsoluteUrl, 0, 1+strrpos($sAbsoluteUrl, '/')); // remove the current page, keep just the path, up to the last /
// Use the "name" of the target class as the label of the hyperlink
// unless it's not available in the external attributes...
if (isset($aAvailableFields[$sExtClassNameAtt]))
@@ -71,7 +74,7 @@ abstract class cmdbAbstractObject extends CMDBObject
$sLabel = MetaModel::GetName($sObjClass)." #$sObjKey";
}
$sHint = MetaModel::GetName($sObjClass)."::$sObjKey";
return "<a href=\"$sPage?operation=details&class=$sObjClass&id=$sObjKey&".$oAppContext->GetForLink()."\" title=\"$sHint\">$sLabel</a>";
return "<a href=\"{$sAbsoluteUrl}{$sPage}?operation=details&class=$sObjClass&id=$sObjKey&".$oAppContext->GetForLink()."\" title=\"$sHint\">$sLabel</a>";
}
public function GetDisplayValue($sAttCode)