浏览代码

Portal: let the administrator specify an alternative URL for the portals (rewriting rules)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3848 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 年之前
父节点
当前提交
a953643cbe
共有 2 个文件被更改,包括 19 次插入1 次删除
  1. 10 1
      application/portaldispatcher.class.inc.php
  2. 9 0
      core/config.class.inc.php

+ 10 - 1
application/portaldispatcher.class.inc.php

@@ -55,7 +55,16 @@ class PortalDispatcher
 	
 	
 	public function GetURL()
 	public function GetURL()
 	{
 	{
-		return utils::GetAbsoluteUrlAppRoot().$this->aData['url'];
+		$aOverloads = MetaModel::GetConfig()->Get('portal_dispatch_urls');
+		if (array_key_exists($this->sPortalid, $aOverloads))
+		{
+			$sRet = $aOverloads[$this->sPortalid];
+		}
+		else
+		{
+			$sRet = utils::GetAbsoluteUrlAppRoot().$this->aData['url'];
+		}
+		return $sRet;
 	}
 	}
 	
 	
 	public function GetLabel()
 	public function GetLabel()

+ 9 - 0
core/config.class.inc.php

@@ -718,6 +718,15 @@ class Config
 			'source_of_value' => '',
 			'source_of_value' => '',
 			'show_in_conf_sample' => true,
 			'show_in_conf_sample' => true,
 		),
 		),
+		'portal_dispatch_urls' => array(
+			'type' => 'array',
+			'description' => 'Associative array of sPortalId => Home page URL (relatively to the application root)',
+			// examples... not used
+			'default' => array(),
+			'value' => false,
+			'source_of_value' => '',
+			'show_in_conf_sample' => false,
+		),
 		'max_execution_time_per_loop' => array(
 		'max_execution_time_per_loop' => array(
 			'type' => 'integer',
 			'type' => 'integer',
 			'description' => 'Maximum execution time requested, per loop, during bulk operations. Zero means no limit.',
 			'description' => 'Maximum execution time requested, per loop, during bulk operations. Zero means no limit.',