mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Environments: banner displaying a message if env is NOT 'production' + factorized some code to create/update a config from the page parameters
SVN:trunk[1774]
This commit is contained in:
@@ -734,10 +734,11 @@ EOF
|
||||
$sRestrictions = Dict::S('UI:AccessRO-Users');
|
||||
}
|
||||
|
||||
$sApplicationBanner = '';
|
||||
if (strlen($sRestrictions) > 0)
|
||||
{
|
||||
$sAdminMessage = trim(MetaModel::GetConfig()->Get('access_message'));
|
||||
$sApplicationBanner = '<div id="admin-banner">';
|
||||
$sApplicationBanner .= '<div id="admin-banner">';
|
||||
$sApplicationBanner .= '<img src="../images/locked.png" style="vertical-align:middle;">';
|
||||
$sApplicationBanner .= ' <b>'.$sRestrictions.'</b>';
|
||||
if (strlen($sAdminMessage) > 0)
|
||||
@@ -746,13 +747,21 @@ EOF
|
||||
}
|
||||
$sApplicationBanner .= '</div>';
|
||||
}
|
||||
else if(strlen($this->m_sMessage))
|
||||
|
||||
if(strlen($this->m_sMessage))
|
||||
{
|
||||
$sApplicationBanner = '<div id="admin-banner"><span style="padding:5px;">'.$this->m_sMessage.'<span></div>';
|
||||
$sApplicationBanner .= '<div id="admin-banner"><span style="padding:5px;">'.$this->m_sMessage.'<span></div>';
|
||||
}
|
||||
else
|
||||
|
||||
$sEnvironment = utils::GetCurrentEnvironment();
|
||||
if($sEnvironment != 'production')
|
||||
{
|
||||
$sApplicationBanner = '';
|
||||
$sEnvLabel = trim(MetaModel::GetConfig()->Get('app_env_label'));
|
||||
if (strlen($sEnvLabel) == 0)
|
||||
{
|
||||
$sEnvLabel = $sEnvironment;
|
||||
}
|
||||
$sApplicationBanner .= '<div id="admin-banner"><span style="padding:5px;">'.Dict::Format('UI:ApplicationEnvironment', $sEnvLabel).'<span></div>';
|
||||
}
|
||||
|
||||
$sOnlineHelpUrl = MetaModel::GetConfig()->Get('online_help');
|
||||
|
||||
Reference in New Issue
Block a user