/** * Renders the data columns * * @param array $item item array * @return array */ function getItemColumns($item) { // Columns rendering $columns = array(); foreach ($this->columnList as $field => $descr) { switch ($field) { case 'page': // Create output item for pages record $pageRow = $item[$field]; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($pageRow, 'pages'); $icon = t3lib_iconWorks::getIconImage('pages', $pageRow, $GLOBALS['BACK_PATH'], 'title="' . $iconAltText . '" align="top"'); if ($this->showRootline) { $title = t3lib_BEfunc::getRecordPath($pageRow['uid'], '1=1', 0); $title = t3lib_div::fixed_lgd_cs($title, -$GLOBALS['BE_USER']->uc['titleLen']); } else { $title = t3lib_BEfunc::getRecordTitle('pages', $pageRow, TRUE); } if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+view,edit,info') . $title; } else { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } } else { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+edit,info') . $title; } else { $columns[$field] = $icon . $title; } } break; case 'content_element': // Create output item for content record $refTable = $item['tablenames']; $refRow = $item[$field]; if ($refTable == 'pages') { // The reference to the media is on a field of a page record if ($GLOBALS['BE_USER']->isInWebMount($refRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($refRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $refRow; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } else { // The reference to the media is on a field of a content element record if ($GLOBALS['BE_USER']->isInWebMount($pageRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $item['page']; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } break; case 'content_field': // Create output item for reference field $columns[$field] = $item[$field]; break; case 'softref_key': // Create output item for reference key $columns[$field] = $item['softref_key'] ? $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_' . $item['softref_key']) : $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_media'); break; case 'content_age': // Create output text describing the age of the content element $columns[$field] = t3lib_BEfunc::dateTimeAge($item[$field], 1); break; case 'media_element': // Create output item for tx_dam record $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink('tx_dam', $item); break; case 'media_element_age': // Create output text describing the tx_dam record age $columns[$field] = t3lib_BEfunc::dateTimeAge($item['tstamp'], 1); break; case '_CLIPBOARD_': $columns[$field] = $this->clipboard_getItemControl($item); break; case '_CONTROL_': $columns[$field] = $this->getItemControl($item); $this->columnTDAttr[$field] = ' nowrap="nowrap"'; break; default: $content = $item[$field]; $columns[$field] = htmlspecialchars(t3lib_div::fixed_lgd_cs($content, $this->titleLength)); break; } if ($columns[$field] === '') { $columns[$field] = ' '; } } // Thumbsnails? if ($this->showThumbs and $this->thumbnailPossible($item)) { $columns['media_element'] .= '<div style="margin:2px 0 2px 0;">' . $this->getThumbNail($item) . '</div>'; } return $columns; }