]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/alphatest.php
Reformat code
[SourceForge/phpwiki.git] / themes / alphatest.php
1 <html>
2 <head><title>Alpha Channel Test</title>
3     <script type="text/javascript"><!--
4     var backgroundcolor = new Array();
5     backgroundcolor[0] = '#ffffff';
6     backgroundcolor[1] = '#cccccc';
7     backgroundcolor[2] = '#888888';
8     backgroundcolor[3] = '#444444';
9     backgroundcolor[4] = '#000000';
10     backgroundcolor[5] = '#aa8888';
11     backgroundcolor[6] = '#88aa88';
12     backgroundcolor[7] = '#8888aa';
13     function changebg(color) {
14         document.bgColor = backgroundcolor[color];
15     }
16     //--></script>
17 </head>
18 <body bgcolor="#8888aa">
19 <hr>
20 bgcolor:
21 <script type="text/javascript"><!--
22 for (var n = 0; n < backgroundcolor.length; n++) {
23     document.write(
24             ' <a href="#" onmouseover="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
25     );
26 }
27 //--></script>
28 <?php
29
30 function find_pngs($dir)
31 {
32     $file_list = '';
33     $stack[] = $dir;
34     while ($stack) {
35         $current_dir = array_pop($stack);
36         $pngs = false;
37         if ($dh = opendir($current_dir)) {
38             while (($file = readdir($dh)) !== false) {
39                 if ($file !== '.' AND $file !== '..') {
40                     $current_file = "{$current_dir}/{$file}";
41                     if (is_file($current_file)) {
42                         if (!(strcmp(substr($file, -4), ".png"))) {
43                             if (!$pngs) {
44                                 print "<hr /><h4>\n{$current_dir}</h4>\n";
45                                 $pngs = true;
46                             }
47                             print "<img src=\"{$current_dir}/" . urlencode($file) . "\" alt=\"{$file}\" />\n";
48                         }
49                     } elseif (is_dir($current_file)) {
50                         $stack[] = $current_file;
51                     }
52                 }
53             }
54         }
55     }
56 }
57
58 find_pngs(".");
59 ?>
60 <hr>
61 bgcolor:
62 <script type="text/javascript"><!--
63 for (var n = 0; n < backgroundcolor.length; n++) {
64     document.write(
65             ' <a href="#" onmouseover="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
66     );
67 }
68 //--></script>
69 <hr>
70 </body>
71 </html>