Project

General

Profile

Feature #14735 ยป 2005-10-18_bugfix_1078_2.patch

Administrator Admin, 2005-10-25 16:33

View differences:

TYPO3core_patch1078/t3lib/class.t3lib_clipboard.php 2005-10-25 16:21:53.000000000 +0200
}
// Delete:
if ($elCount) {
$opt[]='<option value="'.htmlspecialchars("
if($GLOBALS['BE_USER']->jsConfirmation(4)) {
$js = "
if(confirm(".$GLOBALS['LANG']->JScharCode(sprintf($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.deleteClip'),$elCount)).")){
document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location);
}
").'">'.$this->clLabel('delete','rm').'</option>';
";
} else {
$js = " document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location); ";
}
$opt[]='<option value="'.htmlspecialchars($js).'">'.$this->clLabel('delete','rm').'</option>';
}
$selector_menu = '<select name="_clipMenu" onchange="eval(this.options[this.selectedIndex].value);this.selectedIndex=0;">'.implode('',$opt).'</select>';
......
* @return string JavaScript "confirm" message
*/
function confirmMsg($table,$rec,$type,$clElements) {
if($GLOBALS['BE_USER']->jsConfirmation(2)) {
$labelKey = 'LLL:EXT:lang/locallang_core.php:mess.'.($this->currentMode()=='copy'?'copy':'move').($this->current=='normal'?'':'cb').'_'.$type;
$msg = $GLOBALS['LANG']->sL($labelKey);
......
t3lib_div::fixed_lgd_cs($selRecTitle,30),
t3lib_div::fixed_lgd_cs($thisRecTitle,30)
)).')';
} else {
$conf = '';
}
return $conf;
}
TYPO3core_patch1078/t3lib/class.t3lib_tceforms.php 2005-10-25 16:25:51.000000000 +0200
if (
(($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field)))
&& !$BE_USER->uc['noOnChangeAlertInTypeFields']) {
&& $GLOBALS['BE_USER']->jsConfirmation(1)) {
$alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
} else {$alertMsgOnChange='';}
} else {
$alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
}
// Render as a hidden field?
if (in_array($field,$this->hiddenFieldListArr)) {
......
$tCells =array();
$pct = round(100/count($sArr));
foreach($sArr as $sKey => $sheetCfg) {
$onClick = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){'.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm()};";
if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
$onClick = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){'.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm()};";
} else {
$onClick = 'if(TBE_EDITOR_checkSubmit(-1)){ '.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm();}";
}
$tCells[]='<td width="'.$pct.'%" style="'.($sKey==$sheetKey ? 'background-color: #9999cc; font-weight: bold;' : 'background-color: #aaaaaa;').' cursor: hand;" onclick="'.htmlspecialchars($onClick).'" align="center">'.
($sheetCfg['ROOT']['TCEforms']['sheetTitle'] ? $this->sL($sheetCfg['ROOT']['TCEforms']['sheetTitle']) : $sKey).
......
'rows' => 2
);
}
if (
(($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)))
&& !$GLOBALS['BE_USER']->uc['noOnChangeAlertInTypeFields']) {
&& $GLOBALS['BE_USER']->jsConfirmation(1)) {
$alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
} else {
$alertMsgOnChange='';
$alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
}
$fakePA['fieldChangeFunc']=$PA['fieldChangeFunc'];
TYPO3core_patch1078/t3lib/class.t3lib_userauthgroup.php 2005-10-25 16:23:51.000000000 +0200
return $this->groupData['filemounts'];
}
/**
* Returns true or false, depending if an alert popup (a javascript confirmation) should be shown
* call like $GLOBALS['BE_USER']->jsConfirmation($BITMASK)
*
* @param $bitmask int Bitmask
* 1 - typeChange
* 2 - copy/move/paste
* 4 - delete
* 8 - frontend editing
* 128 - other (not used yet)
* @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) {
$alertPopup = 255; // default: show all warnings
}
if(($alertPopup&$bitmask) == $bitmask) { // show confirmation
return 1;
} else { // don't show confirmation
return 0;
}
}
TYPO3core_patch1078/tslib/class.tslib_content.php 2005-10-25 16:21:53.000000000 +0200
$out=$this->editPanelLinkWrap_doWrap($string,$adminURL.'alt_doc.php?edit['.$rParts[0].']['.$nPid.']=new&noView='.$nV,$currentRecord);
}
} else {
if ($confirm) {
if ($confirm && $GLOBALS['BE_USER']->jsConfirmation(8)) {
$cf1="if (confirm(unescape('".t3lib_div::rawurlencodeJS($confirm)."'))){";
$cf2='}';
} else {
TYPO3core_patch1078/typo3/alt_clickmenu.php 2005-10-25 16:21:53.000000000 +0200
function DB_paste($table,$uid,$type,$elInfo) {
$editOnClick = '';
$loc = 'top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
if($GLOBALS['BE_USER']->jsConfirmation(2)) {
$conf = $loc.' && confirm('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.($elInfo[2]=='copy'?'copy':'move').'_'.$type),$elInfo[0],$elInfo[1])).')';
} else {
$conf = $loc;
}
$editOnClick = 'if('.$conf.'){'.$loc.'.document.location=top.TS.PATH_typo3+\''.$this->clipObj->pasteUrl($table,$uid,0).'&redirect=\'+top.rawurlencode('.$this->frameLocation($loc.'.document').'); hideCM();}';
return $this->linkItem(
......
function DB_delete($table,$uid,$elInfo) {
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
$editOnClick='if('.$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),$elInfo[0])).")){".$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
if($GLOBALS['BE_USER']->jsConfirmation(4)) {
$conf = "confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),$elInfo[0])).")";
} else {
$conf = '1==1';
}
$editOnClick='if('.$loc." && ".$conf." ){".$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
"&cmd[".$table.']['.$uid.'][delete]=1&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
return $this->linkItem(
......
function FILE_delete($path) {
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
$editOnClick='if('.$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),basename($path))).")){".$loc.".document.location=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
if($GLOBALS['BE_USER']->jsConfirmation(4)) {
$conf = "confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),basename($path))).")";
} else {
$conf = '1==1';
}
$editOnClick='if('.$loc." && ".$conf." ){".$loc.".document.location=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
"&file[delete][0][data]=".rawurlencode($path).'&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
return $this->linkItem(
......
function FILE_paste($path,$target,$elInfo) {
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
if($GLOBALS['BE_USER']->jsConfirmation(2)) {
$conf=$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.($elInfo[2]=='copy'?'copy':'move').'_into'),$elInfo[0],$elInfo[1])).")";
} else {
$conf=$loc;
}
$editOnClick='if('.$conf.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$this->clipObj->pasteUrl('_FILE',$path,0).
"&redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').'); hideCM();}';
TYPO3core_patch1078/typo3/alt_doc.php 2005-10-25 16:21:53.000000000 +0200
}
}
function deleteRecord(table,id,url) { //
if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning')).')) {
if (
'.($GLOBALS['BE_USER']->jsConfirmation(4)?'confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning')).')':'1==1').'
) {
document.location = "tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC='.$BE_USER->veriCode().'&prErr=1&uPT=1";
}
return false;
TYPO3core_patch1078/typo3/file_upload.php 2005-10-25 16:21:53.000000000 +0200
$this->doc->docType = 'xhtml_trans';
$this->doc->backPath = $BACK_PATH;
$this->doc->form='<form action="tce_file.php" method="post" name="editform" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'">';
if($GLOBALS['BE_USER']->jsConfirmation(1)) {
$confirm = ' && confirm('.$LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')).')';
} else {
$confirm = '';
}
$this->doc->JScode=$this->doc->wrapScriptTags('
var path = "'.$this->target.'";
function reload(a) { //
if (!changed || (changed && confirm('.$LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')).'))) {
if (!changed || (changed '.$confirm.')) {
var params = "&target="+escape(path)+"&number="+a+"&returnUrl='.htmlspecialchars($this->returnUrl).'";
document.location = "file_upload.php?"+params;
}
TYPO3core_patch1078/typo3/sysext/cms/tslib/class.tslib_content.php 2005-10-25 16:21:53.000000000 +0200
$out=$this->editPanelLinkWrap_doWrap($string,$adminURL.'alt_doc.php?edit['.$rParts[0].']['.$nPid.']=new&noView='.$nV,$currentRecord);
}
} else {
if ($confirm) {
if ($confirm && $GLOBALS['BE_USER']->jsConfirmation(8)) {
$cf1="if (confirm(unescape('".t3lib_div::rawurlencodeJS($confirm)."'))){";
$cf2='}';
} else {
TYPO3core_patch1078/typo3/t3lib/class.t3lib_clipboard.php 2005-10-25 16:21:53.000000000 +0200
}
// Delete:
if ($elCount) {
$opt[]='<option value="'.htmlspecialchars("
if($GLOBALS['BE_USER']->jsConfirmation(4)) {
$js = "
if(confirm(".$GLOBALS['LANG']->JScharCode(sprintf($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.deleteClip'),$elCount)).")){
document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location);
}
").'">'.$this->clLabel('delete','rm').'</option>';
";
} else {
$js = " document.location='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(document.location); ";
}
$opt[]='<option value="'.htmlspecialchars($js).'">'.$this->clLabel('delete','rm').'</option>';
}
$selector_menu = '<select name="_clipMenu" onchange="eval(this.options[this.selectedIndex].value);this.selectedIndex=0;">'.implode('',$opt).'</select>';
......
* @return string JavaScript "confirm" message
*/
function confirmMsg($table,$rec,$type,$clElements) {
if($GLOBALS['BE_USER']->jsConfirmation(2)) {
$labelKey = 'LLL:EXT:lang/locallang_core.php:mess.'.($this->currentMode()=='copy'?'copy':'move').($this->current=='normal'?'':'cb').'_'.$type;
$msg = $GLOBALS['LANG']->sL($labelKey);
......
t3lib_div::fixed_lgd_cs($selRecTitle,30),
t3lib_div::fixed_lgd_cs($thisRecTitle,30)
)).')';
} else {
$conf = '';
}
return $conf;
}
TYPO3core_patch1078/typo3/t3lib/class.t3lib_tceforms.php 2005-10-25 16:25:51.000000000 +0200
if (
(($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field)))
&& !$BE_USER->uc['noOnChangeAlertInTypeFields']) {
&& $GLOBALS['BE_USER']->jsConfirmation(1)) {
$alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
} else {$alertMsgOnChange='';}
} else {
$alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
}
// Render as a hidden field?
if (in_array($field,$this->hiddenFieldListArr)) {
......
$tCells =array();
$pct = round(100/count($sArr));
foreach($sArr as $sKey => $sheetCfg) {
$onClick = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){'.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm()};";
if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
$onClick = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){'.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm()};";
} else {
$onClick = 'if(TBE_EDITOR_checkSubmit(-1)){ '.$this->elName($elName).".value='".$sKey."'; TBE_EDITOR_submitForm();}";
}
$tCells[]='<td width="'.$pct.'%" style="'.($sKey==$sheetKey ? 'background-color: #9999cc; font-weight: bold;' : 'background-color: #aaaaaa;').' cursor: hand;" onclick="'.htmlspecialchars($onClick).'" align="center">'.
($sheetCfg['ROOT']['TCEforms']['sheetTitle'] ? $this->sL($sheetCfg['ROOT']['TCEforms']['sheetTitle']) : $sKey).
......
'rows' => 2
);
}
if (
(($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)))
&& !$GLOBALS['BE_USER']->uc['noOnChangeAlertInTypeFields']) {
&& $GLOBALS['BE_USER']->jsConfirmation(1)) {
$alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
} else {
$alertMsgOnChange='';
$alertMsgOnChange = 'if(TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm();}';
}
$fakePA['fieldChangeFunc']=$PA['fieldChangeFunc'];
TYPO3core_patch1078/typo3/t3lib/class.t3lib_userauthgroup.php 2005-10-25 16:23:51.000000000 +0200
return $this->groupData['filemounts'];
}
/**
* Returns true or false, depending if an alert popup (a javascript confirmation) should be shown
* call like $GLOBALS['BE_USER']->jsConfirmation($BITMASK)
*
* @param $bitmask int Bitmask
* 1 - typeChange
* 2 - copy/move/paste
* 4 - delete
* 8 - frontend editing
* 128 - other (not used yet)
* @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) {
$alertPopup = 255; // default: show all warnings
}
if(($alertPopup&$bitmask) == $bitmask) { // show confirmation
return 1;
} else { // don't show confirmation
return 0;
}
}
    (1-1/1)