Browse Source

- Make the portal web page scrollable.
- Support a per-customer stylesheet for tailoring the look of the portal.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@852 a333f486-631f-4898-b8df-5754b55c2be0

dflaven 14 năm trước cách đây
mục cha
commit
8ad61ad418
3 tập tin đã thay đổi với 37 bổ sung12 xóa
  1. 10 4
      application/portalwebpage.class.inc.php
  2. 10 1
      portal/index.php
  3. 17 7
      portal/portal.css

+ 10 - 4
application/portalwebpage.class.inc.php

@@ -37,7 +37,7 @@ class PortalWebPage extends NiceWebPage
 	 */
 	protected $m_aMenuButtons;
 	
-    public function __construct($sTitle)
+    public function __construct($sTitle, $sAlternateStyleSheet = '')
     {
     	$this->m_aMenuButtons = array();
         parent::__construct($sTitle);
@@ -45,7 +45,14 @@ class PortalWebPage extends NiceWebPage
 		$this->add_header("Cache-control: no-cache");
 		$this->add_linked_stylesheet("../css/jquery.treeview.css");
 		$this->add_linked_stylesheet("../css/jquery.autocomplete.css");
-		$this->add_linked_stylesheet("../portal/portal.css");
+		if ($sAlternateStyleSheet != '')
+		{
+			$this->add_linked_stylesheet("../portal/$sAlternateStyleSheet/portal.css");
+		}
+		else
+		{
+			$this->add_linked_stylesheet("../portal/portal.css");
+		}
 		$this->add_linked_script('../js/jquery.layout.min.js');
 		$this->add_linked_script('../js/jquery.ba-bbq.min.js');
 		$this->add_linked_script("../js/jquery.tablehover.js");
@@ -158,12 +165,11 @@ EOF
 	public function output()
 	{
 		$this->AddMenuButton('logoff', 'Portal:Disconnect', '../pages/logoff.php?portal=1'); // This menu is always present and is the last one
-		$sMenu = '	<div id="banner"><div id="portal_menu"><div id="logo"></div>';
 		foreach($this->m_aMenuButtons as $aMenuItem)
 		{
 			$sMenu .= "<a class=\"button\" id=\"{$aMenuItem['id']}\" href=\"{$aMenuItem['hyperlink']}\"><span>".Dict::S($aMenuItem['label'])."</span></a>";
 		}
-		$this->s_content = '<div id="portal">'.$sMenu.'<div id="content">'.$this->s_content.'</div></div>';
+		$this->s_content = '<div id="portal"><div id="banner"><div id="logo"></div>'.$sMenu.'</div><div id="content">'.$this->s_content.'</div></div>';
 		parent::output();
 	}
 }

+ 10 - 1
portal/index.php

@@ -743,9 +743,18 @@ try
 	require_once('../application/loginwebpage.class.inc.php');
 	LoginWebPage::DoLogin(false /* bMustBeAdmin */, true /* IsAllowedToPortalUsers */); // Check user rights and prompt if needed
 
-	$oP = new PortalWebPage(Dict::S('Portal:Title'));
 	$oUserOrg = GetUserOrg($oP);
 
+	$sCode = $oUserOrg->Get('code');
+	$sAlternateStylesheet = '';
+	if (@file_exists("./$sCode/portal.css"))
+	{
+		$sAlternateStylesheet = "$sCode";
+	}
+
+	$oP = new PortalWebPage(Dict::S('Portal:Title'), $sAlternateStylesheet);
+	$oP->add($sAlternateStylesheet);
+
 	if (is_object($oUserOrg))
 	{
 		switch($sOperation)

+ 17 - 7
portal/portal.css

@@ -1,7 +1,23 @@
+html, body {
+	margin: 0;
+	padding:0;
+	overflow-y: auto;
+}
+#portal {
+	height: 100%;
+}
+#content {
+	margin: 10px;
+	padding-left: 10px;
+	padding-right: 10px;
+	text-align: center;
+	overflow-y: auto;
+	display: block;
+}
 div#portal #banner {
 	width: 100%;
 	height: 60px;
-	display: inline-block;
+	display: block;
 	vertical-align:middle;
 	background-color: #f6f6f1;
 }
@@ -93,12 +109,6 @@ a.button span {
 	margin-left: 54px;
 	margin-right: 20px;
 }
-
-#content {
-	margin: 10px;
-	padding: 10px;
-	text-align: center;
-}
 #request_details {
 	display: inline-block;
 }