@@ -19,26 +19,12 @@ function Example($name, $cat, $sub)
1919 $ this ->name = $ name ;
2020 $ this ->cat = $ cat ;
2121 $ this ->sub = $ sub ;
22-
23- #$this->file = file_get_contents(CONTENTDIR.'examples/'.$cat.'/'.$name.'/'.$name.'.pde');
24-
25- # use the .pde from the applet folder
26- #$applet_dir = CONTENTDIR . 'examples/' . $cat . '/' . $name . '/applet/';
2722
2823 $ pde_dir = EXAMPLESOURCEDIR . $ cat . '/ ' . $ name . '/ ' ;
29- #$applet_dir = $pde_dir . '/applet/';
3024
3125 $ this ->data_dir = $ pde_dir . 'data/ ' ;
3226
33- $ this ->file = file_get_contents ($ pde_dir . $ name .'.pde ' );
34- #$this->applet = $applet_dir . $name . '.jar';
35-
36- # $this->file = file_get_contents(CONTENTDIR . 'examples/' . $cat . '/' .
37- # $name . '/applet/' . $name.'.pde');
38- # $this->applet = (CONTENTDIR . 'examples/' . $cat . '/' .
39- # $name . '/applet/' . $name . '.jar';
40-
41- # if ($handle = opendir(CONTENTDIR.'examples/'.$cat.'/'.$name)) {
27+ $ this ->file = file_get_contents ($ pde_dir . $ name .'.pde ' );
4228
4329 if ($ handle = opendir ($ pde_dir )) {
4430 while (false !== ($ newfile = readdir ($ handle ))) {
@@ -135,50 +121,6 @@ function display()
135121 $ html .= '</script><canvas width="640" height="360"></canvas> ' ;
136122
137123
138- #if (file_exists($this->applet)) {
139- #$html .= "\n<div class=\"applet\">\n\t";
140-
141- # for newer browsers, use the deployment script
142- # which will let us use loading.gif instead of the coffee cup
143- #$html .= '<script type="text/javascript" src="http://www.java.com/js/deployJava.js"></script>';
144- #$html .= '<script type="text/javascript">' . "\n";
145- #$html .= '/* <![CDATA[ */' . "\n";
146- #$html .= "var attributes = {\n";
147- #$html .= " code: '" . $this->name . ".class',\n";
148- #$html .= " archive: 'media/" . $this->name . ".jar,media/core.jar',\n";
149- #$html .= " width: '" . $this->width . "',\n";
150- #$html .= " height: '" . $this->height . "',\n";
151- #$html .= "};\n";
152- #$html .= "var parameters = {\n";
153- #$html .= " image: 'media/loading.gif',\n";
154- #$html .= " centerimage: 'true'\n";
155- #$html .= "};\n";
156- #$html .= "deployJava.runApplet(attributes, parameters, '1.5');\n";
157- #$html .= "/* ]]> */\n";
158- #$html .= "</script>\n\n";
159-
160- # fallback for the oldschool folks
161- #$html .= "<noscript>\n";
162- # $html .= '<applet code="' . $this->name . '"' .
163- # ' archive="media/' . $this->name.'.jar,media/core.jar"' .
164- # ' width="' . $this->width.'"' .
165- # ' height="' . $this->height.'"' .
166- # '></applet>';
167- # $html .= "\n";
168- #$html .= "</noscript>\n";
169- #$html .= "</div>\n";
170- #
171- # if ($this->width > 200) {
172- # $html .= "\n<p class=\"doc\">";
173- #
174- # } else {
175- # $html .= "\n<p class=\"doc-float\">";
176- # }
177- #
178- #} else {
179- # $html .= "\n<p class=\"doc\">";
180- #}
181-
182124 $ html .= "\n<p class= \"doc \"> " ;
183125 $ html .= nl2br ($ this ->doc );
184126 #$html .= $this->doc;
@@ -194,7 +136,7 @@ function display()
194136
195137 function output_file (&$ menu_array , $ rel_path = '/ ' )
196138 {
197- $ page = new Page ($ this ->name . ' \ Learning ' , $ this ->sub , "" , "../ ../ " );
139+ $ page = new Page ($ this ->name . ' \ Examples ' , $ this ->sub , "" , "../ " );
198140 $ page ->subtemplate ('template.example.html ' );
199141 $ page ->content ($ this ->display ());
200142 $ page ->set ('examples_nav ' , $ this ->back_to_list ());
@@ -266,28 +208,9 @@ function make_nav(&$array, $rel_path = '/') {
266208
267209 function copy_media ()
268210 {
269- /**
270- if (file_exists($this->applet)) {
271- make_necessary_directories(EXAMPLESDIR.strtolower($this->sub).'/media/include');
272- if (!copy($this->applet, EXAMPLESDIR.strtolower($this->sub).'/media/'.$this->name.'.jar')) {
273- echo "Could not copy {$this->applet} to . <br/>";
274- }
275- #echo EXAMPLESDIR.strtolower($this->sub).'/media/'.$this->name.'.jar';
276- #} else {
277- #echo " | ";
278- }
279- */
280- /**
281- if (file_exists($this->applet)) {
282- #make_necessary_directories(EXAMPLESDIR.strtolower($this->sub).'/media/include');
283- if (!copy($this->applet, EXAMPLESDIR.strtolower($this->sub).'/media/'.$this->name.'.jar')) {
284- echo "Could not copy {$this->applet} to . <br/>";
285- }
286- }
287- */
288211 if (file_exists ($ this ->data_dir )) {
289- if (!copydirr ($ this ->data_dir , EXAMPLESDIR .strtolower ( $ this -> sub ). '/ ' )) {
290- echo "Could not copy " . EXAMPLESDIR .strtolower ( $ this -> sub ). '/ ' . "<br /> " ;
212+ if (!copydirr ($ this ->data_dir , EXAMPLESDIR .'/ ' )) {
213+ echo "Could not copy " . EXAMPLESDIR .'/ ' . "<br /> " ;
291214 }
292215 } else {
293216 //echo "No data here: " . $this->data_dir . "<br />";
0 commit comments