ajout de CSS pour les couleurs
authorJeremy Laine <jeremy.laine@m4x.org>
Sat, 23 Nov 2002 17:39:30 +0000 (17:39 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Sat, 23 Nov 2002 17:39:30 +0000 (17:39 +0000)
choix du tri des fichiers
liste des fichiers dans une page separee
suivi du context courant

depview/depview.css [new file with mode: 0644]
depview/file.php
depview/include/header.inc.php
depview/index.php
depview/list.php [new file with mode: 0644]

diff --git a/depview/depview.css b/depview/depview.css
new file mode 100644 (file)
index 0000000..bd200ec
--- /dev/null
@@ -0,0 +1,25 @@
+/* text definitions */
+body {
+  font-family: Arial,Helvetica,sans-serif;
+}
+
+/* table definitions */
+tr.dead {
+  background-color: red;
+}
+
+tr.image {
+  background-color: yellow;
+}
+
+tr.include {
+  background-color: #00bbff;
+}
+
+tr.page {
+  background-color: #00ffbb;
+}
+
+tr.current {
+  background-color: yellow;
+}
index a0c99a3..dc221d7 100644 (file)
@@ -3,13 +3,17 @@ require("config.inc.php");
 require("header.inc.php");
 $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;
 }
 ?>
 
 <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>
@@ -24,10 +28,10 @@ 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>
+<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
 }
@@ -47,10 +51,10 @@ 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>
+<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
 }
index 678b075..ffe16c9 100644 (file)
@@ -1,2 +1,10 @@
-<html>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>depview</title>
+<link href="depview.css" rel="STYLESHEET" type="text/css" />
+</head>
 <body>
+
index 1347f31..10d2ddd 100644 (file)
@@ -3,26 +3,11 @@ require("config.inc.php");
 require("header.inc.php");
 ?>
 
-<table>
-<tr>
-  <th>id</th>
-  <th>type</th>
-  <th>path</th>
-</tr>
+<h1>depview main menu</h1>
 
-<?php
-$res = mysql_query("select id,path,type from file");
-while (list($id,$path,$type)=mysql_fetch_row($res)) {
-?>
-<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
-}
-?>
-</table>
+<ul>
+  <li><a href="list.php">file list</a></li>
+</ul>
 
 <?php
 require("footer.inc.php");
diff --git a/depview/list.php b/depview/list.php
new file mode 100644 (file)
index 0000000..cd1ee4b
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+require("config.inc.php");
+require("header.inc.php");
+switch ($order) {
+  case "i":
+    $sql_suffix = "order by id";
+    break;
+  case "t":
+    $sql_suffix = "order by type";
+    break;
+  case "p":
+  default:
+    $sql_suffix = "order by path";
+    break;
+}
+?>
+
+<table>
+<tr>
+  <th><a href="<?php echo $PHP_SELF; ?>?order=i">id</a></th>
+  <th><a href="<?php echo $PHP_SELF; ?>?order=t">type</a></th>
+  <th><a href="<?php echo $PHP_SELF; ?>?order=p">path</a></th>
+</tr>
+
+<?php
+$res = mysql_query("select id,path,type from file $sql_suffix");
+while (list($id,$path,$type)=mysql_fetch_row($res)) {
+?>
+<tr class="<?php echo $type; ?>">
+  <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
+}
+?>
+</table>
+
+<?php
+require("footer.inc.php");
+?>