Add a comment explaining that jQuery.map flattens arrays
[jquery.git] / test / polluted.php
1 <?php
2         if( count($_POST) ){ // second call
3                 $includes = array();
4                 foreach( $_POST as $lib=>$ver ){
5                         if( !$ver )
6                                 continue;
7                         $include = "<script type='text/javascript' src='otherlibs/$lib/$ver/$lib.js'></script>\n";
8                         if( $lib == 'prototype' ) // prototype must be included first
9                                 array_unshift( $includes, $include );
10                         else
11                                 array_push( $includes, $include );
12                 }
13
14                 $includes = implode( "\n", $includes );
15                 $suite = file_get_contents('index.html');
16                 echo str_replace( '<!-- Includes -->', $includes, $suite );
17                 exit;
18         }       
19 ?>
20
21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
23 <head>
24         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
25         <title>jQuery Test Suite</title>
26         <link rel="Stylesheet" media="screen" href="qunit/testsuite.css" />
27         <link rel="Stylesheet" media="screen" href="data/otherlibs.css" />
28         <style type="text/css">
29                 form.otherlibs{
30                         margin: 20px 0 0 30px;
31                 }
32                 form.otherlibs label{
33                         display:block;
34                         margin: 5px 0 5px 30px;
35                 }
36                 form.otherlibs input.submit{
37                         margin:30px 0 0 0;
38                 }
39         </style>
40 </head>
41
42 <body id="body">
43         <h1 id="header">jQuery Test Suite</h1>
44         <h2 id="banner" class="fail"></h2>
45         <h2 id="userAgent">Choose other libraries to include</h2>
46         
47         <form class="otherlibs" action="" method="post">
48                 <?php
49                         $libs = scandir('otherlibs');
50                         foreach( $libs as $lib ){
51                                 if( $lib[0] == '.' )
52                                         continue;
53                                 echo "<h3>$lib</h3>";
54                                 $vers = scandir( "otherlibs/$lib");
55                                 foreach( $vers as $ver ){
56                                         if( $ver[0] != '.' )
57                                                 echo "<label><input type='checkbox' name='$lib' value='$ver'>$ver</label>";
58                                 }
59                         }
60                 ?>
61                 <input type="submit" value="Run" class="submit" />
62         </form>
63 </body>
64 </html>