staticmoduleinfo.php 2.9 KB

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