mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Partially de-hardcoded against the subdirectory "modules", so that 1.2.1 should be compatible with modules running under 2.0.
SVN:1.2[1778]
This commit is contained in:
@@ -407,6 +407,11 @@ EOF
|
||||
return '$sAbsURLAppRoot';
|
||||
}
|
||||
|
||||
function GetAbsoluteUrlModulesRoot()
|
||||
{
|
||||
return '$sAbsURLAppRoot'+'modules/';
|
||||
}
|
||||
|
||||
function AddAppContext(sURL)
|
||||
{
|
||||
var sContext = '$sAppContext';
|
||||
|
||||
@@ -169,7 +169,7 @@ EOF
|
||||
|
||||
function GetAbsoluteUrlAppRoot()
|
||||
{
|
||||
return '$sAbsURLAppRoot';
|
||||
return '$sAbsURLAppRoot'+'modules/';
|
||||
}
|
||||
|
||||
function AddAppContext(sURL)
|
||||
|
||||
@@ -460,8 +460,6 @@ class utils
|
||||
|
||||
/**
|
||||
* Returns the absolute URL to the server's root path
|
||||
* @param $sCurrentRelativePath string NO MORE USED, kept for backward compatibility only !
|
||||
* @param $bForceHTTPS bool True to force HTTPS, false otherwise
|
||||
* @return string The absolute URL to the server's root, without the first slash
|
||||
*/
|
||||
static public function GetAbsoluteUrlAppRoot()
|
||||
@@ -550,6 +548,17 @@ class utils
|
||||
return $sAppRootUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute URL to the modules root path
|
||||
* Hardcoded here for compatibility with iTop 2.0 modules
|
||||
* @return string The absolute URL to the modules
|
||||
*/
|
||||
static public function GetAbsoluteUrlModulesRoot()
|
||||
{
|
||||
$sUrl = self::GetAbsoluteUrlAppRoot().'modules/';
|
||||
return $sUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells whether or not log off operation is supported.
|
||||
* Actually in only one case:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
define('APPROOT', dirname(__FILE__).'/');
|
||||
define('MODULESROOT', APPROOT.'modules/');
|
||||
if (function_exists('microtime'))
|
||||
{
|
||||
$fItopStarted = microtime(true);
|
||||
|
||||
@@ -4600,6 +4600,9 @@ if (!array_key_exists($sAttCode, self::$m_aAttribDefs[$sClass]))
|
||||
*/
|
||||
static public function ApplyParams($aInput, $aParams)
|
||||
{
|
||||
$aParams['APP_URL'] = utils::GetAbsoluteUrlAppRoot();
|
||||
$aParams['MODULES_URL'] = utils::GetAbsoluteUrlModulesRoot();
|
||||
|
||||
$aSearches = array();
|
||||
$aReplacements = array();
|
||||
foreach($aParams as $sSearch => $replace)
|
||||
|
||||
@@ -188,7 +188,7 @@ class Incident extends ResponseTicket
|
||||
$sIcon = '';
|
||||
if ($sIconName != '')
|
||||
{
|
||||
$sPath = '../modules/itop-incident-mgmt-1.0.0/images/'.$sIconName;
|
||||
$sPath = utils::GetAbsoluteUrlModulesRoot().'itop-incident-mgmt-1.0.0/images/'.$sIconName;
|
||||
if ($bImgTag)
|
||||
{
|
||||
$sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
|
||||
|
||||
Reference in New Issue
Block a user