Project

General

Profile

Feature #17425 ยป class.db_list_extra_garbage_icon.diff

Administrator Admin, 2007-06-29 10:18

View differences:

class.db_list_extra.inc 2007-06-29 10:35:25.000000000 +0300
}
/**
* Function used to look for configuration of buttons in the form: Fx. disabling buttons or showing them at various positions.
*
* @param string The table for which the configuration may be specific
* @param string The option for look for. Default is checking if the saveDocNew button should be displayed.
* @return string Return value fetched from USER TSconfig
*/
function getNewIconMode($table,$key='saveDocNew') {
global $BE_USER;
$TSconfig = $BE_USER->getTSConfig('options.'.$key);
$output = trim(isset($TSconfig['properties'][$table]) ? $TSconfig['properties'][$table] : $TSconfig['value']);
return $output;
}
/**
* Rendering the header row for a table
*
* @param string Table name
......
'</a>';
// The "Delete marked" link:
$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('clip_deleteMarked',1).'" alt="" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));
if (!$this->getNewIconMode($table, 'disableDelete')) {
$cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('clip_deleteMarked',1).'" alt="" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));
}
// The "Select all" link:
$cells[]='<a href="#" onclick="'.htmlspecialchars('checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;').'">'.
......
// "Delete" link:
if (
($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16))
($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16)) &&
!$this->getNewIconMode($table, 'disableDelete')
) {
$params='&cmd['.$table.']['.$row['uid'].'][delete]=1';
$cells[]='<a href="#" onclick="'.htmlspecialchars('if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning').t3lib_BEfunc::referenceCount($table,$row['uid'],' (There are %s reference(s) to this record!)')).')) {jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');} return false;').'">'.
    (1-1/1)