Project

General

Profile

Bug #21061 ยป 0011964_v1.diff

Administrator Admin, 2009-09-15 21:33

View differences:

t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php
$this->manipulateRecord($row);
$this->makeWorkspaceOverlay($row);
// Make sure we only use the uid of the online record, because this is the one editors
// relate to
$uid = $this->getUidOfOnlineVersion($row);
// check if the user has access to the record
if (!$this->checkRecordAccess($row, $row['uid'])) {
if (!$this->checkRecordAccess($row)) {
continue;
}
$iconPath = $this->getIcon($row);
$uid = ($row['t3ver_oid'] > 0 ? $row['t3ver_oid'] : $row['uid']);
$croppedPath = $path = $this->getRecordPath($row, $uid);
$croppedPath = $path = $this->getRecordPath($row);
if (strlen($croppedPath) > 30) {
$croppedPath = $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, 10) .
'...' . $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $path, -20);
......
}
/**
* Selects whether the logged in Backend User is allowed to read a specific record
* Checks whether the logged in Backend User is allowed to read a specific record
*
* @param array $record The record to check access to
*/
protected function checkRecordAccess($row, $uid) {
protected function checkRecordAccess($record) {
$uid = $this->getUidOfOnlineVersion($record);
$retValue = true;
$table = ($this->mmForeignTable ? $this->mmForeignTable : $this->table);
if ($table == 'pages') {
......
$retValue = false;
}
} else {
if (!is_array(t3lib_BEfunc::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) {
if (!is_array(t3lib_BEfunc::readPageAccess($record['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) {
$retValue = false;
}
}
......
*
* The path is returned uncut, cutting has to be done by calling function.
*
* @param array $row The row
* @param integer $uid The records uid
* @param array $record The record
* @return string The record-path
*/
protected function getRecordPath(&$row, $uid) {
protected function getRecordPath(&$row) {
$titleLimit = max($this->config['maxPathTitleLength'], 0);
$uid = $this->getUidOfOnlineVersion($row);
if (($this->mmForeignTable ? $this->mmForeignTable : $this->table) == 'pages') {
$path = t3lib_BEfunc::getRecordPath($uid, '', $titleLimit);
......
return $entry;
}
/**
* Returns the uid of a record in workspace 0 (= live workspace).
*
* @param array $record The record to check
* @return integer The uid of the online version
*/
protected function getUidOfOnlineVersion($record) {
// if the record is in a draft workspace, it has pid set to -1. The uid of the online record
// is preserved in the field t3ver_oid to make it easier to switch the records later on.
if ($record['pid'] == -1) {
return $record['t3ver_oid'];
} else {
return $record['uid'];
}
}
}
    (1-1/1)