Project

General

Profile

Bug #21304 » 0012271-removeCutCopyandPasteIconsForL10nRecords.patch

Administrator Admin, 2009-10-19 14:37

View differences:

typo3/alt_clickmenu.php (working copy)
$DBmount = TRUE;
}
$l10nOverlay = false;
if ($table != 'pages_language_overlay' && array_key_exists('transOrigPointerField', $TCA[$table]['ctrl'])) {
$l10nOverlay = intval($this->rec[$TCA[$table]['ctrl']['transOrigPointerField']]) != 0;
}
// If record found (or root), go ahead and fill the $menuItems array which will contain data for the elements to render.
if (is_array($this->rec) || $root) {
......
$menuItems['spacer1']='spacer';
// Copy:
if(!in_array('copy',$this->disabledItems) && !$root && !$DBmount) $menuItems['copy']=$this->DB_copycut($table,$uid,'copy');
if (!in_array('copy', $this->disabledItems) && !$root && !$DBmount && !$l10nOverlay) $menuItems['copy'] = $this->DB_copycut($table, $uid, 'copy');
// Cut:
if(!in_array('cut',$this->disabledItems) && !$root && !$DBmount) $menuItems['cut']=$this->DB_copycut($table,$uid,'cut');
if (!in_array('cut', $this->disabledItems) && !$root && !$DBmount && !$l10nOverlay) $menuItems['cut'] = $this->DB_copycut($table, $uid, 'cut');
// Paste:
$elFromAllTables = count($this->clipObj->elFromTable(''));
typo3/class.db_list_extra.inc (working copy)
$cells=array();
$cells['pasteAfter'] = $cells['pasteInto'] = $this->spaceIcon;
//enables to hide the copy, cut and paste icons for localized records - doesn't make much sense to perform these options for them
$isL10nOverlay = $this->localizationView && $table != 'pages_language_overlay' && $row[$TCA[$table]['ctrl']['transOrigPointerField']] != 0;
// Return blank, if disabled:
// Whether a numeric clipboard pad is active or the normal pad we will see different content of the panel:
if ($this->clipObj->current=='normal') { // For the "Normal" pad:
// Show copy/cut icons:
$isSel = (string)$this->clipObj->isSelected($table,$row['uid']);
$cells['copy']='<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],1,($isSel=='copy'),array('returnUrl'=>'')).'\');').'">'.
$cells['copy'] = $isL10nOverlay ? $this->spaceIcon : '<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],1,($isSel=='copy'),array('returnUrl'=>'')).'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy'.($isSel=='copy'?'_h':'').'.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.copy',1).'" alt="" />'.
'</a>';
$cells['cut']='<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],0,($isSel=='cut'),array('returnUrl'=>'')).'\');').'">'.
$cells['cut'] = $isL10nOverlay ? $this->spaceIcon : '<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],0,($isSel=='cut'),array('returnUrl'=>'')).'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_cut'.($isSel=='cut'?'_h':'').'.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.cut',1).'" alt="" />'.
'</a>';
......
}
// Adding the checkbox to the panel:
$cells['select']='<input type="hidden" name="CBH['.$n.']" value="0" /><input type="checkbox" name="CBC['.$n.']" value="1" class="smallCheckboxes"'.$checked.' />';
$cells['select'] = $isL10nOverlay ? $this->spaceIcon : '<input type="hidden" name="CBH['.$n.']" value="0" /><input type="checkbox" name="CBC['.$n.']" value="1" class="smallCheckboxes"'.$checked.' />';
}
// Now, looking for selected elements from the current table:
$elFromTable = $this->clipObj->elFromTable($table);
if (count($elFromTable) && $TCA[$table]['ctrl']['sortby']) { // IF elements are found and they can be individually ordered, then add a "paste after" icon:
$cells['pasteAfter']='<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,-$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'after',$elFromTable)).'">'.
$cells['pasteAfter'] = $isL10nOverlay ? $this->spaceIcon : '<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,-$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'after',$elFromTable)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_pasteAfter',1).'" alt="" />'.
'</a>';
}
(3-3/4)