/**
  * Adding CM element for Delete
  *
  * @param	string	$table	Table name
  * @param	integer	$uid	UID for the current record.
  * @param	array	$elInfo	Label for including in the confirmation message, EXT:lang/locallang_core.php:mess.delete
  * @return	array		Item array, element in $menuItems
  * @internal
  */
 function DB_delete($table, $uid, $elInfo)
 {
     $loc = 'top.content.list_frame';
     if ($this->beUser->jsConfirmation(4)) {
         $conf = "confirm(" . GeneralUtility::quoteJSvalue(sprintf($this->LANG->sL('LLL:EXT:lang/locallang_core.php:mess.delete'), $elInfo[0]) . BackendUtility::referenceCount($table, $uid, ' (There are %s reference(s) to this record!)')) . ")";
     } else {
         $conf = '1==1';
     }
     $editOnClick = 'if(' . $loc . " && " . $conf . " ){" . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(" . $this->backRef->frameLocation($loc . '.document') . ")+'" . "&cmd[" . $table . '][' . $uid . '][DDdelete]=1&prErr=1&vC=' . $this->beUser->veriCode() . BackendUtility::getUrlToken('tceAction') . "';hideCM();}";
     return $this->backRef->linkItem($this->LANG->getLLL('delete', $this->LL), $this->backRef->excludeIcon(IconUtility::getSpriteIcon('actions-edit-delete')), $editOnClick . 'return false;');
 }
示例#2
0
 /**
  * Displays the overwrite option
  *
  * @param string $table Table that is to be host of the overwrite
  * @param int $uid Uid of the item that is to be overwritten
  * @param array $elInfo Info Array
  *
  * @return string
  */
 public function DB_overwrite($table, $uid, array $elInfo)
 {
     $language = $this->getLanguageService();
     $backendUser = $this->getBackendUser();
     $loc = 'top.content' . ($this->clickMenu->listFrame && !$this->clickMenu->alwaysContentFrame ? '.list_frame' : '');
     if ($backendUser->jsConfirmation(2)) {
         $conf = $loc . ' && confirm(' . $language->JScharCode(sprintf($language->sL('LLL:EXT:commerce/Resources/Private/Language/locallang_treelib.xml:clickmenu.overwriteConfirm'), $elInfo[0], $elInfo[1])) . ')';
     } else {
         $conf = $loc;
     }
     $editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $this->overwriteUrl($table, $uid, 0) . '&redirect=\'+top.rawurlencode(' . $this->clickMenu->frameLocation($loc . '.document') . '); hideCM();}';
     return $this->clickMenu->linkItem($language->makeEntities($language->sL('LLL:EXT:commerce/Resources/Private/Language/locallang_treelib.xml:clickmenu.overwrite', 1)), $this->clickMenu->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-paste-into')), $editOnClick . 'return false;');
 }