Explorar el Código

Fixed regression in the setup (due to a recent change in NiceWebPage)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1950 a333f486-631f-4898-b8df-5754b55c2be0
romainq hace 13 años
padre
commit
82a52e402a
Se han modificado 2 ficheros con 46 adiciones y 5 borrados
  1. 21 5
      application/nicewebpage.class.inc.php
  2. 25 0
      setup/setuppage.class.inc.php

+ 21 - 5
application/nicewebpage.class.inc.php

@@ -91,12 +91,12 @@ EOF
 		);
 		$this->add_linked_stylesheet("../css/light-grey.css");
 
-		$this->m_sRootUrl = utils::GetAbsoluteUrlAppRoot(); 		
+		$this->m_sRootUrl = $this->GetAbsoluteUrlAppRoot();
      	$sAbsURLAppRoot = addslashes($this->m_sRootUrl);
-    	$sAbsURLModulesRoot = addslashes(utils::GetAbsoluteUrlModulesRoot());
-    	$oAppContext = new ApplicationContext();
-		$sExtraParams = $oAppContext->GetForLink();
-		$sAppContext = addslashes($sExtraParams);
+    	$sAbsURLModulesRoot = addslashes($this->GetAbsoluteUrlModulesRoot());
+
+		$sAppContext = addslashes($this->GetApplicationContext());
+
 		$this->add_script(
 <<<EOF
 function GetAbsoluteUrlAppRoot()
@@ -135,6 +135,22 @@ EOF
 		$this->add("<p style=\"font-size:smaller\">$sText</p>\n");
 	}
 
+	public function GetAbsoluteUrlAppRoot()
+	{
+		return utils::GetAbsoluteUrlAppRoot();
+	}
+
+	public function GetAbsoluteUrlModulesRoot()
+	{
+		return utils::GetAbsoluteUrlModulesRoot();
+	}
+
+	function GetApplicationContext()
+	{
+		$oAppContext = new ApplicationContext();
+		return $oAppContext->GetForLink();
+	}
+
 	// By Rom, used by CSVImport and Advanced search
 	public function MakeClassesSelect($sName, $sDefaultValue, $iWidthPx, $iActionCode = null)
 	{

+ 25 - 0
setup/setuppage.class.inc.php

@@ -175,6 +175,31 @@ h3.clickable.open {
 }
 		");
 	}
+
+	/**
+	 * Overriden because the application is not fully loaded when the setup is being run
+	 */	 	
+	public function GetAbsoluteUrlAppRoot()
+	{
+		return '../';
+	}
+
+	/**
+	 * Overriden because the application is not fully loaded when the setup is being run
+	 */	 	
+	public function GetAbsoluteUrlModulesRoot()
+	{
+		return $this->GetAbsoluteUrlAppRoot().utils::GetCurrentEnvironment();
+	}
+
+	/**
+	 * Overriden because the application is not fully loaded when the setup is being run
+	 */	 	
+	function GetApplicationContext()
+	{
+		return '';
+	}
+
 	public function info($sText)
 	{
 		$this->add("<p class=\"info\">$sText</p>\n");