76e92b0b2d133d39a46c7569427485166bd11859
[atutor.git] / mods / wiki / spages / WantedPages.php
1 <?php
2
3 /*
4    lists pages which are referenced but not yet written
5    (AKA "DanglingSymlinks")
6 */
7
8  #-- title
9  echo ewiki_make_title($id, $id, 2);
10
11  #-- collect referenced pages
12  $result = ewiki_db::GETALL(array("refs"));
13  while ($row = $result->get()) {
14      if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
15          continue;
16      }   
17      $refs .= $row["refs"];
18  }
19
20  #-- build array
21  $refs = array_unique(explode("\n", $refs));
22
23  #-- strip existing pages from array
24  $refs = ewiki_db::FIND($refs);
25  foreach ($refs as $id=>$exists) {
26     if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
27        $wanted[] = $id;
28     }
29  }
30
31  #-- print out
32  echo "<ul>\n";
33  foreach ($wanted as $page) {
34
35     echo "  <li>" . ewiki_link($page) . "</li>\n";
36
37  }
38  echo "<ul>\n";
39
40
41 ?>