Index: trunk/wap/hawhaw/hawhaw.inc |
— | — | @@ -2,8 +2,8 @@ |
3 | 3 | |
4 | 4 | // HAWHAW: HTML and WML hybrid adapted webserver |
5 | 5 | // PHP class library |
6 | | -// Copyright (C) 2008 Norbert Huffschmid |
7 | | -// Last modified: 24. June 2008 |
| 6 | +// Copyright (C) 2009 Norbert Huffschmid |
| 7 | +// Last modified: 6. December 2010 |
8 | 8 | // |
9 | 9 | // This library is free software; you can redistribute it and/or modify it under the |
10 | 10 | // terms of the GNU Library General Public License as published by the Free Software |
— | — | @@ -20,12 +20,6 @@ |
21 | 21 | // |
22 | 22 | // For further information about this library and its license terms please visit: |
23 | 23 | // http://www.hawhaw.de/ |
24 | | -// |
25 | | -// changes against V5.19: |
26 | | -// - added support of Amazon Kindle device |
27 | | -// - disabling of simulator supported |
28 | | -// - improved detection of desktop browsers |
29 | | -// - improved W3C mobileOK compliance |
30 | 24 | |
31 | 25 | ################################### |
32 | 26 | # BEGIN OF CONFIGURATION PART # |
— | — | @@ -46,7 +40,7 @@ |
47 | 41 | ################################### |
48 | 42 | |
49 | 43 | // miscellaneous constants |
50 | | -define("HAW_HAW_VERSION", "HAWHAW V5.20B"); |
| 44 | +define("HAW_HAW_VERSION", "HAWHAW V5.25"); |
51 | 45 | define("HAW_COPYRIGHT", "(C) Norbert Huffschmid"); |
52 | 46 | if (defined("HAW_TERA_WURFL_PATH")) |
53 | 47 | define("HAW_VERSION", HAW_HAW_VERSION . "/Tera-WURFL"); |
— | — | @@ -552,7 +546,8 @@ |
553 | 547 | var $timeout; |
554 | 548 | var $red_url; |
555 | 549 | var $disable_cache = false; |
556 | | - var $css = ""; |
| 550 | + var $css = ""; // css file |
| 551 | + var $css_class = ""; // class of deck within css file |
557 | 552 | var $ml; |
558 | 553 | var $element = array(); |
559 | 554 | var $number_of_elements = 0; |
— | — | @@ -578,7 +573,7 @@ |
579 | 574 | var $owgui_1_3 = false; // Openwave GUI Extensions for WML 1.3 |
580 | 575 | var $MMLstyle = false; // Mobile Markup Language |
581 | 576 | var $lynx = false; // Lynx text browser |
582 | | - var $iPhoneAlike = false; // iPhone, iPod Touch etc. |
| 577 | + var $iPhoneAlike = false; // iPhone, iPod Touch, iPad etc. |
583 | 578 | var $xhtml = false; // XHTML MP (mobile profile) |
584 | 579 | var $gif_enabled = false; // browser can not deal with GIF images |
585 | 580 | var $submitViaLink = false; // use link instead of <do> |
— | — | @@ -594,7 +589,7 @@ |
595 | 590 | var $skin = ""; // contains css url, where skinning is defined |
596 | 591 | |
597 | 592 | // character set properties |
598 | | - var $charset = "iso-8859-1"; // default charset |
| 593 | + var $charset = "utf-8"; // default charset |
599 | 594 | var $unicodemaptab; // filename of cross mapping table to map country |
600 | 595 | // specific character code into unicode |
601 | 596 | var $unicodearray; // array containing cross mapping table |
— | — | @@ -708,18 +703,18 @@ |
709 | 704 | // resp. other value defined above for HAW_OUTPUT_... |
710 | 705 | // query parameter "hawoutput" can be used for overwrite output type |
711 | 706 | // enter http://wap.yourdomain.com/yourscript.php?hawoutput=wap |
712 | | - global $HTTP_GET_VARS; |
| 707 | + |
713 | 708 | $forced_output = ""; |
714 | 709 | |
715 | | - if (isset ($HTTP_GET_VARS["hawdebug"])) |
| 710 | + if (isset ($_GET["hawdebug"])) |
716 | 711 | { |
717 | | - $forced_output = $HTTP_GET_VARS["hawdebug"]; |
| 712 | + $forced_output = $_GET["hawdebug"]; |
718 | 713 | $this->debug = true; |
719 | 714 | } |
720 | | - elseif (isset ($HTTP_GET_VARS["hawoutput"])) |
| 715 | + elseif (isset ($_GET["hawoutput"])) |
721 | 716 | { |
722 | | - $forced_output = $HTTP_GET_VARS["hawoutput"]; |
723 | | - $this->hawoutput = $HTTP_GET_VARS["hawoutput"]; |
| 717 | + $forced_output = $_GET["hawoutput"]; |
| 718 | + $this->hawoutput = $_GET["hawoutput"]; |
724 | 719 | } |
725 | 720 | elseif ($output != HAW_OUTPUT_AUTOMATIC) |
726 | 721 | $forced_output = $output; |
— | — | @@ -801,8 +796,8 @@ |
802 | 797 | |
803 | 798 | if (strstr($HTTP_USER_AGENT, "(iPhone") || |
804 | 799 | strstr($HTTP_USER_AGENT, "(iPod") || |
805 | | - strstr($HTTP_USER_AGENT, "(Aspen Simulator") || |
806 | | - strstr($HTTP_USER_AGENT, "Android") ) |
| 800 | + strstr($HTTP_USER_AGENT, "(iPad") || |
| 801 | + strstr($HTTP_USER_AGENT, "(Aspen Simulator")) |
807 | 802 | $this->iPhoneAlike = true; |
808 | 803 | |
809 | 804 | if (defined("HAW_TERA_WURFL_PATH") && !$forced_output) |
— | — | @@ -1170,7 +1165,8 @@ |
1171 | 1166 | Mapping tables are available at: |
1172 | 1167 | <a href="http://www.unicode.org/Public/MAPPINGS/" target="_blank"> |
1173 | 1168 | http://www.unicode.org/Public/MAPPINGS/</a> |
1174 | | - @param charset Character set that is used in your country.<br>Default: iso-8859-1 |
| 1169 | + @param charset Character set used.<br> |
| 1170 | + Default: utf-8 (until hawhaw.inc V5.19: iso-8859-1) |
1175 | 1171 | @param unicodemaptab (optional)<br> |
1176 | 1172 | Cross mapping table from country specific character coding to |
1177 | 1173 | unicode (default: no mapping to unicode activated).<br> |
— | — | @@ -1254,6 +1250,16 @@ |
1255 | 1251 | |
1256 | 1252 | |
1257 | 1253 | /** |
| 1254 | + Sets a css class for this object in a (X)HTML page. |
| 1255 | + @param css_class CSS class to be defined in the deck's central CSS file |
| 1256 | + */ |
| 1257 | + function set_css_class($css_class) |
| 1258 | + { |
| 1259 | + $this->css_class = $css_class; |
| 1260 | + } |
| 1261 | + |
| 1262 | + |
| 1263 | + /** |
1258 | 1264 | Sets a window wallpaper for a HTML (big-screen browser) page. |
1259 | 1265 | Has no effect on WML/handheld pages. |
1260 | 1266 | @param background e.g. "backgrnd.gif" |
— | — | @@ -1688,12 +1694,14 @@ |
1689 | 1695 | { |
1690 | 1696 | global $haw_license_holder; |
1691 | 1697 | global $haw_license_domain; |
| 1698 | + global $haw_license_key; |
1692 | 1699 | global $haw_signature; |
1693 | 1700 | global $haw_sig_text; |
1694 | 1701 | global $haw_sig_link; |
1695 | 1702 | |
1696 | 1703 | // add hawoutput query parameter to redirection url, if required |
1697 | | - HAW_handle_forced_output($this->red_url, $this->hawoutput); |
| 1704 | + if ($this->red_url) |
| 1705 | + HAW_handle_forced_output($this->red_url, $this->hawoutput); |
1698 | 1706 | |
1699 | 1707 | if ($this->debug) |
1700 | 1708 | header("content-type: text/plain"); |
— | — | @@ -1773,6 +1781,12 @@ |
1774 | 1782 | printf("<meta name=\"GENERATOR\" content=\"%s (PHP) %s%s\" %s\n", |
1775 | 1783 | HAW_VERSION, HAW_COPYRIGHT, $license, $endtag); |
1776 | 1784 | |
| 1785 | + if ($this->desktopBrowser && isset($haw_license_key)) |
| 1786 | + { |
| 1787 | + printf("<meta name=\"LICENSE_KEY\" content=\"%s\" %s\n", |
| 1788 | + $haw_license_key, $endtag); |
| 1789 | + } |
| 1790 | + |
1777 | 1791 | if ($this->timeout > 0) |
1778 | 1792 | { |
1779 | 1793 | printf("<meta http-equiv=\"refresh\" content=\"%d; URL=%s\" %s\n", |
— | — | @@ -1939,7 +1953,13 @@ |
1940 | 1954 | { |
1941 | 1955 | // use skin design |
1942 | 1956 | echo "<div id=\"skin\">\n"; |
1943 | | - echo "<div id=\"display\">\n"; |
| 1957 | + |
| 1958 | + if ($this->css_class) |
| 1959 | + $class_param = " class=\"" . $this->css_class . "\""; |
| 1960 | + else |
| 1961 | + $class_param = ""; |
| 1962 | + |
| 1963 | + printf("<div id=\"display\"%s>\n", $class_param); |
1944 | 1964 | } |
1945 | 1965 | else if ($this->use_simulator == HAW_SIM_CLASSIC) |
1946 | 1966 | { |
— | — | @@ -2187,7 +2207,30 @@ |
2188 | 2208 | if ($this->ml == HAW_HTML) |
2189 | 2209 | { |
2190 | 2210 | if ($this->css_enabled) |
2191 | | - printf("<div id=\"canvas\" style=\"%s\">\n", $divstyle); |
| 2211 | + { |
| 2212 | + if ($this->css_class) |
| 2213 | + { |
| 2214 | + $class = $this->css_class; |
| 2215 | + |
| 2216 | + if (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], " MSIE ")) |
| 2217 | + $class .= " peekaboo"; // CSS hook for peekaboo handling |
| 2218 | + } |
| 2219 | + else |
| 2220 | + { |
| 2221 | + if (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], " MSIE ")) |
| 2222 | + $class = "peekaboo"; |
| 2223 | + else |
| 2224 | + $class = ""; |
| 2225 | + } |
| 2226 | + |
| 2227 | + if ($class) |
| 2228 | + $class_param = " class=\"" . $class . "\""; |
| 2229 | + else |
| 2230 | + $class_param = ""; |
| 2231 | + |
| 2232 | + printf("<div id=\"canvas\" style=\"%s\"%s>\n", $divstyle, $class_param); |
| 2233 | + echo "<span id=\"hawcsshook1\"></span>\n"; // universal CSS hook for toolbars etc. |
| 2234 | + } |
2192 | 2235 | else |
2193 | 2236 | printf("<div id=\"canvas\" align=\"%s\">\n", $this->alignment); |
2194 | 2237 | } |
— | — | @@ -2232,10 +2275,10 @@ |
2233 | 2276 | // IF YOU DO SO, YOU ARE VIOLATING THE LICENSE TERMS |
2234 | 2277 | // OF THIS SOFTWARE! YOU HAVE TO PAY NOTHING FOR THIS |
2235 | 2278 | // SOFTWARE, SO PLEASE BE SO FAIR TO ACCEPT THE RULES. |
2236 | | - // IF YOU DON'T, YOUR WEBSITE WILL AT LEAST BE LISTED IN |
2237 | | - // THE HAWHAW HALL OF SHAME! |
| 2279 | + // |
2238 | 2280 | // PLEASE REFER TO THE LIBRARY HEADER AND THE HAWHAW |
2239 | | - // HOMEPAGE FOR MORE INFORMATION. |
| 2281 | + // HOMEPAGE FOR MORE INFORMATION: |
| 2282 | + // http://www.hawhaw.de/#license |
2240 | 2283 | |
2241 | 2284 | echo "</div>\n"; |
2242 | 2285 | |
— | — | @@ -2274,10 +2317,7 @@ |
2275 | 2318 | $this->waphome, $default_text); |
2276 | 2319 | |
2277 | 2320 | if ($signature && ($this->use_simulator == HAW_SIM_NONE)) |
2278 | | - { |
2279 | | - echo "<hr width=\"150px\"/>\n"; // seperate content from signature |
2280 | | - printf("<span style=\"font-size:8pt;\">%s</span>\n", $signature); |
2281 | | - } |
| 2321 | + printf("<br /><span style=\"font-size:8pt;\">%s</span>\n", $signature); |
2282 | 2322 | else |
2283 | 2323 | echo $signature; |
2284 | 2324 | } |
— | — | @@ -2374,6 +2414,7 @@ |
2375 | 2415 | strstr($ua_low, "o2imode") || |
2376 | 2416 | strstr($ua_low, "opera ") || |
2377 | 2417 | strstr($ua_low, "reqwirelessweb") || |
| 2418 | + strstr($acc_low, "xhtml+xml") || |
2378 | 2419 | strstr($acc_low, "vnd.wap.xhtml")) |
2379 | 2420 | { |
2380 | 2421 | $this->ml = HAW_HTML; // create HTML (even when device accepts text/vnd.wap.wml too!) |
— | — | @@ -2446,10 +2487,12 @@ |
2447 | 2488 | strstr($HTTP_USER_AGENT, "Firefox") || |
2448 | 2489 | strstr($HTTP_USER_AGENT, "Macintosh") || // Safari desktop browser |
2449 | 2490 | strstr($HTTP_USER_AGENT, "Iceweasel") || |
| 2491 | + strstr($HTTP_USER_AGENT, "Chrome") || |
2450 | 2492 | strstr($HTTP_USER_AGENT, "Konqueror") || |
2451 | 2493 | strstr($HTTP_USER_AGENT, "Opera")) // can be Opera Mini! |
2452 | 2494 | { |
2453 | 2495 | $this->desktopBrowser = true; |
| 2496 | + $this->css_enabled = true; |
2454 | 2497 | $this->display_banners = true; |
2455 | 2498 | } |
2456 | 2499 | |
— | — | @@ -2459,6 +2502,7 @@ |
2460 | 2503 | (strstr($ua_low, "symbianos") && strstr($acc_low, "xhtml+xml")) || |
2461 | 2504 | ($this->iPhoneAlike == true) || |
2462 | 2505 | strstr($HTTP_USER_AGENT, "(Linux; U; Android") || |
| 2506 | + strstr($HTTP_USER_AGENT, "Windows Phone OS") || |
2463 | 2507 | strstr($HTTP_USER_AGENT, "Kindle/")) |
2464 | 2508 | { |
2465 | 2509 | // XHTML device detected |
— | — | @@ -2485,6 +2529,7 @@ |
2486 | 2530 | { |
2487 | 2531 | // PDA browser detected (or poor old Netscape 4.7x which messes with CSS) |
2488 | 2532 | $this->PDAstyle = true; |
| 2533 | + $this->css_enabled = false; |
2489 | 2534 | $this->desktopBrowser = false; |
2490 | 2535 | $this->display_banners = false; |
2491 | 2536 | } |
— | — | @@ -2512,13 +2557,6 @@ |
2513 | 2558 | $this->xhtmlmp_preferred_mime_type = "text/html"; |
2514 | 2559 | } |
2515 | 2560 | |
2516 | | - // determine if browser is CSS-enbled |
2517 | | - if (($this->ml == HAW_HTML) && |
2518 | | - (strstr($HTTP_USER_AGENT, "MSIE") || |
2519 | | - strstr($HTTP_USER_AGENT, "Mozilla") || |
2520 | | - strstr($HTTP_USER_AGENT, "Opera"))) |
2521 | | - $this->css_enabled = true; |
2522 | | - |
2523 | 2561 | // determine if browser is able to display GIF images |
2524 | 2562 | if (($this->ml == HAW_HTML) || |
2525 | 2563 | (strstr($acc_low, "image/gif")) || |
— | — | @@ -2606,8 +2644,11 @@ |
2607 | 2645 | else |
2608 | 2646 | { |
2609 | 2647 | // treat it as normal web browser |
| 2648 | + $this->desktopBrowser = true; |
2610 | 2649 | $this->ml = HAW_HTML; |
| 2650 | + $this->xhtml = true; |
2611 | 2651 | $this->css_enabled = true; |
| 2652 | + $this->display_banners = true; |
2612 | 2653 | } |
2613 | 2654 | } |
2614 | 2655 | |
— | — | @@ -3248,6 +3289,11 @@ |
3249 | 3290 | { |
3250 | 3291 | // HTML or WML |
3251 | 3292 | |
| 3293 | + if (($deck->ml == HAW_HTML) && $deck->css_enabled && $this->css_class) |
| 3294 | + { |
| 3295 | + printf("<span class=\"%s\">\n", $this->css_class); |
| 3296 | + } |
| 3297 | + |
3252 | 3298 | if (($this->attrib & HAW_TEXTFORMAT_BOXED) && ($deck->ml == HAW_HTML)) |
3253 | 3299 | { |
3254 | 3300 | // determine text and background color, if not already assigned |
— | — | @@ -3278,7 +3324,7 @@ |
3279 | 3325 | if ($this->br >= 1) |
3280 | 3326 | $this->br--; |
3281 | 3327 | } |
3282 | | - |
| 3328 | + |
3283 | 3329 | if ($this->attrib & HAW_TEXTFORMAT_BOLD) |
3284 | 3330 | echo "<b>\n"; |
3285 | 3331 | |
— | — | @@ -3307,20 +3353,10 @@ |
3308 | 3354 | printf("<font color=\"%s\">", $this->color); |
3309 | 3355 | } |
3310 | 3356 | |
3311 | | - if (($deck->ml == HAW_HTML) && $deck->css_enabled && $this->css_class) |
3312 | | - { |
3313 | | - printf("<span class=\"%s\">\n", $this->css_class); |
3314 | | - } |
3315 | | - |
3316 | 3357 | // print text |
3317 | 3358 | if (isset($this->text)) |
3318 | 3359 | printf("%s\n", HAW_specchar($this->text, $deck)); |
3319 | 3360 | |
3320 | | - if (($deck->ml == HAW_HTML) && $deck->css_enabled && $this->css_class) |
3321 | | - { |
3322 | | - echo "</span>\n"; |
3323 | | - } |
3324 | | - |
3325 | 3361 | if (($deck->ml == HAW_HTML) && $this->color) |
3326 | 3362 | { |
3327 | 3363 | if ($deck->css_enabled) |
— | — | @@ -3360,6 +3396,9 @@ |
3361 | 3397 | // create required amount of carriage return's |
3362 | 3398 | for ($i=0; $i < $this->br; $i++) |
3363 | 3399 | echo "<br />\n"; |
| 3400 | + |
| 3401 | + if (($deck->ml == HAW_HTML) && $deck->css_enabled && $this->css_class) |
| 3402 | + echo "</span>\n"; |
3364 | 3403 | } |
3365 | 3404 | elseif($deck->ml == HAW_VXML) |
3366 | 3405 | { |
— | — | @@ -4227,11 +4266,23 @@ |
4228 | 4267 | |
4229 | 4268 | function create(&$deck) |
4230 | 4269 | { |
| 4270 | + $class_param = ""; |
| 4271 | + |
4231 | 4272 | if ($this->type == HAW_INPUT_PASSWORD) |
| 4273 | + { |
4232 | 4274 | $type = "type=\"password\""; |
| 4275 | + |
| 4276 | + if ($deck->css_enabled) |
| 4277 | + $class_param = " class=\"hawinputpassword\""; |
| 4278 | + } |
4233 | 4279 | else |
| 4280 | + { |
4234 | 4281 | $type = "type=\"text\""; |
4235 | | - |
| 4282 | + |
| 4283 | + if ($deck->css_enabled) |
| 4284 | + $class_param = " class=\"hawinputtext\""; |
| 4285 | + } |
| 4286 | + |
4236 | 4287 | if ($this->size) |
4237 | 4288 | $size = sprintf("size=\"%d\"", $this->size); |
4238 | 4289 | else |
— | — | @@ -4266,14 +4317,14 @@ |
4267 | 4318 | { |
4268 | 4319 | printf("<label for=\"%s\">%s</label>\n", |
4269 | 4320 | $this->name, HAW_specchar($this->label, $deck)); |
4270 | | - printf("<input %s name=\"%s\" id=\"%s\" value=\"%s\" %s %s%s /> ", |
| 4321 | + printf("<input %s name=\"%s\" id=\"%s\" value=\"%s\" %s %s%s%s /> ", |
4271 | 4322 | $type, $this->name, |
4272 | | - $this->name, $this->value, $size, $maxlength, $mode); |
| 4323 | + $this->name, $this->value, $size, $maxlength, $mode, $class_param); |
4273 | 4324 | } |
4274 | 4325 | else |
4275 | | - printf("%s <input %s name=\"%s\" value=\"%s\" %s %s%s /> ", |
| 4326 | + printf("%s <input %s name=\"%s\" value=\"%s\" %s %s%s%s /> ", |
4276 | 4327 | HAW_specchar($this->label, $deck), $type, |
4277 | | - $this->name, $this->value, $size, $maxlength, $mode); |
| 4328 | + $this->name, $this->value, $size, $maxlength, $mode, $class_param); |
4278 | 4329 | |
4279 | 4330 | for ($i=0; $i < $this->br; $i++) |
4280 | 4331 | echo "<br />\n"; |
— | — | @@ -4833,6 +4884,7 @@ |
4834 | 4885 | $this->name = $name; |
4835 | 4886 | $this->value = ""; |
4836 | 4887 | $this->number_of_buttons = 0; |
| 4888 | + $this->buttons = array(); |
4837 | 4889 | $this->voice_text = HAW_VOICE_ENUMERATE; |
4838 | 4890 | $this->voice_audio_src = ""; |
4839 | 4891 | $this->voice_help = array(); |
— | — | @@ -5361,7 +5413,7 @@ |
5362 | 5414 | { |
5363 | 5415 | var $label; |
5364 | 5416 | var $name; |
5365 | | - |
| 5417 | + |
5366 | 5418 | /** |
5367 | 5419 | Constructor |
5368 | 5420 | @param label What's written on the button. |
— | — | @@ -5397,7 +5449,7 @@ |
5398 | 5450 | |
5399 | 5451 | $name = ($this->name ? "name=\"" . "$this->name" ."\"" : ""); |
5400 | 5452 | |
5401 | | - printf("<input type=\"submit\" %s value=\"%s\" /><br />\n", $name, |
| 5453 | + printf("<input type=\"submit\" %s value=\"%s\" id=\"hawinputsubmit\" /><br />\n", $name, |
5402 | 5454 | HAW_specchar($this->label, $deck)); |
5403 | 5455 | |
5404 | 5456 | } |
— | — | @@ -5907,6 +5959,7 @@ |
5908 | 5960 | var $title; |
5909 | 5961 | var $accesskey; // "1", "2", ... "0", "*", "#" |
5910 | 5962 | var $image; |
| 5963 | + var $css_class; |
5911 | 5964 | var $br; |
5912 | 5965 | var $voice_text; |
5913 | 5966 | var $voice_audio_src; |
— | — | @@ -5938,6 +5991,7 @@ |
5939 | 5992 | $this->title = $title; |
5940 | 5993 | $this->accesskey = HAW_NO_ACCESSKEY; |
5941 | 5994 | $this->image = false; |
| 5995 | + $this->css_class = ""; |
5942 | 5996 | $this->br = 1; // default: 1 line break |
5943 | 5997 | $this->voice_text = $destination; |
5944 | 5998 | $this->voice_audio_src = ""; |
— | — | @@ -5956,6 +6010,15 @@ |
5957 | 6011 | } |
5958 | 6012 | |
5959 | 6013 | /** |
| 6014 | + Sets a css class for this object in a (X)HTML page. |
| 6015 | + @param css_class CSS class to be defined in the deck's central CSS file |
| 6016 | + */ |
| 6017 | + function set_css_class($css_class) |
| 6018 | + { |
| 6019 | + $this->css_class = $css_class; |
| 6020 | + } |
| 6021 | + |
| 6022 | + /** |
5960 | 6023 | Sets the number of line breaks (CRLF) after phone link. (default: 1) |
5961 | 6024 | @param br Some number of line breaks. |
5962 | 6025 | */ |
— | — | @@ -6065,6 +6128,11 @@ |
6066 | 6129 | $dest = $this->destination; |
6067 | 6130 | } |
6068 | 6131 | |
| 6132 | + if ($deck->css_enabled && $this->css_class) |
| 6133 | + { |
| 6134 | + printf("<span class=\"%s\">\n", $this->css_class); |
| 6135 | + } |
| 6136 | + |
6069 | 6137 | if ($deck->link_brackets == true) |
6070 | 6138 | echo "["; |
6071 | 6139 | |
— | — | @@ -6074,13 +6142,20 @@ |
6075 | 6143 | // image available for this link, let it create itself |
6076 | 6144 | $this->image->create($deck); |
6077 | 6145 | |
6078 | | - printf("%s</a>", HAW_specchar($this->label, $deck)); |
6079 | | - |
| 6146 | + if ($deck->css_enabled) |
| 6147 | + printf("<span class=\"hawphonelabel\">%s</span></a>", HAW_specchar($this->label, $deck)); |
| 6148 | + else |
| 6149 | + printf("%s</a>", HAW_specchar($this->label, $deck)); |
| 6150 | + |
6080 | 6151 | if ($deck->link_brackets == true) |
6081 | 6152 | echo "]"; |
6082 | 6153 | |
6083 | 6154 | printf("%s\n", $br); |
6084 | 6155 | |
| 6156 | + if ($deck->css_enabled && $this->css_class) |
| 6157 | + { |
| 6158 | + echo "</span>\n"; |
| 6159 | + } |
6085 | 6160 | } |
6086 | 6161 | elseif ($deck->ml == HAW_WML) |
6087 | 6162 | { |
— | — | @@ -6303,6 +6378,14 @@ |
6304 | 6379 | $this->number_of_elements++; |
6305 | 6380 | } |
6306 | 6381 | |
| 6382 | + function add_link_without_reference($link) |
| 6383 | + { |
| 6384 | + // workaround for Phalanger duck-typing issue |
| 6385 | + $this->add_link($link); |
| 6386 | + |
| 6387 | + return $link->get_accesskey(); |
| 6388 | + } |
| 6389 | + |
6307 | 6390 | /** |
6308 | 6391 | Sets text to be spoken by voice browsers. <br> |
6309 | 6392 | @param text Some alternative text that precedes the enumeration of link <label>s. |
— | — | @@ -6334,8 +6417,8 @@ |
6335 | 6418 | { |
6336 | 6419 | // create links inside a frame |
6337 | 6420 | |
6338 | | - echo "<div id=\"hawlinkset\" style=\"padding: 5px;\">\n"; |
6339 | | - |
| 6421 | + echo "<div id=\"hawlinkset\">\n"; |
| 6422 | + |
6340 | 6423 | if ($deck->lynx) |
6341 | 6424 | { |
6342 | 6425 | // create link list to avoid whitespace between links |