From 5ff58a8651863e978035b6cb2cc9ba3fe3243e2b Mon Sep 17 00:00:00 2001 From: Paul Barrett Date: Tue, 15 Sep 2009 13:04:02 +0200 Subject: [PATCH] display of thumbnail in Document View page --- templates/ktcore/document/view.smarty | 17 ++++++++++++++--- view.php | 14 +++++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/templates/ktcore/document/view.smarty b/templates/ktcore/document/view.smarty index 120e687..bb79e1b 100644 --- a/templates/ktcore/document/view.smarty +++ b/templates/ktcore/document/view.smarty @@ -35,9 +35,20 @@ these tasks, use the Request Assistance action.{/i18n} {/if} -{foreach item=oFieldset from=$fieldsets} -{$oFieldset->render($document_data)} -{/foreach} +{if $thumbnail eq ''} +
+ {foreach item=oFieldset from=$fieldsets} + {$oFieldset->render($document_data)} + {/foreach} +
+{else} +
+ {foreach item=oFieldset from=$fieldsets} + {$oFieldset->render($document_data)} + {/foreach} +
+
{$thumbnail}
+{/if} {if !empty($viewlet_data)} diff --git a/view.php b/view.php index 89e0573..2c1031c 100644 --- a/view.php +++ b/view.php @@ -210,7 +210,6 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { array_push($fieldsets, new $displayClass($oFieldset)); } - $checkout_user = 'Unknown user'; if ($oDocument->getIsCheckedOut() == 1) { $oCOU = User::get($oDocument->getCheckedOutUserId()); @@ -249,6 +248,18 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $content_class = 'view withviewlets'; } $this->oPage->setContentClass($content_class); + + // check for a thumbnail + $thumbnail = ''; + if (KTPluginUtil::pluginIsActive('thumbnails.generator.processor.plugin')) { + // hook into thumbnail plugin to get display for thumbnail + include_once(KT_DIR . '/plugins/thumbnails/thumbnails.php'); + $thumbnailer = new ThumbnailViewlet(); + $thumbnailDisplay = $thumbnailer->display_viewlet($document_id); + if ($thumbnailDisplay != '') { + $thumbnail = $thumbnailDisplay; + } + } $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate('ktcore/document/view'); @@ -263,6 +274,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { 'document_data' => $document_data, 'fieldsets' => $fieldsets, 'viewlet_data' => $viewlet_data, + 'thumbnail' => $thumbnail, ); //return '
' . print_r($aTemplateData, true) . '
'; return $oTemplate->render($aTemplateData); -- libgit2 0.21.4