function LinkitPluginFile::buildDescription in Linkit 7.2
Build the search row description.
If there is a "result_description", run it thro token_replace.
Parameters
object $data: An entity object that will be used in the token_place function.
Overrides LinkitPluginEntity::buildDescription
See also
File
- plugins/
linkit_plugins/ linkit-plugin-file.class.php, line 39 - Define Linkit file plugin class.
Class
- LinkitPluginFile
- @file Define Linkit file plugin class.
Code
function buildDescription($data) {
$description_array = array();
//Get image info.
$imageinfo = image_get_info($data->uri);
if ($this->conf['image_extra_info']['thumbnail']) {
$image = $imageinfo ? theme_image_style(array(
'width' => $imageinfo['width'],
'height' => $imageinfo['height'],
'style_name' => 'linkit_thumb',
'path' => $data->uri,
)) : '';
}
if ($this->conf['image_extra_info']['dimensions'] && !empty($imageinfo)) {
$description_array[] = $imageinfo['width'] . 'x' . $imageinfo['height'] . 'px';
}
$description_array[] = parent::buildDescription($data);
if ($this->conf['show_scheme']) {
$description_array[] = file_uri_scheme($data->uri) . '://';
}
$description = (isset($image) ? $image : '') . implode('<br />', $description_array);
return $description;
}