public function getPreview(ProviderInterface $provider, array $row)
{
$form = $provider->getForm($row);
$options = $this->getPreviewOptions($form);
$mode = $this->getOptionMode($options);
$previewContent = (string) $this->renderPreviewSection($provider, $row, $form);
if (self::MODE_NONE === $mode || FALSE === is_object($form)) {
return $previewContent;
}
$gridContent = $this->renderGrid($provider, $row, $form);
if (self::MODE_APPEND === $mode) {
$previewContent = $previewContent . $gridContent;
} else {
if (self::MODE_PREPEND === $mode) {
$previewContent = $gridContent . $previewContent;
}
}
$previewContent = trim($previewContent);
return $previewContent;
}