changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / page / wantedpages.php
1 <?php
2
3 /*
4    -- OBSOLETED by according spages/ plugin --
5    lists pages which were referenced but not yet written
6 */
7
8
9 $ewiki_plugins["page"]["WantedPages"] = "ewiki_page_wantedpages";
10 #<off># $ewiki_plugins["page"]["DanglingSymlinks"] = "ewiki_page_wantedpages";
11
12
13 function ewiki_page_wantedpages($id, $data, $action) {
14
15     #-- collect referenced pages
16     $result = ewiki_db::GETALL(array("refs"));
17     while ($row = $result->get()) {
18         if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
19             continue;
20         }   
21         $refs .= $row["refs"];
22     }
23
24    #-- build array
25    $refs = array_unique(explode("\n", $refs));
26
27    #-- strip existing pages from array
28    $refs = ewiki_db::FIND($refs);
29     foreach ($refs as $id=>$exists) {
30         if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
31             continue;
32         }   
33         if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
34             $wanted[] = $id;
35         }
36     }
37
38    #-- print out
39    $o .= "<ul>\n";
40    foreach ($wanted as $page) {
41
42       $o .= "  <li>" . ewiki_link($page) . "</li>\n";
43
44    }
45    $o .= "<ul>\n";
46
47    return($o);
48 }
49
50
51 ?>