3 # lists pages, which were referenced
7 $ewiki_plugins["page"]["WantedPages"] = "ewiki_page_wantedpages";
8 #<off># $ewiki_plugins["page"]["DanglingSymlinks"] = "ewiki_page_wantedpages";
11 function ewiki_page_wantedpages($id, $data, $action) {
13 #-- collect referenced pages
14 $result = ewiki_database("GETALL", array("refs"));
15 while ($row = $result->get()) {
16 if (EWIKI_PROTECTED_MODE
&& EWIKI_PROTECTED_MODE_HIDING
&& !ewiki_auth($row["id"], $uu, "view")) {
19 $refs .= $row["refs"];
23 $refs = array_unique(explode("\n", $refs));
25 #-- strip existing pages from array
26 $refs = ewiki_database("FIND", $refs);
27 foreach ($refs as $id=>$exists) {
28 if (EWIKI_PROTECTED_MODE
&& EWIKI_PROTECTED_MODE_HIDING
&& !ewiki_auth($row["id"], $uu, "view")) {
31 if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
36 // to prevent empty <ul></ul> getting printed out, we have to interate twice.
37 // once to make sure the <ul></ul> is needed at all.
38 // MDL-7861, <ul></ul> does not validate.
41 foreach ($wanted as $page) {
42 $link = ewiki_link_regex_callback(array($page, $page));
43 if (strstr($link, "?</a>")) {
51 foreach ($wanted as $page) {
53 $link = ewiki_link_regex_callback(array($page, $page));
55 if (strstr($link, "?</a>")) {
56 $o .= "<li>" . $link . "</li>";