/** * List media types, along with options to edit & delete * * @return string HTML table of all the mimetypes */ function listMimeTypes() { global $LANG, $BACK_PATH, $BE_USER; // Load template $content = t3lib_parsehtml::getSubpart(t3lib_div::getURL($BACK_PATH . t3lib_extMgm::extRelPath('dam') . 'modfunc_tools_mimetypes/template.html'), '###MOD_TEMPLATE###'); $rowTemplate[1] = t3lib_parsehtml::getSubpart($content, '###ROW_1###'); $rowTemplate[2] = t3lib_parsehtml::getSubpart($content, '###ROW_2###'); // Add some JS $this->pObj->doc->JScode .= $this->pObj->doc->wrapScriptTags(' function deleteRecord(id) { // if (confirm(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')) { window.location.href = "' . $BACK_PATH . 'tce_db.php?cmd[tx_dam_media_types]["+id+"][delete]=1&redirect=' . rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) . '&id=' . tx_dam_db::getPid() . '&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1"; } return false; } '); // Get content $alternate = 1; $rows = ''; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_dam_media_types', '', '', 'ext ASC'); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $editURL = $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')) . '&id=' . tx_dam_db::getPid() . '&edit[tx_dam_media_types][' . $row['uid'] . ']=edit'; //$deleteURL = $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode( t3lib_div::getIndpEnv('TYPO3_REQUEST_URL') ) . '&id=' . tx_dam_db::getPid() . '&edit[tx_dam_media_types][' . $row['uid'] . '][delete]=1'; $rowMarkers['EDIT'] = '<a href="#" onclick="window.location.href=\'' . $editURL . '\'; return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/edit2.gif', 'width="11" height="12"') . ' title="Edit this type" alt="" height="16" width="16"></a>'; $rowMarkers['DELETE'] = '<a href="#" onclick="deleteRecord(' . $row['uid'] . ')"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/deletedok.gif', 'width="11" height="12"') . ' title="Delete this type" alt="" height="16" width="16"></a>'; $rowMarkers['EXTENSION'] = $row['ext']; $rowMarkers['MIME'] = $row['mime']; $rowMarkers['ICON'] = '<img src="' . $BACK_PATH . tx_dam::icon_getFileType(array('file_type' => $row['ext'], 'media_type' => $row['type'])) . '" />'; $rows .= t3lib_parsehtml::substituteMarkerArray($rowTemplate[$alternate], $rowMarkers, '###|###'); // Cycle the alternating rows if ($alternate == 2) { $alternate = 1; } else { $alternate = 2; } } $content = t3lib_parsehtml::substituteSubpart($content, '###ROWS###', $rows); $GLOBALS['TYPO3_DB']->sql_free_result($res); return $content; }
/** * Returns a file or folder icon for a given (file)path as HTML img tag. * * @param array $infoArr info array: eg. $pathInfo = tx_dam::path_getInfo($path) * @param boolean $addAttrib Additional attributes for the image tag.. * @param string $mode TYPO3_MODE to be used: 'FE', 'BE'. Constant TYPO3_MODE is default. * @return string Icon img tag * @see tx_dam::path_getInfo() */ function icon_getFileTypeImgTag($infoArr, $addAttrib = '', $mode = TYPO3_MODE) { global $TYPO3_CONF_VARS, $TCA; static $iconCacheSize = array(); require_once PATH_t3lib . 'class.t3lib_iconworks.php'; if (isset($infoArr['dir_name'])) { $iconfile = tx_dam::icon_getFolder($infoArr); } elseif (isset($infoArr['file_name']) or isset($infoArr['file_type']) or isset($infoArr['media_type'])) { $iconfile = tx_dam::icon_getFileType($infoArr); if ($mode === 'BE') { $tca_temp_typeicons = $TCA['tx_dam']['ctrl']['typeicons']; $tca_temp_iconfile = $TCA['tx_dam']['ctrl']['iconfile']; unset($TCA['tx_dam']['ctrl']['typeicons']); $TCA['tx_dam']['ctrl']['iconfile'] = $iconfile; $iconfile = t3lib_iconWorks::getIcon('tx_dam', $infoArr, $shaded = false); $TCA['tx_dam']['ctrl']['iconfile'] = $tca_temp_iconfile; $TCA['tx_dam']['ctrl']['typeicons'] = $tca_temp_typeicons; } } if (!$iconCacheSize[$iconfile]) { // Get width/height: $iInfo = @getimagesize(t3lib_div::resolveBackPath(PATH_site . TYPO3_mainDir . $iconfile)); $iconCacheSize[$iconfile] = $iInfo[3]; } $icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $iconfile, $iconCacheSize[$iconfile]) . ' class="typo3-icon" alt="" ' . trim($addAttrib) . ' />'; return $icon; }
/** * Render list of files. * * @param array List of files. See t3lib_div::getFilesInDir * @param string $mode EB mode: "db", "file", ... * @return string HTML output */ function renderFileList($files, $mode = 'file') { global $LANG, $BACK_PATH, $BE_USER, $TYPO3_CONF_VARS; $out = ''; // Listing the files: if (is_array($files) and count($files)) { $displayThumbs = $this->displayThumbs(); $displayImage = $this->act === 'dragdrop'; // Traverse the file list: $lines = array(); foreach ($files as $fI) { if (!$fI['__exists']) { continue; } // Create file icon: $titleAttrib = tx_dam_guiFunc::icon_getTitleAttribute($fI); $iconFile = tx_dam::icon_getFileType($fI); $iconTag = tx_dam_guiFunc::icon_getFileTypeImgTag($fI); $iconAndFilename = $iconTag . htmlspecialchars(t3lib_div::fixed_lgd_cs($fI['file_title'], $BE_USER->uc['titleLen'])); // Create links for adding the file: if (strstr($fI['file_name_absolute'], ',') || strstr($fI['file_name_absolute'], '|')) { // In case an invalid character is in the filepath, display error message: $eMsg = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'), ', |')); $ATag_insert = '<a href="#" onclick="alert(' . $eMsg . ');return false;">'; // If filename is OK, just add it: } else { // JS: insertElement(table, uid, type, filename, fpath, filetype, imagefile ,action, close) $onClick_params = implode(', ', array("'" . $fI['_ref_table'] . "'", "'" . $fI['_ref_id'] . "'", "'" . $mode . "'", $this->quoteJSvalue($fI['file_name']), $this->quoteJSvalue($fI['_ref_file_path']), "'" . $fI['file_type'] . "'", "'" . $iconFile . "'")); $onClick = 'return insertElement(' . $onClick_params . ');'; $ATag_add = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $onClick = 'return insertElement(' . $onClick_params . ', \'\', 1);'; $ATag_insert = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; } // Create link to showing details about the file in a window: if ($fI['__exists']) { $Ahref = $BACK_PATH . 'show_item.php?table=' . rawurlencode($fI['file_name_absolute']) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $ATag_info = '<a href="' . htmlspecialchars($Ahref) . '">'; $info = $ATag_info . '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('info', 1) . '" alt="" /> ' . $LANG->getLL('info', 1) . '</a>'; } else { $info = ' '; } // Thumbnail/size generation: $clickThumb = ''; if (t3lib_div::inList($TYPO3_CONF_VARS['GFX']['imagefile_ext'], $fI['file_type']) and $displayThumbs and is_file($fI['file_name_absolute'])) { $clickThumb = t3lib_BEfunc::getThumbNail($BACK_PATH . 'thumbs.php', $fI['file_path_absolute'] . $fI['file_name'], ''); $clickThumb = '<div style="width:56px; overflow:auto; padding: 5px; background-color:#fff; border:solid 1px #ccc;">' . $ATag_insert . $clickThumb . '</a>' . '</div>'; } elseif ($displayThumbs) { $clickThumb = '<div style="width:68px"></div>'; } // Drag & drop image if ($displayImage and t3lib_div::inList($TYPO3_CONF_VARS['GFX']['imagefile_ext'], $fI['file_type']) and is_file($fI['file_name_absolute'])) { if (t3lib_div::_GP('noLimit')) { $maxW = 10000; $maxH = 10000; } else { $maxW = 380; $maxH = 500; } $IW = $fI['hpixels']; $IH = $fI['vpixels']; if ($IW > $maxW) { $IH = ceil($IH / $IW * $maxW); $IW = $maxW; } if ($IH > $maxH) { $IW = ceil($IW / $IH * $maxH); $IH = $maxH; } $clickThumb = '<img src="' . $this->siteUrl . substr($fI['file_name_absolute'], strlen(PATH_site)) . '" width="' . $IW . '" height="' . $IH . '"' . ($this->defaultClass ? ' class="' . $this->defaultClass . '"' : '') . ' alt="' . $fI['alt_text'] . '" title="' . $fI[$this->imgTitleDAMColumn] . '" />'; $clickThumb = '<div style="width:380px; overflow:auto; padding: 5px; background-color:#fff; border:solid 1px #ccc;">' . $clickThumb . '</div>'; } // Show element: $lines[] = ' <tr class="bgColor4"> <td valign="top" nowrap="nowrap" style="min-width:20em">' . ($displayImage ? '' : $ATag_insert) . $iconAndFilename . '</a>' . ' </td> <td valign="top" width="1%">' . ($displayImage ? '' : $ATag_add) . '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' title="' . $LANG->getLL('addToList', 1) . '" alt="" /></a></td> <td valign="top" nowrap="nowrap" width="1%">' . $info . '</td> </tr>'; $infoText = ''; if ($this->getModSettings('extendedInfo')) { $infoText = tx_dam_guiFunc::meta_compileInfoData($fI, 'file_name, file_size:filesize, _dimensions, caption:truncate:50, instructions', 'table'); $infoText = str_replace('<table>', '<table border="0" cellpadding="0" cellspacing="1">', $infoText); $infoText = str_replace('<strong>', '<strong style="font-weight:normal;">', $infoText); $infoText = str_replace('</td><td>', '</td><td class="bgColor-10">', $infoText); } if ($displayThumbs || $displayImage and $infoText) { $lines[] = ' <tr class="bgColor"> <td valign="top" colspan="3"> <table border="0" cellpadding="0" cellspacing="0"><tr> <td valign="top">' . $clickThumb . '</td> <td valign="top" style="padding-left:1em">' . $infoText . '</td></tr> </table> <div style="height:0.5em;"></div> </td> </tr>'; } elseif ($clickThumb or $infoText) { $lines[] = ' <tr class="bgColor"> <td valign="top" colspan="3" style="padding-left:22px"> ' . $clickThumb . $infoText . ' <div style="height:0.5em;"></div> </td> </tr>'; } $lines[] = ' <tr> <td colspan="3"><div style="height:0.5em;"></div></td> </tr>'; } // Wrap all the rows in table tags: $out .= ' <!-- File listing --> <table cellpadding="0" cellspacing="0" id="typo3-fileList"> ' . implode('', $lines) . ' </table>'; } // Return accumulated content for filelisting: return $out; }
/** * Creates a list of uploaded files * * @param array $log: ... * @return string HTML content */ function getUploadedFileList($files) { global $BACK_PATH, $LANG; $content = ''; // init table layout $tableLayout = array('table' => array('<table border="0" cellpadding="1" cellspacing="1" id="typo3-filelist">', '</table>'), 'defRow' => array('tr' => array('<tr>', '</tr>'), 'defCol' => array('<td valign="middle" class="bgColor4">', '</td>'), '990' => array('<td valign="middle" class="bgColor4">', '</td>'), '996' => array('<td valign="middle" class="bgColor5">', '</td>')), '0' => array('tr' => array('<tr class="c-headLine">', '</tr>'), 'defCol' => array('<td valign="middle" class="c-headLine">', '</td>'), '2' => array('<td valign="middle" class="c-headLine" style="width:165px;">', '</td>'))); $table = array(); $tr = 0; // header $td = 0; $table[$tr][$td++] = ' '; $table[$tr][$td++] = ' '; $table[$tr][$td++] = $LANG->getLL('c_file'); $table[$tr][$td++] = $LANG->getLL('c_fileext'); $table[$tr][$td++] = $LANG->getLL('c_tstamp'); $table[$tr][$td++] = $LANG->getLL('c_size'); # $table[$tr][$td++] = $LANG->getLL('c_rw'); $table[$tr][$td++] = ' '; if (is_object($this->ebObj) && !$this->rteMode) { $table[$tr][$td++] = ' '; } $addAllJS = ''; foreach ($files as $item) { $tr++; $row = $item['meta']; $fileIcon = tx_dam::icon_getFileTypeImgTag($row, 'title="' . htmlspecialchars($row['file_type']) . '"'); // Add row to table $td = 0; if ($row['uid']) { #$table[$tr][$td++] = $this->pObj->doc->icons(-1); // Ok; $table[$tr][$td++] = $this->enableBatchProcessing ? '<input type="checkbox" name="process_recs[]" value="' . $row['uid'] . '" />' : ''; $table[$tr][$td++] = $fileIcon; // if upload is called from RTE, allow direct linking by a click on file name if ($this->rteMode && is_object($this->ebObj)) { $row = $this->ebObj->enhanceItemArray($row, $this->ebObj->mode); $onClick = 'return link_folder(' . t3lib_div::quoteJSvalue(t3lib_div::rawUrlEncodeFP(tx_dam::file_relativeSitePath($row['_ref_file_path']))) . ');'; $ATag_insert = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $table[$tr][$td++] = $ATag_insert . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['file_name'], 30)) . '</a>'; } else { $table[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($row['file_name'], 30)); } $table[$tr][$td++] = htmlspecialchars(strtoupper($row['file_type'])); $table[$tr][$td++] = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $row['file_ctime']); $table[$tr][$td++] = htmlspecialchars(t3lib_div::formatSize($row['file_size'])); $table[$tr][$td++] = $this->pObj->btn_editRec_inNewWindow('tx_dam', $item['uid']); if (is_object($this->ebObj)) { if (intval($row['uid']) && !$this->rteMode) { $row = $this->ebObj->enhanceItemArray($row, $this->ebObj->mode); $iconFile = tx_dam::icon_getFileType($row); $titleAttrib = tx_dam_guiFunc::icon_getTitleAttribute($row); // JS: insertElement(table, uid, type, filename, fpath, filetype, imagefile ,action, close) $onClick_params = implode(', ', array("'" . $row['_ref_table'] . "'", "'" . $row['_ref_id'] . "'", "'" . $this->ebObj->mode . "'", t3lib_div::quoteJSvalue($row['file_name']), t3lib_div::quoteJSvalue($row['_ref_file_path']), "'" . $row['file_type'] . "'", "'" . $iconFile . "'")); $onClick = 'return insertElement(' . $onClick_params . ');'; $ATag_add = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $onClick = 'return insertElement(' . $onClick_params . ', \'\', 1);'; $ATag_insert = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $addAllJS .= 'insertElement(' . $onClick_params . '); '; $table[$tr][$td++] = $ATag_add . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' title="' . $LANG->getLL('addToList', 1) . '" alt="" /></a>'; } elseif ($this->rteMode) { continue; } else { $table[$tr][$td++] = ''; } } } else { // failure $table[$tr][$td++] = $this->pObj->doc->icons(2); // warning $table[$tr][$td++] = $fileIcon; $table[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($row['file_name'], 30)); $table[$tr][$td++] = htmlspecialchars(strtoupper($row['file_type'])); $table[$tr][$td++] = ''; $table[$tr][$td++] = ''; $table[$tr][$td++] = htmlspecialchars($this->getErrorMsgFromItem($item)); } } // render table if ($tr) { $code = ''; // folder_link expects a form named ltargetform to look for link settings, so we need this if it's called from RTE if ($this->rteMode) { $code .= '<form action="" name="ltargetform" id="ltargetform"></form>'; } $code .= $this->pObj->doc->table($table, $tableLayout); if ($addAllJS) { $label = $LANG->getLL('eb_addAllToList', true); $titleAttrib = ' title="' . $label . '"'; $onClick = $addAllJS . 'return true;'; $ATag_add = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $addIcon = $ATag_add . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' alt="" />'; $addAllButton = '<div style="margin:1em 0 1em 1em;"><span class="button"' . $titleAttrib . '>' . $ATag_add . $addIcon . $label . '</a></span></div>'; $code = $code . $addAllButton; } } else { $code = false; } return $code; }
/** * Render list of files. * * @param array List of files. See t3lib_div::getFilesInDir * @param string $mode EB mode: "db", "file", ... * @return string HTML output */ function renderFileList($files, $mode = 'file', $act = '') { global $LANG, $BACK_PATH, $TCA, $TYPO3_CONF_VARS; $out = ''; // sorting selector // TODO move to scbase (see tx_dam_list_thumbs too) $allFields = tx_dam_db::getFieldListForUser('tx_dam'); if (is_array($allFields) && count($allFields)) { $fieldsSelItems = array(); foreach ($allFields as $field => $title) { $fL = is_array($TCA['tx_dam']['columns'][$field]) ? preg_replace('#:$#', '', $GLOBALS['LANG']->sL($TCA['tx_dam']['columns'][$field]['label'])) : '[' . $field . ']'; $fieldsSelItems[$field] = t3lib_div::fixed_lgd_cs($fL, 15); } $sortingSelector = '<label>' . $GLOBALS['LANG']->sL('LLL:EXT:dam/lib/locallang.xml:labelSorting', 1) . '</label> '; $sortingSelector .= t3lib_befunc::getFuncMenu($this->addParams, 'SET[txdam_sortField]', $this->damSC->MOD_SETTINGS['txdam_sortField'], $fieldsSelItems); if ($this->damSC->MOD_SETTINGS['txdam_sortRev']) { $params = (array) $this->addParams + array('SET[txdam_sortRev]' => '0'); $href = t3lib_div::linkThisScript($params); $sortingSelector .= '<button name="SET[txdam_sortRev]" type="button" onclick="self.location.href=\'' . htmlspecialchars($href) . '\'">' . '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/pil2up.gif', 'width="12" height="7"') . ' alt="" />' . '</button>'; } else { $params = (array) $this->addParams + array('SET[txdam_sortRev]' => '1'); $href = t3lib_div::linkThisScript($params); $sortingSelector .= '<button name="SET[txdam_sortRev]" type="button" onclick="self.location.href=\'' . htmlspecialchars($href) . '\'">' . '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/pil2down.gif', 'width="12" height="7"') . ' alt="" />' . '</button>'; } $sortingSelector = $this->getFormTag('', 'sortingSelector') . $sortingSelector . '</form>'; } $out .= '<div id="medialistfunctions">'; $out .= $this->getSelectionSelector(); $out .= $this->getFormTag(); $out .= $this->damSC->getSearchBox('simple', false, '', true); $out .= '</form>'; $out .= $sortingSelector; $out .= '</div>'; $out .= $this->doc->spacer(10); $out .= $this->damSC->getResultInfoBar(); $out .= $this->doc->spacer(10); // Listing the files: if (is_array($files) and count($files)) { $displayThumbs = $this->displayThumbs(); $dragdropImage = $mode == 'rte' && ($act == 'dragdrop' || $act == 'media_dragdrop'); $addAllJS = ''; $displayItems = ''; if ($mode == 'rte' && $act == 'media') { if (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'], 'usedamcolumn') && $this->thisConfig['buttons.']['link.'][$act . '.']['properties.']['title.']['useDAMColumn']) { $displayItems = $this->thisConfig['buttons.']['link.'][$act . '.']['properties.']['title.']['useDAMColumn.']['displayItems'] ? $this->thisConfig['buttons.']['link.'][$act . '.']['properties.']['title.']['useDAMColumn.']['displayItems'] : ''; } } // Traverse the file list: $lines = array(); foreach ($files as $fI) { if (!$fI['__exists']) { tx_dam::meta_updateStatus($fI); continue; } // Create file icon: $iconFile = tx_dam::icon_getFileType($fI); $iconTag = tx_dam_guiFunc::icon_getFileTypeImgTag($fI); $iconAndFilename = $iconTag . htmlspecialchars(t3lib_div::fixed_lgd_cs($fI['file_title'], max($GLOBALS['BE_USER']->uc['titleLen'], 120))); // Create links for adding the file: if (strstr($fI['file_name_absolute'], ',') || strstr($fI['file_name_absolute'], '|')) { // In case an invalid character is in the filepath, display error message: $eMsg = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'), ', |')); $ATag_insert = '<a href="#" onclick="alert(' . $eMsg . ');return false;">'; // If filename is OK, just add it: } else { // JS: insertElement(table, uid, type, filename, fpath, filetype, imagefile ,action, close) $onClick_params = implode(', ', array("'" . $fI['_ref_table'] . "'", "'" . $fI['_ref_id'] . "'", "'" . $mode . "'", t3lib_div::quoteJSvalue($fI['file_name']), t3lib_div::quoteJSvalue($fI['_ref_file_path']), "'" . $fI['file_type'] . "'", "'" . $iconFile . "'")); $titleAttrib = tx_dam_guiFunc::icon_getTitleAttribute($fI); if ($mode === 'rte' and $act === 'media') { $onClick = 'return link_folder(\'' . t3lib_div::rawUrlEncodeFP(tx_dam::file_relativeSitePath($fI['_ref_file_path'])) . '\');'; if (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'], 'txdam')) { $onClick = 'browse_links_setAdditionalValue(\'txdam\', \'' . $fI['uid'] . '\');' . $onClick; } if (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'], 'usedamcolumn') && $this->thisConfig['buttons.']['link.'][$act . '.']['properties.']['title.']['useDAMColumn']) { $damTitle = t3lib_div::quoteJSvalue(tx_dam_guiFunc::meta_compileHoverText($fI, $displayItems, ', ')); $onClick = 'if (document.getElementById(\'rtehtmlarea-dam-browse-links-useDAMColumn\') && document.getElementById(\'rtehtmlarea-dam-browse-links-useDAMColumn\').checked) { document.getElementById(\'rtehtmlarea-browse-links-anchor_title\').value = ' . $damTitle . '; }' . $onClick; } $ATag_insert = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; } elseif (!$dragdropImage) { $onClick = 'return insertElement(' . $onClick_params . ');'; $ATag_add = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $addIcon = $ATag_add . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' title="' . $LANG->getLL('addToList', 1) . '" alt="" /></a>'; $onClick = 'return insertElement(' . $onClick_params . ', \'\', 1);'; $ATag_insert = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $addAllJS .= $mode === 'rte' ? '' : 'insertElement(' . $onClick_params . '); '; } } // Create link to showing details about the file in a window: if ($fI['__exists']) { $infoOnClick = 'launchView(\'' . t3lib_div::rawUrlEncodeFP($fI['file_name_absolute']) . '\', \'\'); return false;'; $ATag_info = '<a href="#" onclick="' . htmlspecialchars($infoOnClick) . '">'; $info = $ATag_info . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('info', 1) . '" alt="" /> ' . $LANG->getLL('info', 1) . '</a>'; $info = '<span class="button">' . $info . '</span>'; } else { $info = ' '; } // Thumbnail/size generation: $clickThumb = ''; if ($displayThumbs and is_file($fI['file_name_absolute']) and tx_dam_image::isPreviewPossible($fI)) { $addAttrib = array(); $addAttrib['title'] = tx_dam_guiFunc::meta_compileHoverText($fI); $clickThumb = tx_dam_image::previewImgTag($fI, '', $addAttrib); $clickThumb = '<div class="clickThumb">' . $ATag_insert . $clickThumb . '</a>' . '</div>'; } elseif ($displayThumbs) { $clickThumb = '<div style="width:68px"></div>'; } // Image for drag & drop replaces the thumbnail if ($dragdropImage and t3lib_div::inList($TYPO3_CONF_VARS['GFX']['imagefile_ext'], $fI['file_type']) and is_file($fI['file_name_absolute'])) { if (t3lib_div::_GP('noLimit')) { $maxW = 10000; $maxH = 10000; } else { $maxW = 380; $maxH = 500; } $IW = $fI['hpixels']; $IH = $fI['vpixels']; if ($IW > $maxW) { $IH = ceil($IH / $IW * $maxW); $IW = $maxW; } if ($IH > $maxH) { $IW = ceil($IW / $IH * $maxH); $IH = $maxH; } $clickThumb = '<img src="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . substr($fI['file_name_absolute'], strlen(PATH_site)) . '" width="' . $IW . '" height="' . $IH . '"' . ($this->defaultClass ? ' class="' . $this->defaultClass . '"' : '') . ' alt="' . $fI['alt_text'] . '" title="' . $fI[$this->imgTitleDAMColumn] . '" txdam="' . $fI['uid'] . '" />'; $clickThumb = '<div class="clickThumb2">' . $clickThumb . '</div>'; } // Show element: $lines[] = ' <tr> <td valign="middle" class="bgColor4" nowrap="nowrap" style="min-width:20em">' . ($dragdropImage ? '' : $ATag_insert) . $iconAndFilename . '</a>' . ' </td> <td valign="middle" class="bgColor4" width="1%">' . ($mode == 'rte' ? '' : $addIcon) . '</td> <td valign="middle" nowrap="nowrap" width="1%">' . $info . '</td> </tr>'; $infoText = ''; if ($this->getModSettings('extendedInfo')) { $infoText = tx_dam_guiFunc::meta_compileInfoData($fI, 'file_name, file_size:filesize, _dimensions, caption:truncate:50, instructions', 'table'); $infoText = str_replace('<table>', '<table border="0" cellpadding="0" cellspacing="1">', $infoText); $infoText = str_replace('<strong>', '<strong style="font-weight:normal;">', $infoText); $infoText = str_replace('</td><td>', '</td><td class="bgColor-10">', $infoText); } if ($displayThumbs || $dragdropImage and $infoText) { $lines[] = ' <tr class="bgColor"> <td valign="top" colspan="3"> <table border="0" cellpadding="0" cellspacing="0"><tr> <td valign="top">' . $clickThumb . '</td> <td valign="top" style="padding-left:1em">' . $infoText . '</td></tr> </table> <div style="height:0.5em;"></div> </td> </tr>'; } elseif ($clickThumb or $infoText) { $lines[] = ' <tr class="bgColor"> <td valign="top" colspan="3" style="padding-left:22px"> ' . $clickThumb . $infoText . ' <div style="height:0.5em;"></div> </td> </tr>'; } $lines[] = ' <tr> <td colspan="3"><div style="height:0.5em;"></div></td> </tr>'; } // Wrap all the rows in table tags: $out .= ' <!-- File listing --> <table border="0" cellpadding="1" cellspacing="0" id="typo3-fileList"> ' . implode('', $lines) . ' </table>'; } if ($addAllJS) { $label = $LANG->getLL('eb_addAllToList', true); $titleAttrib = ' title="' . $label . '"'; $onClick = $addAllJS . 'return true;'; $ATag_add = '<a href="#" onclick="' . htmlspecialchars($onClick) . '"' . $titleAttrib . '>'; $addIcon = $ATag_add . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' alt="" />'; $addAllButton = '<div class="addAllButton"><span class="button"' . $titleAttrib . '>' . $ATag_add . $addIcon . $label . '</a></span></div>'; $out = $out . $addAllButton; } $out .= $this->doc->spacer(20); $out .= $this->damSC->getResultInfoBar(); // Return accumulated content for filelisting: return $out; }