1<?php
2/**
3 *  Panorama-Picture Plugin
4 *
5 *  @license    GPL 2 ( http://www.gnu.org/licenses/gpl.html )
6 *  @author     jaloma.ac [at] googlemail [dot] com
7 *
8 *  Description:
9 *  Helper-Modul to Render Panorama-Applet/Flashplayer
10 *
11 */
12
13
14
15class render_helper
16{
17    function _render_java($data)
18    {
19        global $conf;
20        $width = $data['width'];
21        $height = $data['height'];
22        $name = $data['name'];
23        $archive = "panostudioviewer.jar";
24        $code = "panoStudioViewer.PanoStudioViewer.class";
25        $archive = DOKU_BASE.'lib/exe/fetch.php?media='.$archive;
26        $bname = $name;
27        $name = DOKU_BASE.$conf['savedir'].'/media/'.str_replace(":", "/", $name);
28        $txt = "";
29        $txt .= '<applet code="'.$code.'"'.
30        ' width="'.$width.'"'.
31        ' height="'.$height.'"'.
32        ' archive="'.$archive.'"'.
33        ' name="'.$bname.'">'.
34        '<param name="pano" value="'.$name.'.xml"/>'.
35        '</applet>';
36        return $txt;
37    }
38    function _render_swf($data)
39    {
40        global $conf;
41        $archive = "panostudioviewer.swf";
42        //$archive = DOKU_BASE.'lib/exe/fetch.php?media='.$archive;
43        $archive = DOKU_BASE.$conf['savedir'].'/media/'.$archive;
44        $width = $data['width'];
45        $height = $data['height'];
46        $name = $data['name'];
47        $bname = $name;
48        $name = DOKU_BASE.$conf['savedir'].'/media/'.str_replace(":", "/", $name);
49        $flashVars = 'pano='.$name.'.xml';
50        $txt = "";
51        $withObject = true;
52        if ($withObject)
53        {
54            $txt .= '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"';
55            $txt .= ' width="'.$width.'"';
56            $txt .= ' height="'.$height.'"';
57            $txt .= ' id="'.$bname.'"';
58            $txt .= ' codebase="http://active.macromedia.com/flash9/cabs/swflash.cab#version=9,0,28,0">';
59            $txt .= ' <param name="movie" value="'.$archive.'" />';
60            $txt .= ' <param name="allowScriptAccess" value="always" />';
61            $txt .= ' <param name="allowNetworking" value="all" />';
62            $txt .= ' <param name="allowFullScreen" value="'.$allowFullScreen.'" />';
63            $txt .= ' <param name="FlashVars" value="'.$flashVars.'" />';
64        }
65        $txt .= '<embed src="'.$archive.'" ';
66        $txt .= ' type="application/x-shockwave-flash" ';
67        $txt .= ' width="'.$width.'" ';
68        $txt .= ' height="'.$height.'" ';
69        $txt .= ' allowFullScreen="'.$allowFullScreen.'" ';
70        $txt .= ' bgcolor="'.$bgColor.'"';
71        $txt .= ' allowScriptAccess="always"';
72        $txt .= ' allowNetworking="all"';
73        $txt .= ' allowFullScreen="true"';
74        $txt .= ' name="'.$bname.'"';
75//        $txt .= ' seamlesstabbing="false"';
76        $txt .= ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
77        $txt .= ' flashVars="'.$flashVars.'"';
78        $txt .= '>';
79        $txt .= '</embed>';
80        if ($withObject)
81        {
82            $txt .= '</object>';
83        }
84        return $txt;
85    }
86	/*<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"
87width="600" height="400" id="pano"
88codebase="http://active.macromedia.com/flash9/cabs/swflash.cab#version=9,0,28,0">
89<param name="movie" value="panoStudioViewer.swf" />
90<param name="allowScriptAccess" value="always" />
91<param name="allowNetworking" value="all" />
92<param name="allowFullScreen" value="true" />
93<param name="FlashVars" value="pano=panorama_1.xml" />
94<embed src="panoStudioViewer.swf" width="600" height="400"
95type="application/x-shockwave-flash" name="pano"
96allowScriptAccess="always" allowNetworking="all" allowFullScreen="true"
97FlashVars="pano=panorama_1.xml"
98pluginspage="http://www.macromedia.com/go/getflashplayer" >
99</embed>
100</object>
101*/
102}
103