forked from Wavyzz/dolibarr
Prepare feature "Never show this message again"
This commit is contained in:
@@ -6398,16 +6398,25 @@ function setEventMessage($mesgs, $style = 'mesgs')
|
||||
* @param string $mesg Message string
|
||||
* @param array $mesgs Message array
|
||||
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
|
||||
* @param string $messagekey A key to be used to allow the feature "Never show this message again"
|
||||
* @return void
|
||||
* @see dol_htmloutput_events()
|
||||
*/
|
||||
function setEventMessages($mesg, $mesgs, $style = 'mesgs')
|
||||
function setEventMessages($mesg, $mesgs, $style = 'mesgs', $messagekey = '')
|
||||
{
|
||||
if (empty($mesg) && empty($mesgs))
|
||||
{
|
||||
dol_syslog("Try to add a message in stack with empty message", LOG_WARNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($messagekey)
|
||||
{
|
||||
// Complete message with a js link to set a cookie "DOLHIDEMESSAGE".$messagekey;
|
||||
// TODO
|
||||
$mesg.='';
|
||||
}
|
||||
if (empty($messagekey) || empty($_COOKIE["DOLHIDEMESSAGE".$messagekey]))
|
||||
{
|
||||
if (! in_array((string) $style, array('mesgs','warnings','errors'))) dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages');
|
||||
if (empty($mesgs)) setEventMessage($mesg, $style);
|
||||
@@ -6418,6 +6427,7 @@ function setEventMessages($mesg, $mesgs, $style = 'mesgs')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print formated messages to output (Used to show messages on html output).
|
||||
|
||||
@@ -415,9 +415,11 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri
|
||||
|
||||
if (defined('USEDOLIBARREDITOR'))
|
||||
{
|
||||
print '<div class="margintoponly marginleftonly">';
|
||||
/*print '<div class="margintoponly marginleftonly">';
|
||||
print "This page contains dynamic code that make a redirect to '".$containerref."' in your current context. Redirect has been canceled as it is not supported in edition mode.";
|
||||
print '</div>';
|
||||
print '</div>';*/
|
||||
$text = "This page contains dynamic code that make a redirect to '".$containerref."' in your current context. Redirect has been canceled as it is not supported in edition mode.";
|
||||
setEventMessages($text, null, 'warnings', 'WEBSITEREDIRECTDISABLED'.$containerref);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1969,8 +1969,8 @@ if (! GETPOST('hide_websitemenu'))
|
||||
}
|
||||
|
||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ExportSite")).'" name="exportsite">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage?' disabled="disabled"':'').'>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user