mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
- New Welcome popup message, displayed once per session at maximum.
SVN:trunk[797]
This commit is contained in:
46
application/templates/welcome_popup.html
Normal file
46
application/templates/welcome_popup.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<div style="width:100%;background: url(../images/welcome.jpg) top left no-repeat;">
|
||||
<style>
|
||||
.dashboard {
|
||||
vertical-align:top;
|
||||
width:50%;
|
||||
border:0px solid #000;
|
||||
background-color:#F9F9F1;
|
||||
padding:10px;
|
||||
text-align:left;
|
||||
font-size:10pt;
|
||||
}
|
||||
.dashboard2 {
|
||||
vertical-align:top;
|
||||
width:50%;
|
||||
border:0px solid #000;
|
||||
-moz-border-radius:10px;
|
||||
padding:5px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
td.dashboard li {
|
||||
margin-top: 5px;
|
||||
display: list-item;
|
||||
}
|
||||
td div.display_block {
|
||||
padding:0;
|
||||
}
|
||||
tr td.dashboard2, tr td.dashboard2 ul {
|
||||
font-size:10pt;
|
||||
}
|
||||
</style>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p style="text-align:left; font-size:32px;padding-left:400px;padding-top:40px;margin-bottom:30px;margin-top:0;color:#FFFFFF;"><itopstring>UI:WelcomeMenu:Title</itopstring></p>
|
||||
<p></p>
|
||||
<table border="0" style="padding:10px;border-spacing: 10px;width:100%">
|
||||
<tr>
|
||||
<td class="dashboard2">
|
||||
<itopstring>UI:WelcomeMenu:LeftBlock</itopstring>
|
||||
</td>
|
||||
<td class="dashboard2">
|
||||
<itopstring>UI:WelcomeMenu:RightBlock</itopstring>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -827,6 +827,7 @@ When associated with a trigger, each action is given an "order" number, specifyi
|
||||
'UI:Help' => 'Help',
|
||||
'UI:PasswordConfirm' => '(Confirm)',
|
||||
'UI:BeforeAdding_Class_ObjectsSaveThisObject' => 'Before adding more %1$s objects, save this object.',
|
||||
'UI:DisplayThisMessageAtStartup' => 'Display this message at startup',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -838,6 +838,7 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé
|
||||
'UI:Help' => 'Aide',
|
||||
'UI:PasswordConfirm' => '(Confirmer)',
|
||||
'UI:BeforeAdding_Class_ObjectsSaveThisObject' => 'Enregistrez l\'objet courant avant de créer de nouveaux éléments de type %1$s.',
|
||||
'UI:DisplayThisMessageAtStartup' => 'Afficher ce message au démarrage',
|
||||
));
|
||||
|
||||
?>
|
||||
|
||||
44
pages/UI.php
44
pages/UI.php
@@ -445,6 +445,47 @@ function UpdateObject(&$oObj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a popup welcome message, once per session at maximum
|
||||
* until the user unchecks the "Display welcome at startup"
|
||||
* @param WebPage $oP The current web page for the display
|
||||
* @return void
|
||||
*/
|
||||
function DisplayWelcomePopup(WebPage $oP)
|
||||
{
|
||||
if (!isset($_SESSION['welcome']))
|
||||
{
|
||||
// Check, only once per session, if the popup should be displayed...
|
||||
// If the user did not already ask for hiding it forever
|
||||
$bPopup = appUserPreferences::GetPref('welcome_popup', true);
|
||||
if ($bPopup)
|
||||
{
|
||||
$sTemplate = @file_get_contents('../application/templates/welcome_popup.html');
|
||||
if ($sTemplate !== false)
|
||||
{
|
||||
$oTemplate = new DisplayTemplate($sTemplate);
|
||||
$oP->add("<div id=\"welcome_popup\">");
|
||||
$oTemplate->Render($oP, array());
|
||||
$oP->add("<p style=\"float:left\"><input type=\"checkbox\" checked id=\"display_welcome_popup\"/><label for=\"display_welcome_popup\"> ".Dict::S('UI:DisplayThisMessageAtStartup')."</label></p>\n");
|
||||
$oP->add("<p style=\"float:right\"><input type=\"button\" value=\"".Dict::S('UI:Button:Ok')."\" onClick=\"$('#welcome_popup').dialog('close');\"/>\n");
|
||||
$oP->add("</div>\n");
|
||||
$sTitle = addslashes(Dict::S('UI:WelcomeMenu:Title'));
|
||||
$oP->add_ready_script(
|
||||
<<<EOF
|
||||
$('#welcome_popup').dialog( { width:'80%', title: '$sTitle', autoOpen: true, modal:true,
|
||||
close: function() {
|
||||
var bDisplay = $('#display_welcome_popup:checked').length;
|
||||
SetUserPreference('welcome_popup', bDisplay, true);
|
||||
}
|
||||
});
|
||||
EOF
|
||||
);
|
||||
$_SESSION['welcome'] = 'ok';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/***********************************************************************************
|
||||
*
|
||||
* Main user interface page, starts here
|
||||
@@ -1456,7 +1497,8 @@ EOF
|
||||
ExecutionKPI::ReportStats();
|
||||
MetaModel::ShowQueryTrace();
|
||||
|
||||
$oP->output();
|
||||
DisplayWelcomePopup($oP);
|
||||
$oP->output();
|
||||
}
|
||||
catch(CoreException $e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user