Rusty's cleanup to ciniparser.c's strstrip and strlwc
[ccan] / web / staticmoduleinfo.php
1 <?php
2 session_start();
3 include('logo.html');
4 include('menulist.html');
5 include('static-configuration');
6 $module=$argv[1];
7
8 $maintainer=extract_field('maintainer',$module);
9 $author=extract_field('author',$module);
10 $summary=extract_field('summary',$module);
11 $description=htmlize_field('description',$module);
12 $example=extract_field('example',$module);
13 $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module));
14 $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module));
15 $licence=extract_field('licence',$module);
16 ?>
17 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
18 <tr align="center" bgcolor="FFFFCC">
19 <td>
20 <a href="<?=$repo_base.$module?>">Browse Source</a>
21 </td>
22 <td>
23 <a href="../<?=$tar_dir?>/with-deps/<?=basename($module)?>.tar.bz2">Download</a>
24 <a href="../<?=$tar_dir?>/<?=basename($module)?>.tar.bz2">(without any required ccan dependencies)</a>
25 </tr>
26 </table>
27
28 <p>
29 </p>
30
31 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="8" cellspacing="1">
32 <tr align="left" bgcolor="FFFFCC">
33 <td><h3>Module: </h3> <?=$module?> </td>
34 </tr>
35
36 <tr align="left" bgcolor="FFFFCC">
37 <td><h3>Summary: </h3> <?=$summary?></td>
38 </tr>
39
40 <?php
41 if ($maintainer) {
42 ?>
43 <tr align="left" bgcolor="FFFFCC"> 
44 <td><h3>Maintainer: </h3> <?=$maintainer?></td>
45 </tr>
46 <?php
47 }
48
49 if ($author) {
50 ?>
51 <tr align="left" bgcolor="FFFFCC"> 
52 <td><h3>Author: </h3> <?=$author?></td>
53 </tr>
54 <?php
55 }
56
57 if ($dependencies) {
58 ?>
59 <tr align="left" bgcolor="FFFFCC">
60 <td><h3>Dependencies: </h3> <pre> <?php
61         foreach (preg_split("/\s+/", $dependencies) as $dep) {
62                 echo '<a href="'.substr($dep, 5).'.html">'.$dep.'</a> ';
63         }
64 ?></pre></td>
65 </tr>
66 <?php 
67 }
68
69 if ($extdepends) {
70 ?>
71 <tr align="left" bgcolor="FFFFCC">
72 <td><h3>External dependencies: </h3> <?php
73         foreach (split("\n", $extdepends) as $dep) {
74                 $fields=preg_split("/\s+/", $dep);
75                 echo $fields[0].' ';
76                 if (count($fields) > 1)
77                         echo '(version '.$fields[1].') ';
78                 echo '<br>';
79         }
80 ?></td>
81 </tr>
82 <?php 
83 }
84 ?>
85 <tr align="left" bgcolor="FFFFCC">
86 <td><h3>Description: </h3> <?=$description;?> </td>
87 </tr>
88 <?php 
89 if ($example) {
90 ?>
91 <tr align="left" bgcolor="FFFFCC"> 
92 <td><h3>Example: </h3> <pre><?=$example?></pre></td>
93 </tr>
94 <?php
95 }
96
97 if ($licence) {
98 ?>
99 <tr align="left" bgcolor="FFFFCC"> 
100 <td><h3>Licence: </h3> <?=$licence?></td>
101 </tr>
102 <?php
103 }
104 ?>
105 </table><hr>
106 </body></html>