Commit 5496ee63 authored by Nigel McNie's avatar Nigel McNie
Browse files

Made the thumb.php script serve thumbs of the view layouts, and added an...

Made the thumb.php script serve thumbs of the view layouts, and added an example image that shows the naming scheme.
parent b0f26636
......@@ -10,7 +10,7 @@
{foreach from=$options key=id item=description}
<div class="fl" style="margin: 0 .5em; text-align: center;">
<div><img src="/thumb.php?type=blocktype&bt=test" alt=""></div>
<div><img src="/thumb.php?type=viewlayout&vl={$id}" alt=""></div>
<div><input type="radio" class="radio" name="layout" value="{$id}"></div>
<div>{$description|escape}</div>
</div>
......
......@@ -90,6 +90,15 @@ switch ($type) {
}
readfile(theme_get_path('images/no_thumbnail.png'));
break;
case 'viewlayout':
header('Content-type: image/png');
$vl = param_integer('vl');
if ($widths = get_field('view_layout', 'widths', 'id', $vl)) {
$path = theme_get_path('images/vl-' . str_replace(',', '-', $widths) . '.png');
readfile($path);
}
readfile(theme_get_path('images/no_thumbnail.png'));
break;
}
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment