<?php
// available params
// $params['iconUrl']
// $params['fileArr']

// setup valid image extensions
$ext = array('jpg', 'jpeg', 'png', 'gif');

// load plugin details
$pluginDetails = pluginHelper::pluginSpecificConfiguration('imageviewer');
$pluginConfig  = $pluginDetails['config'];

// check this is an image
if (in_array(strtolower($params['fileArr']['extension']), $ext))
{
    // only for active files
    if($params['fileArr']['statusId'] == 1)
    {
        $params['iconUrl'] = PLUGIN_WEB_ROOT.'/imageviewer/site/resize_image.php?f='.($params['fileArr']['id']).'&w=99&h=60&m=middle';
    }
}
