affichage en rouge des fichiers 'dead' et dependances vers le haut et le
authorJeremy Laine <jeremy.laine@m4x.org>
Sat, 23 Nov 2002 16:38:23 +0000 (16:38 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Sat, 23 Nov 2002 16:38:23 +0000 (16:38 +0000)
    bas

depview/file.php
depview/index.php

index 84d6e14..a0c99a3 100644 (file)
@@ -11,27 +11,53 @@ if (!list($page)=mysql_fetch_row($res)) {
 
 <h1>Dependencies for <?php echo $page; ?></h1>
 
+<h2>files that <?php echo $page; ?> depends on</h2>
 <table>
 <tr>
+  <th>relation</th>
   <th>context</th>
   <th>file</th>
 </tr>
+<?php
+$res = mysql_query("select dep.dir,dep.type,dep.dep,file.path from dep left join file on dep.dep=file.id where page=$id order by dep.dir");
+while (list($dir,$type,$cid,$cpath)=mysql_fetch_row($res)) {
+$res2 = mysql_query("select path from dir where id=$dir");
+list($dirname)=mysql_fetch_row($res2);
+?>
+<tr>
+  <td><?php echo $type; ?></td>
+  <td><?php echo $dirname; ?></td>
+  <td><a href="file.php?id=<?php echo $cid; ?>"><?php echo $cpath; ?></a></td>
+</tr>
+<?php
+}
+?>
+</table>
 
+<h2>files that depend on <?php echo $page; ?></h2>
+<table>
+<tr>
+  <th>relation</th>
+  <th>context</th>
+  <th>file</th>
+</tr>
 <?php
-$res = mysql_query("select dep.id,dep.dir,dep.dep,file.path from dep left join file on dep.dep=file.id where page=$id order by dep.dir");
-while (list($id,$dir,$dep,$path)=mysql_fetch_row($res)) {
+$res = mysql_query("select dep.dir,dep.type,dep.page,file.path from dep left join file on dep.page=file.id where dep=$id order by dep.dir");
+while (list($dir,$type,$pid,$ppath)=mysql_fetch_row($res)) {
 $res2 = mysql_query("select path from dir where id=$dir");
 list($dirname)=mysql_fetch_row($res2);
 ?>
 <tr>
+  <td><?php echo $type; ?></td>
   <td><?php echo $dirname; ?></td>
-  <td><a href="file.php?id=<?php echo $dep; ?>"><?php echo $path; ?></a></td>
+  <td><a href="file.php?id=<?php echo $pid; ?>"><?php echo $ppath; ?></a></td>
 </tr>
 <?php
 }
 ?>
 </table>
 
+
 <?php
 require("footer.inc.php");
 ?>
index 03502b6..1347f31 100644 (file)
@@ -6,15 +6,17 @@ require("header.inc.php");
 <table>
 <tr>
   <th>id</th>
+  <th>type</th>
   <th>path</th>
 </tr>
 
 <?php
-$res = mysql_query("select id,path from file where type='page'");
-while (list($id,$path)=mysql_fetch_row($res)) {
+$res = mysql_query("select id,path,type from file");
+while (list($id,$path,$type)=mysql_fetch_row($res)) {
 ?>
-<tr>
+<tr<?php if ($type=="dead") echo ' bgcolor="red"'; ?>>
   <td><?php echo $id; ?></td>
+  <td><?php echo $type; ?></td> 
   <td><a href="file.php?id=<?php echo $id; ?>"><?php echo $path; ?></a></td>
 </tr>
 <?php