summaryrefslogtreecommitdiff
path: root/includes/js/dojox/layout/tests/remote/getResponse.php
blob: 0a370506f8896d802b93d8b3b505a82896c4b676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
	// this file is just a bouncer for ContentPane.html test
	error_reporting(E_ALL ^ E_NOTICE);
	
	if(isset($_GET['mode'])){
		switch($_GET['mode']){
			case 'htmlPaths':
				echo "<img src='../images/testImage.gif' id='imgTest'/>
					<div id='inlineStyleTest' style='width:188px;height:125px;background-image:url(../images/testImage.gif)'></div>
					<style>@import 'getResponse.php?mode=importCss';</style>
					<link type='text/css' rel='stylesheet' href='getResponse.php?mode=linkCss'/>
					<div id='importCssTest'></div>
					<div id='linkCssTest'></div>
					<div id='importMediaTest'></div>
					<div id='linkMediaTest'></div>
					<!-- these may download but not render -->
					<style media='print'>@import 'getResponse.php?mode=importMediaPrint';</style>
					<link media='print' type='text/css' rel='stylesheet' href='getResponse.php?mode=linkMediaPrint'/>
					";
				break;
	
			case 'importCss':
				header('Content-type: text/css; charset=utf-8');
				echo "#importMediaTest {
					margin: 4px;
					border: 1px dashed red;
					width: 200px;
					height: 200px;
				}
				#importCssTest {
						margin: 4px;
						border: 1px solid blue;
						width: 100px;
						height: 100px;
					}";
				break;
	
			case 'linkCss':
				header('Content-type: text/css; charset=utf-8');
				echo "#linkMediaTest {
					margin: 4px;
					border: 2px dashed red;
					width: 200px;
					height: 200px;
				}
				#linkCssTest {
					margin: 4px;
					border: 2px dashed red;
					width: 100px;
					height: 100px;
				}";
				break;

			case 'importMediaPrint': // may download but not render
				header('Content-type: text/css; charset=utf-8');
				echo "#importMediaTest {
					margin: 10px;
					border: 5px dashed gray;
					width: 100px;
					height: 100px;
				}";
				break;

			case 'linkMediaPrint': // may download but not render
				header('Content-type: text/css; charset=utf-8');
				echo "#linkMediaTest {
					margin: 10px;
					border: 5px dashed gray;
					width: 100px;
					height: 100px;
				}";
				break;
	
			case 'remoteJsTrue':
				header('Content-type: text/javascript; charset=utf-8');
				echo "unTypedVarInDocScope = true;";
				break;
	
			case 'remoteJsFalse':
				header('Content-type: text/javascript; charset=utf-8');
				echo "unTypedVarInDocScope = false;";
				break;
	
			case 'bounceInput':
				echo file_get_contents("php://input");
				break;
	
			case 'bounceHeaders';
				if(function_exists("apache_request_headers")){
					$headers = apache_request_headers();
					foreach($headers as $header => $vlu){
						echo "$header=$vlu\n<br/>";
					}
				}else{
					// IIS, php as CGI etc gets here, messes formating, suboptimal
					$headers = preg_grep('/HTTP_/i', array_keys($_SERVER));
					foreach($headers as $header){
						$vlu = preg_replace(array('/^HTTP_/', '/_/'), array('', '-'), $header);
						echo "$vlu={$_SERVER[$header]}\n<br/>";
					}
				}
				break;
	
			default:
				echo "unkown mode {$_GET['mode']}";
		}
	}
?>