<?php
require("config.inc.php");
require("header.inc.php");
+
+/* validate parameters */
+if (!isset($_REQUEST['id'])) {
+ echo "no file specified";
+ include("footer.inc.php");
+ exit;
+}
+$id = $_REQUEST['id'];
$res = mysql_query("select path from file where id=$id");
if (!list($page)=mysql_fetch_row($res)) {
- echo "page not found";
+ echo "file $id not found";
include("footer.inc.php");
exit;
}
+$d = isset($_REQUEST['d']) ? $_REQUEST['d'] : 0;
?>
<h1>Dependencies for <?php echo $page; ?></h1>
+<p>
+ Current context is highlighted in yellow.<br />
+ <a href="list.php">back to file list</a>
+</p>
<h2>files that <?php echo $page; ?> depends on</h2>
<table>
$res2 = mysql_query("select path from dir where id=$dir");
list($dirname)=mysql_fetch_row($res2);
?>
-<tr>
+<tr <?php if ($d==$dir) echo 'class="current"'; ?>>
<td><?php echo $type; ?></td>
<td><?php echo $dirname; ?></td>
- <td><a href="file.php?id=<?php echo $cid; ?>"><?php echo $cpath; ?></a></td>
+ <td><a href="file.php?id=<?php echo $cid; ?>&d=<?php echo $dir; ?>"><?php echo $cpath; ?></a></td>
</tr>
<?php
}
$res2 = mysql_query("select path from dir where id=$dir");
list($dirname)=mysql_fetch_row($res2);
?>
-<tr>
+<tr <?php if ($d==$dir) echo 'class="current"'; ?>>
<td><?php echo $type; ?></td>
<td><?php echo $dirname; ?></td>
- <td><a href="file.php?id=<?php echo $pid; ?>"><?php echo $ppath; ?></a></td>
+ <td><a href="file.php?id=<?php echo $pid; ?>&d=<?php echo $dir; ?>"><?php echo $ppath; ?></a></td>
</tr>
<?php
}