00001 <?php
00002
00011 class TKSnapMediaDocumentPreview extends TKSnapPreview {
00019 protected function getTranslators() {
00020 return array(
00021 'Media Document' => 'STransMediaDocument'
00022 );
00023 }
00024
00032 protected function showAdditionalInfo() {
00033 $cm = $this->version->getContentModule();
00034 if(!$cm->isValid())
00035 return null;
00036 $res = $this->version->getResource();
00037
00038 $table = new TKTable();
00039
00040 $table->addTextTo('header', "Media Tag");
00041
00042 $table->addRow();
00043 $table->addText("<tt><media snapid=\"" . $res->getId() . "\" /></tt>");
00044
00045 $table->addRow();
00046 switch($this->version->getStatus()) {
00047 case SnapVersion::STATUS_DEV:
00048 $msg = "<b>NOTE</b>: This document is only visible on the dev site";
00049 break;
00050 case SnapVersion::STATUS_LIVE:
00051 if($res->getDevVersion() == null)
00052 $msg = "<b>NOTE</b>: This document is visible on both the dev and live sites";
00053 else
00054 $msg = "<b>NOTE</b>: This document is only visible on the live site";
00055 break;
00056 default:
00057 $msg = "<b>NOTE</b>: This document is not visible by default on either the dev or live site";
00058 break;
00059 }
00060 $table->addText($msg, array('colspan' => 4));
00061
00062 return $table;
00063 }
00064
00072 protected function getFormattedSource() {
00073 $cm = $this->version->getContentModule();
00074
00075 $table = new TKTable();
00076
00077 $table->addText("<b>Extension</b>");
00078 $table->addText($cm->getDocumentSuffix());
00079 $table->addRow();
00080
00081 $table->addText("<b>Document Type</b>");
00082 $table->addText($cm->getDocumentType());
00083 $table->addRow();
00084
00085 $table->addText("<b>Path</b>");
00086 $table->addText($cm->getPath());
00087 $table->addRow();
00088
00089 $table->addText("<b>URL</b>");
00090 $table->addText($cm->getURL());
00091
00092 return $table->render();
00093 }
00094
00095 }
00096
00097 ?>