Bug #22331 ยป messagebox.diff
t3lib/class.t3lib_userauthgroup.php (working copy) | ||
---|---|---|
* Returns true or false, depending if an alert popup (a javascript confirmation) should be shown
|
||
* call like $GLOBALS['BE_USER']->jsConfirmation($BITMASK)
|
||
*
|
||
* 1 - typeChange
|
||
* 1 - (not used anymore)
|
||
* 2 - copy/move/paste
|
||
* 4 - delete
|
||
* 8 - frontend editing
|
||
* 128 - other (not used yet)
|
||
*
|
||
* @param integer Bitmask
|
||
* @return boolean true if the confirmation should be shown
|
||
* @return boolean TRUE if the confirmation should be shown
|
||
*/
|
||
function jsConfirmation($bitmask) {
|
||
$alertPopup = $GLOBALS['BE_USER']->getTSConfig('options.alertPopups');
|
||
... | ... | |
$alertPopup = (int)$alertPopup['value'];
|
||
}
|
||
if(($alertPopup&$bitmask) == $bitmask) { // show confirmation
|
||
return 1;
|
||
return TRUE;
|
||
} else { // don't show confirmation
|
||
return 0;
|
||
return FALSE;
|
||
}
|
||
}
|
||
t3lib/class.t3lib_tceforms.php (working copy) | ||
---|---|---|
$PA['itemFormElValue'] = $this->defaultLanguageData[$table.':'.$row['uid']][$field];
|
||
}
|
||
// Create a JavaScript code line which will ask the user to save/update the form due to changing the element. This is used for eg. "type" fields and others configured with "requestUpdate"
|
||
if (
|
||
($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
|
||
($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field))) {
|
||
if($GLOBALS['BE_USER']->jsConfirmation(1)) {
|
||
$alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
|
||
} else {
|
||
$alertMsgOnChange = 'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
|
||
}
|
||
$alertMsgOnChange = 'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
|
||
} else {
|
||
$alertMsgOnChange = '';
|
||
}
|
||
... | ... | |
$fakePA['fieldConf']['onChange'] == 'reload' ||
|
||
($GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($key,$GLOBALS['TCA'][$table]['ctrl']['type'])) ||
|
||
($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && t3lib_div::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'],$key))) {
|
||
if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
|
||
$alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
|
||
} else {
|
||
$alertMsgOnChange = 'if(TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm();}';
|
||
}
|
||
$alertMsgOnChange = 'if(TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm();}';
|
||
} else {
|
||
$alertMsgOnChange = '';
|
||
}
|