Re: [aev] Use only thumbnails for both "Large" and "Small" image inside a wysiwyg field
Hi aev,
I had a look and it turned out it wasn't that hard to add that, so it will be in the next beta. Here's the code if you want to update it yourself:
- Edit: cmsAdmin/lib/menus/default/uploadForm_functions.php
- And replace the _showLinks() function with this code:
//
function _showLinks($row) {
$filename = pathinfo($row['filePath'], PATHINFO_BASENAME);
$isImage = preg_match("/\.(gif|jpg|jpeg|png)$/i", $row['urlPath']);
$hasThumbnail = $isImage && $row['thumbUrlPath'];
// show insert | remove links
$removeUrl = "removeUpload('{$row['num']}', '" .addcslashes(htmlspecialchars($filename), '\\\''). "', this);";
print "<a href='#' onclick=\"insertUpload('" .addcslashes(htmlspecialchars($row['urlPath']), '\\\''). "', $isImage)\">" .t('Insert'). "</a> | ";
print "<a href='#' onclick=\"$removeUrl\">" .t('Delete'). "</a><br/>";
// show insert thumb links
$thumbLinks = '';
foreach (range(1,4) as $num) {
$fieldname = "thumbUrlPath" . (($num == 1) ? '' : $num);
$thumbUrlPath = $row[$fieldname];
if (!$thumbUrlPath) { continue; }
if ($thumbLinks) { $thumbLinks .= " | "; }
$thumbLinks .= " <a href='#' onclick=\"insertUpload('" .addcslashes(htmlspecialchars($thumbUrlPath), '\\\''). "', $isImage)\">$num</a>";
}
if ($thumbLinks) {
print t("Thumb:") . $thumbLinks . "<br/>";
}
// show filename
print "<div style='color: #666; padding-top: 1px'>$filename</div>";
}
Hope that helps! Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com