From: Robert Kaiser Date: Tue, 29 Nov 2016 16:59:55 +0000 (+0100) Subject: re-add the CSS file and rework the UA tests not to rely on outdated non-public includes X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=39814159acbecf57f7f6ddf0170e4f6bf701a3fa;p=php-utility-classes.git re-add the CSS file and rework the UA tests not to rely on outdated non-public includes --- diff --git a/tests/test.css b/tests/test.css new file mode 100755 index 0000000..7a26387 --- /dev/null +++ b/tests/test.css @@ -0,0 +1,73 @@ +/* general styles */ + +body { +/* font-family: Arial,Helvetica,sans-serif; */ + color: black; + font-size: medium; + margin: 3px; + padding: 0px; + border: 0px; + background-color: white; +} + +h1 { + font-size: xx-large; + font-weight: bold; + text-align: center; +} + +a:link { color: #0000EE; } +a:visited { color: #551A8B; } +a:active { color: #FF0000; } + +img { + border: 0px; +} + +table { + color: black; + margin: 0px; + padding: 0px; + border: 0px; +} + +td, th { + font-family: Arial,Helvetica,sans-serif; + color: black; + margin: 0px; + padding: 2px; + border: 0px; +} + +th { + font-weight: bold; +} + +table.border { + border: 1px solid #c0c0c0; +} + +table.border td, +table.border th { + border: 1px solid #c0c0c0; +} + +#ualist th { font-size: 0.75em; } +#ualist td.comment { + font-size: 0.75em; + text-align: center; + font-weight: bold; +} +#ualist td.ua { font-size: 0.75em; } + + + +/* other general elements */ + +div#valid { + display: none; +} + +div#copyright { + display: none; +} diff --git a/tests/ua_list.php b/tests/ua_list.php index 3b417af..795c7ab 100644 --- a/tests/ua_list.php +++ b/tests/ua_list.php @@ -1,23 +1,22 @@ pgtop('User Agents', $mycss); +print("\n"); +print("\n\n"); +print(" \n"); +print(" \n"); +print(" ".'User Agents'."\n"); +print("\n\n"); print('

User Agents

'."\n"); $ualist = is_readable($uafile)?file($uafile):array(); if (count($ualist)) { - print(''."\n"); + print('
'."\n"); print(' '."\n"); print(' '."\n"); print(' '."\n"); @@ -61,5 +60,8 @@ else { print('No User Agent strings found in file "'.$uafile.'".'."\n"); } -$wrapper->pgbottom(); +print("
\n"); +print("Page code under Mozilla Public License, code available at GitHub.\n"); +print("
\n"); +print("\n"); ?> diff --git a/tests/ua_test.php b/tests/ua_test.php index 97309b3..95234d9 100644 --- a/tests/ua_test.php +++ b/tests/ua_test.php @@ -1,22 +1,24 @@ pgtop("KaiRo's Browser-Test"); +include('../classes/useragent.php-class'); // set default time zone - right now, always the one the server is in! date_default_timezone_set('Europe/Vienna'); -$httpvars = $util->getHTTPvars(); -if (strlen($httpvars["ua"])) { - $ua = new userAgent($httpvars["ua"]); +print("\n"); +print("\n\n"); +print(" \n"); +print(" \n"); +print(" ".'User Agent Test'."\n"); +print("\n\n"); + +if (strlen($_REQUEST["ua"])) { + $ua = new userAgent($_REQUEST["ua"]); } else { $ua = new userAgent; } -print("

KaiRo's Browser-Test

\n"); +print("

User Agent Test

\n"); print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n
"); print("".$ua->getUAString()."\n"); @@ -44,5 +46,9 @@ print("

Test the following UA string (leave empty to read it from your br print("

\n"); print("getUAString())."\" size=\"80\" maxlength=\"150\">\n"); print("

\n"); -$wrapper->pgbottom(); + +print("
\n"); +print("Page code under Mozilla Public License, code available at GitHub.\n"); +print("
\n"); +print("\n"); ?>
User Agent stringBrand