/** * Rendering the delete file form for a multiple items * * @return string HTML content */ function renderFormMulti($items) { global $BACK_PATH, $LANG, $TCA; $content = ''; $references = 0; // gk added for marker replacement fix // FOLDER_INFO is missing due to missing param in current function $this->pObj->markers['FOLDER_INFO'] = ''; $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/deletedok.gif') . ' title="' . $LANG->getLL('tx_dam_cmd_filedelete.submit', 1) . '" height="16" type="image" width="16">'; $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>'; $titleNotExists = 'title="' . $GLOBALS['LANG']->getLL('fileNotExists', true) . '"'; $iconNotExists = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' ' . $titleNotExists . ' valign="top" alt="" />'; $referencedIcon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/is_referenced.gif', 'width="15" height="12"') . ' title="' . $LANG->getLL('tx_dam_cmd_filedelete.messageReferencesUsed', 1) . '" alt="" />'; // init table layout $tableLayout = array('table' => array('<table cellpadding="2" cellspacing="1" border="0" width="100%">', '</table>'), '0' => array('defCol' => array('<th nowrap="nowrap" class="bgColor5">', '</th>'), '0' => array('<th width="1%" class="bgColor5">', '</th>'), '1' => array('<th width="1%" class="bgColor5">', '</th>'), '3' => array('<th width="1%" class="bgColor5">', '</th>'), '4' => array('<th width="1%" class="bgColor5">', '</th>'), '5' => array('<th width="1%" class="bgColor5">', '</th>')), 'defRow' => array('defCol' => array('<td nowrap="nowrap" class="bgColor4">', '</td>'), '2' => array('<td class="bgColor4">', '</td>'), '3' => array('<td style="text-align:center" class="bgColor4">', '</td>'), '4' => array('<td style="padding:0 5px 0 5px" class="bgColor4">', '</td>'), '5' => array('<td style="text-align:center" class="bgColor4">', '</td>'))); $cTable = array(); $tr = 0; $td = 0; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['title']['label'], 1); $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = ' '; $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['file_path']['label'], 1); $tr++; foreach ($items as $id => $meta) { $filepath = tx_dam::file_absolutePath($meta); if ($meta['file_accessable']) { $checkbox = '<input type="checkbox" name="data[delete][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" checked="checked" />'; } else { $checkbox = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' title="' . $LANG->getLL('accessDenied', true) . '" alt="" />'; } $title = $meta['title'] ? $meta['title'] : $meta['file_name']; $title = t3lib_div::fixed_lgd_cs($title, 50); $icon = tx_dam_guiFunc::icon_getFileTypeImgTag($meta, 'class="c-recicon"', false); if (!@file_exists($filepath)) { $icon .= $iconNotExists; $info = ''; } else { $info = $GLOBALS['SOBE']->btn_infoFile($meta); } if ($meta['uid'] and $ref = tx_dam_db::getMediaUsageReferences($meta['uid'])) { $references += count($ref); } // Add row to table $td = 0; $cTable[$tr][$td++] = $checkbox; $cTable[$tr][$td++] = $icon; $cTable[$tr][$td++] = htmlspecialchars($title); $cTable[$tr][$td++] = htmlspecialchars(strtoupper($meta['file_type'])); $cTable[$tr][$td++] = $ref ? $referencedIcon : ''; $cTable[$tr][$td++] = $info; $cTable[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($meta['file_path'], -15)); $tr++; } $itemTable = $this->pObj->doc->table($cTable, $tableLayout); $msg = array(); if ($references) { $msg[] = ' '; $msg[] = '<strong><span class="typo3-red">' . $LANG->getLL('labelWarning', 1) . '</span> ' . $LANG->getLL('tx_dam_cmd_filedelete.messageReferencesUsed', 1) . '</strong>'; $msg[] = $LANG->getLL('tx_dam_cmd_filedelete.messageReferencesDelete', 1); } $msg[] = ' '; $msg[] = $LANG->getLL('tx_dam_cmd_filedelete.message', 1); $buttons = ' <input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filedelete.submit', 1) . '" /> <input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />'; $msg[] = ' '; $msg[] = $itemTable; $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1); return $content; }
/** * Render a table with referenced records * * @param mixed $uidList List of media uid's to get the references for * @param string $displayColumns list of elements to display in the table. Available: page, content_element, content_age, media_element, media_element_age * @return string Rendered Table */ function getReferencesTable($uidList, $displayColumns = 'page,content_element,content_field,softref_key') { // File references $itemOut = ''; //$itemOut .= '<h4>' . $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:fileReference') . '</h4>'; $rows = tx_dam_db::getMediaUsageReferences($uidList); if ($rows) { $itemOut .= tx_dam_guiFunc::renderReferencesTable($rows, $displayColumns); } else { $itemOut .= $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:fileNotUsed'); } return $itemOut; }