Project

General

Profile

Feature #18505 ยป patch-tsconfigbuttons.patch

Administrator Admin, 2008-03-27 20:56

View differences:

typo3/class.db_list_extra.inc (working copy)
$permsEdit = ($table=='pages' && ($localCalcPerms&2)) || ($table!='pages' && ($this->calcPerms&16));
// "Show" link (only pages and tt_content elements)
if ($table=='pages' || $table=='tt_content') {
if (($table=='pages' || $table=='tt_content') && $this->checkControl('view', $table)) {
$params='&edit['.$table.']['.$row['uid'].']=edit';
$cells['view']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($table=='tt_content'?$this->id.'#'.$row['uid']:$row['uid'], $this->backPath)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'" alt="" />'.
......
}
// "Edit" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id)
if ($permsEdit) {
if ($permsEdit && $this->checkControl('edit', $table)) {
$params='&edit['.$table.']['.$row['uid'].']=edit';
$cells['edit']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2'.(!$TCA[$table]['ctrl']['readOnly']?'':'_d').'.gif','width="11" height="12"').' title="'.$LANG->getLL('edit',1).'" alt="" />'.
......
}
// "Move" wizard link for pages/tt_content elements:
if (($table=="tt_content" && $permsEdit) || ($table=='pages')) {
if ((($table=="tt_content" && $permsEdit) || ($table=='pages')) && $this->checkControl('move', $table)) {
$cells['move']='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'move_el.php?table='.$table.'&uid='.$row['uid'].'\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/move_'.($table=='tt_content'?'record':'page').'.gif','width="11" height="12"').' title="'.$LANG->getLL('move_'.($table=='tt_content'?'record':'page'),1).'" alt="" />'.
'</a>';
......
// If the extended control panel is enabled OR if we are seeing a single table:
if ($SOBE->MOD_SETTINGS['bigControlPanel'] || $this->table) {
// "Info": (All records)
$cells['viewBig']='<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$row['uid'].'\'); return false;').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' title="'.$LANG->getLL('showInfo',1).'" alt="" />'.
'</a>';
// "Info": (All records)
if ($this->checkControl('info', $table)) {
$cells['viewBig']='<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$row['uid'].'\'); return false;').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' title="'.$LANG->getLL('showInfo',1).'" alt="" />'.
'</a>';
}
// If the table is NOT a read-only table, then show these links:
if (!$TCA[$table]['ctrl']['readOnly']) {
// "Revert" link (history/undo)
$cells['history']='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$row['uid']).'\',\'#latest\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/history2.gif','width="13" height="12"').' title="'.$LANG->getLL('history',1).'" alt="" />'.
'</a>';
if ($this->checkControl('history', $table)) {
$cells['history']='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$row['uid']).'\',\'#latest\');').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/history2.gif','width="13" height="12"').' title="'.$LANG->getLL('history',1).'" alt="" />'.
'</a>';
}
// Versioning:
if (t3lib_extMgm::isLoaded('version')) {
if (t3lib_extMgm::isLoaded('version') && $this->checkControl('versioning', $table)) {
$vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace);
if (is_array($vers)) { // If table can be versionized.
if (count($vers)>1) {
......
}
// "Edit Perms" link:
if ($table=='pages' && $GLOBALS['BE_USER']->check('modules','web_perm')) {
if ($table=='pages' && $GLOBALS['BE_USER']->check('modules','web_perm') && $this->checkControl('permission', $table)) {
$cells['perms']='<a href="'.htmlspecialchars('mod/web/perm/index.php?id='.$row['uid'].'&return_id='.$row['uid'].'&edit=1').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/perm.gif','width="7" height="12"').' title="'.$LANG->getLL('permissions',1).'" alt="" />'.
'</a>';
}
// "New record after" link (ONLY if the records in the table are sorted by a "sortby"-row or if default values can depend on previous record):
if ($TCA[$table]['ctrl']['sortby'] || $TCA[$table]['ctrl']['useColumnsForDefaultValues']) {
if (($TCA[$table]['ctrl']['sortby'] || $TCA[$table]['ctrl']['useColumnsForDefaultValues']) && $this->checkControl('newafter', $table)) {
if (
($table!='pages' && ($this->calcPerms&16)) || // For NON-pages, must have permission to edit content on this parent page
($table=='pages' && ($this->calcPerms&8)) // For pages, must have permission to create new pages here.
......
}
// "Up/Down" links
if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels && $this->checkControl('sort', $table)) {
if (isset($this->currentTable['prev'][$row['uid']])) { // Up
$params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['prev'][$row['uid']];
$cells['moveUp']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
......
// "Hide/Unhide" links:
$hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled'];
if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields',$table.':'.$hiddenField))) {
if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields',$table.':'.$hiddenField)) && $this->checkControl('hide', $table)) {
if ($row[$hiddenField]) {
$params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=0';
$cells['hide']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
......
}
// "Delete" link:
if (
($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16))
) {
if (($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16)) && $this->checkControl('delete', $table)) {
$params='&cmd['.$table.']['.$row['uid'].'][delete]=1';
$cells['delete']='<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;').'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('delete',1).'" alt="" />'.
......
}
// "Levels" links: Moving pages into new levels...
if ($permsEdit && $table=='pages' && !$this->searchLevels) {
if ($permsEdit && $table=='pages' && !$this->searchLevels && $this->checkControl('movelevel', $table)) {
// Up (Paste as the page right after the current parent page)
if ($this->calcPerms&8) {
......
<!-- CONTROL PANEL: '.$table.':'.$row['uid'].' -->
<div class="typo3-DBctrl">'.implode('',$cells).'</div>';
}
/**
* Check TsConfig it a specific icon should be displayed or not
*
* @param string The name of the field in the TsConfig to hide it
* @param string The current Table
* @return boolean Should the icon be displayed
*/
function checkControl($field, $table) {
$tmpTSc = t3lib_BEfunc::getModTSconfig($this->id,'mod.web_list');
$tmpTSc = $tmpTSc['properties'];
if (t3lib_div::inList($tmpTSc['hideIcon'], $field) || t3lib_div::inList($tmpTSc['hideIcon.'][$table], $field)) {
return false;
}
return true;
}
/**
* Creates the clipboard panel for a single record in the listing.
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
}
?>
?>
    (1-1/1)