mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
- Make the portal web page scrollable.
- Support a per-customer stylesheet for tailoring the look of the portal. SVN:trunk[852]
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user