00001 <?php
00008 class STransMediaNetLogoApplet extends STrans
00009 {
00014 public function doc() {
00015 return "STransMediaImage translates SNAP2 image resources into "
00016 . "embeddable HTML.";
00017 }
00018
00023 public function getInFormat() {
00024 return 'media_netlogo';
00025 }
00026
00031 public function getOutFormat() {
00032 return 'html';
00033 }
00034
00040 public function translate($si) {
00041 $version = $si->getOption('_version');
00042 $resource = $si->getOption('_resource');
00043
00044 $which = $si->getOption('which');
00045 if($which != "thumb" && $which != "medium" && $which != "display"
00046 && $which != "original")
00047 $which = "original";
00048
00049 $html = $version->getContentModule()->retrieveContent(
00050 $si->getSource(), array('which' => $which));
00051
00052 if($html === false)
00053 $html = "<div style=\"padding: 4px; border: 1px solid black; "
00054 . "background-color: #E0E0E0; width: 8em; text-align: center;\">No Content</div>";
00055
00056 $this->sendToTarget($si, $html);
00057
00058 return true;
00059 }
00060 }
00061
00062 ?>