staticmoduleinfo.php 2.6 KB

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