1 package net.sourceforge.phpeclipse.tests.parser;
3 /*******************************************************************************
4 * Copyright (c) 2002 www.phpeclipse.de All rights
5 * reserved. This program and the accompanying materials are made available
6 * under the terms of the Common Public License v1.0 which accompanies this
7 * distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html
8 ******************************************************************************/
9 import net.sourceforge.phpdt.core.tests.util.AbstractCompilerTest;
12 * Tests the php parser
14 public class OverlibTestCase extends AbstractCompilerTest {
16 public OverlibTestCase(String name) {
21 * Test the PHP Parser with different PHP snippets
23 public void testPHPParser() {
27 + " This is version 1.11 of class.overlib for php (http://www.php.net) \r\n"
29 + " written 1999, 2000, 2001 Patrick Hess <hess@dland.de>\r\n"
31 + " This software is distributed under GPL.\r\n"
33 + " overLib is from Eric Bosrup (http://www.bosrup.com/web/overlib/)\r\n"
35 + " This class is just a driver/container, so most of this wonderful\r\n"
37 + " work is done by Eric Bosrup! Keep this in mind... \r\n"
41 + "include(\"hello_world\"); \r\n"
45 + " class Overlib {\r\n"
47 + " public $ol_path = \"modules/Forums\";\r\n"
49 + " public $ol_sticky = false;\r\n"
51 + " public $ol_align = 0;\r\n"
53 + " public $ol_valign = 0;\r\n"
55 + " public $ol_fgcolor = \"#fcfcfc\";\r\n"
57 + " public $ol_bgcolor = \"#0080C0\";\r\n"
59 + " public $ol_capcolor = \"#ffffff\";\r\n"
61 + " public $ol_textcolor = \"\";\r\n"
63 + " public $ol_closecolor = \"\";\r\n"
65 + " public $ol_textfont = \"\";\r\n"
67 + " public $ol_captionfont = \"\";\r\n"
69 + " public $ol_closefont = \"\";\r\n"
71 + " public $ol_textsize = 0;\r\n"
73 + " public $ol_captionsize = 0;\r\n"
75 + " public $ol_closesize = 0;\r\n"
77 + " public $ol_height = 0;\r\n"
79 + " public $ol_width = 0;\r\n"
81 + " public $ol_border = 3;\r\n"
83 + " public $ol_offsetx = 0;\r\n"
85 + " public $ol_offsety = 0;\r\n"
87 + " public $ol_fgbackground = \"\";\r\n"
89 + " public $ol_bgbackground = \"\";\r\n"
91 + " public $ol_closetext = \"Close\";\r\n"
93 + " public $ol_close = true;\r\n"
95 + " public $ol_noclosetext = false;\r\n"
97 + " public $ol_autostatus = false;\r\n"
99 + " public $ol_autostatuscap = false;\r\n"
101 + " public $ol_capicon = \"images/forum/question.gif\";\r\n"
103 + " public $ol_snapx = 0;\r\n"
105 + " public $ol_snapy = 0;\r\n"
107 + " public $ol_padxl = 0;\r\n"
109 + " public $ol_padxr = 0;\r\n"
111 + " public $ol_padyt = 0;\r\n"
113 + " public $ol_padyb = 0;\r\n"
115 + " public $ol_fixy = 0;\r\n"
117 + " public $ol_background = \"\";\r\n"
119 + " public $ol_fullhtml = false;\r\n"
121 + " public $ol_timeout = -1;\r\n"
123 + " public $ol_delay = -1;\r\n"
125 + " public $ol_vauto = false;\r\n"
127 + " public $ol_hauto = false;\r\n"
131 + " function overLib($path = \"\") {\r\n"
133 + " if (strlen($path)) $this->ol_path = $path;\r\n"
137 + "<nolink rel=\'stylesheet\' href=<?php echo \"\'$this->ol_path/overlib.css\' \"; ?> \r\n"
139 + " type=\'text/css\'>\r\n"
141 + "<div id=\'overDiv\' style=\'position:absolute; visibility:hide; z-index: 1000;\'>\r\n"
145 + "<script language=\'javascript\' src=<?php echo \"\'$this->ol_path/overlib.js\'\"; ?>>\r\n"
155 + " function set($var, $value) {\r\n"
157 + " $v = \"ol_$var\";\r\n"
159 + " $this->$v = $value;\r\n"
165 + " function get($var) {\r\n"
167 + " $v = \"ol_$var\";\r\n"
169 + " return($this->$v);\r\n"
175 + " function over($text, $title = \"\", $status = \"\")\r\n"
179 + " $cmd = \"\'$text\'\";\r\n"
183 + " if(strlen($title)) \r\n"
185 + " $cmd .= \", CAPTION, \'$title\'\";\r\n"
189 + " if(strlen($status)) \r\n"
191 + " $cmd .= \", STATUS, \'$status\'\";\r\n"
195 + " if($this->ol_sticky) \r\n"
197 + " $cmd .= \", STICKY\";\r\n"
201 + " if($this->ol_align) {\r\n"
203 + " switch($this->ol_align) {\r\n"
205 + " case 1: $cmd .= \", LEFT\"; break;\r\n"
207 + " case 2: $cmd .= \", CENTER\"; break;\r\n"
209 + " case 3: $cmd .= \", RIGHT\"; break;\r\n"
211 + " default: break;\r\n"
219 + " if($this->ol_valign) {\r\n"
221 + " switch($this->ol_valign) {\r\n"
223 + " case 1: $cmd .= \", ABOVE\"; break;\r\n"
225 + " case 2: $cmd .= \", BELOW\"; break;\r\n"
227 + " default: break;\r\n"
235 + " if (strlen($this->ol_fgbackground)) {\r\n"
237 + " $cmd .= \", FGCOLOR, \'\', FGBACKGROUND, \'$this->ol_fgbackground\'\";\r\n"
241 + " if (strlen($this->ol_fgcolor))\r\n"
243 + " $cmd .= \", FGCOLOR, \'$this->ol_fgcolor\'\";\r\n"
249 + " if (strlen($this->ol_bgbackground)) {\r\n"
251 + " $cmd .= \", BGCOLOR, \'\', BGBACKGROUND, \'$this->ol_bgbackground\'\";\r\n"
255 + " if (strlen($this->ol_bgcolor))\r\n"
257 + " $cmd .= \", BGCOLOR, \'$this->ol_bgcolor\'\";\r\n"
263 + " if (strlen($this->ol_capcolor))\r\n"
265 + " $cmd .= \", CAPCOLOR, \'$this->ol_capcolor\'\";\r\n"
269 + " if (strlen($this->ol_textcolor))\r\n"
271 + " $cmd .= \", TEXTCOLOR, \'$this->ol_textcolor\'\";\r\n"
275 + " if (strlen($this->ol_closecolor))\r\n"
277 + " $cmd .= \", CLOSECOLOR, \'$this->ol_closecolor\'\";\r\n"
281 + " if (strlen($this->ol_textfont))\r\n"
283 + " $cmd .= \", TEXTFONT, \'$this->ol_textfont\'\";\r\n"
287 + " if (strlen($this->ol_captionfont))\r\n"
289 + " $cmd .= \", CAPTIONFONT, \'$this->ol_captionfont\'\";\r\n"
293 + " if (strlen($this->ol_closefont))\r\n"
295 + " $cmd .= \", CLOSEFONT, \'$this->ol_closefont\'\";\r\n"
299 + " if ($this->ol_textsize)\r\n"
301 + " $cmd .= \", TEXTSIZE, $this->ol_textsize\";\r\n"
305 + " if ($this->ol_captionsize)\r\n"
307 + " $cmd .= \", CAPTIONSIZE, $this->ol_captionsize\";\r\n"
311 + " if ($this->ol_closesize)\r\n"
313 + " $cmd .= \", CLOSESIZE, $this->ol_closesize\";\r\n"
317 + " if ($this->ol_width)\r\n"
319 + " $cmd .= \", WIDTH, $this->ol_width\";\r\n"
323 + " if ($this->ol_height)\r\n"
325 + " $cmd .= \", HEIGHT, $this->ol_height\";\r\n"
329 + " if ($this->ol_border >= 0)\r\n"
331 + " $cmd .= \", BORDER, $this->ol_border\";\r\n"
335 + " if ($this->ol_offsetx)\r\n"
337 + " $cmd .= \", OFFSETX, $this->ol_offsetx\";\r\n"
341 + " if ($this->ol_offsety)\r\n"
343 + " $cmd .= \", OFFSETY, $this->ol_offsety\";\r\n"
347 + " if (strlen($this->ol_closetext))\r\n"
349 + " $cmd .= \", CLOSETEXT, \'$this->ol_closetext\'\";\r\n"
353 + " if ($this->ol_noclose)\r\n"
355 + " $cmd .= \", NOCLOSETEXT\";\r\n"
359 + " if ($this->ol_autostatus)\r\n"
361 + " $cmd .= \", AUTOSTATUS\";\r\n"
365 + " if ($this->ol_autostatuscap)\r\n"
367 + " $cmd .= \", AUTOSTATUSCAP\";\r\n"
371 + " if (strlen($this->ol_capicon))\r\n"
373 + " $cmd .= \", CAPICON, \'$this->ol_capicon\'\";\r\n"
377 + " if ($this->ol_snapx)\r\n"
379 + " $cmd .= \", SNAPX, $this->ol_snapx\";\r\n"
383 + " if ($this->ol_snapy)\r\n"
385 + " $cmd .= \", SNAPY, $this->ol_snapy\";\r\n"
389 + " if ($this->ol_fixy)\r\n"
391 + " $cmd .= \", FIXY, $this->ol_fixy\";\r\n"
395 + " if ($this->ol_padxl || $this->ol_padxr)\r\n"
397 + " $cmd .= \", PADX, $this->ol_padxl, $this->ol_padxr\";\r\n"
401 + " if ($this->ol_padyt || $this->ol_padyb)\r\n"
403 + " $cmd .= \", PADY, $this->ol_padyt, $this->ol_padyb\";\r\n"
407 + " if (strlen($this->ol_background))\r\n"
409 + " $cmd .= \", BACKGROUND, \'$this->ol_background\'\";\r\n"
413 + " if ($this->ol_fullhtml)\r\n"
415 + " $cmd .= \", FULLHTML\";\r\n"
419 + " if ($this->ol_timeout >= 0)\r\n"
421 + " $cmd .= \", TIMEOUT, $this->ol_timeout\";\r\n"
425 + " if ($this->ol_delay >= 0)\r\n"
427 + " $cmd .= \", DELAY, $this->ol_delay\";\r\n"
431 + " if ($this->ol_hauto) {\r\n"
433 + " $cmd .= \", HAUTO\";\r\n"
435 + " $this->ol_hauto = false;\r\n"
441 + " if ($this->ol_vauto) {\r\n"
443 + " $cmd .= \", VAUTO\";\r\n"
445 + " $this->ol_hauto = false;\r\n"
451 + " $output=\" onMouseOver=\\\"return overlib($cmd);\\\" \";\r\n"
453 + " $output.=\" onMouseOut=\\\"nd();\\\" \";\r\n"
457 + " return ($output);\r\n"
463 + " function pover ($text, $title = \"\", $status = \"\") \r\n"
464 + "\r\n" + " {\r\n" + "\r\n"
465 + " echo $this->over($text, $title, $status);\r\n" + "\r\n"
466 + " }\r\n" + "\r\n" + " }\r\n" + "\r\n" + "?>\r\n" + "\r\n"
467 + "\r\n" + "\r\n" + "\r\n" + "\r\n" + "");