<? include_once("include/xrai.inc"); $id_topic=$_REQUEST["id_topic"]; print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?> <html><head><title>INEX - View topic n<? print $id_topic; ?> view</title> <link rel="stylesheet" href="style.css"/> <body> <? if ($id_topic > 0) { // print "<h1>Topic n$id_topic</h1>"; $xslfile = dirname(__FILE__) . "/xsl/topic.xsl"; if (!$xslt) print "<div class='error'>No XSLT processor defined !</div>"; $a = $xrai_db->getRow("SELECT definition FROM $db_topics WHERE id=?",array($id_topic),DB_FETCHMODE_ARRAY); if (!DB::isError($a)) { $params = array("/_xml" => $a[0]); print xslt_process($xslt,"arg:/_xml","$xslfile", NULL, $params); } else { non_fatal_error("Could not retrieve topic n°$id_topic definition",$a->getUserInfo()); } print "<div><a href='javascript:window.close()'>Close window</a></div>"; } else { print "No topic defined.<br/>"; } ?> </body> </html>
} } else { print "<ul>"; while ($row = $qh->fetchRow(DB_FETCHMODE_ASSOC)) { $name = "Pool for topic {$row['idtopic']}" . ($is_root ? " ({$row['login']})" : ""); print "<li><a href='pool.php?id_pool={$row['id']}'>{$name}</a></li>"; } print "</ul>"; } ?> <h1>Browse the collections</h1> <?php $ch = $xrai_db->query("SELECT collection, title FROM {$db_files} WHERE parent is null ORDER BY title"); if (DB::isError($ch)) { non_fatal_error("Could not retrieve collections", $ch->getUserInfo()); } else { while ($row = $ch->fetchRow(DB_FETCHMODE_ASSOC)) { print "<div>"; print " <a id='{$row['id']}' href=\"collections/{$row['collection']}\">" . htmlspecialchars($row["title"]) . "</a>"; print "</div>"; } } ?> </body> </html>
$i = sizeof($localisation); do { if (DB::isError($row)) { fatal_error("Database error", $row->getUserInfo()); } array_splice($localisation, $i, 0, array(array($row["filename"] != "" ? $row["filename"] : $row["collection"], "{$base_url}/collections/{$row['collection']}/{$row['filename']}?id_pool={$id_pool}", $row["title"]))); } while ($row["parent"] > 0 && ($row =& $xrai_db->getRow("SELECT * FROM {$db_files} WHERE id=?", array($row["parent"])))); $up_url = $localisation[sizeof($localisation) - 2][1]; make_header("{$title}"); $xslfilename = dirname(__FILE__) . "/xsl/{$xslname}.xsl"; $xmlfilename = "{$xml_documents}/{$_SERVER['PATH_INFO']}/index.xrai"; // --- Retrieve assessments --- if ($id_pool) { $res =& $xrai_db->query("SELECT * FROM {$db_statusview} WHERE rootid=? AND idpool={$id_pool}", array($rootid)); if (DB::isError($res)) { non_fatal_error("Error while retrieving assessments", $res->getUserInfo()); } else { while ($row = $res->fetchRow()) { $s = ($row["status"] == 2 ? 2 : 1) * ($row["inpool"] == $db_true ? 1 : -1); $assessments[$row["filename"]][$s] = $row["count"]; $all_assessments[$s] += $row["count"]; if (abs($row["status"]) != 3 && $row["count"] > 0) { $todojs .= ($todojs ? "," : "todo = new Array(") . "'{$row['filename']}'"; } } $res->free(); } } // Process XML file with stylesheet (if not in cache) // ================================================== function get_full_path($base, $path)