changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / interwiki / near.php
1 <?php
2 /*
3    If a page does not exist in the local Wiki, this plugin tries to link
4    the WikiWord to somewhere else in InterWiki space (directly, without
5    intermediate "this-page-only-exists-on-..." page).
6    - still requires CSS and title= integration
7
8    @feature: near
9    @depends: metadb
10 */
11
12
13 $ewiki_plugins["format_prepare_linking"][] = "ewiki_linking_near1";
14
15
16 function ewiki_linking_near1(&$wsrc) {
17
18     global $ewiki_metadb, $ewiki_links;
19
20     #-- select not-found links
21     $nf = array();
22     foreach ($ewiki_links as $id=>$state) {
23        if (!$state) {
24           $nf[] = $id;
25        }
26     }
27     
28     #-- load metadb, inject URLs into $ewiki_links
29     if (count($nf) && ewiki_metadb::LOAD()) {
30        $nf = ewiki_metadb::FIND($nf);
31        foreach ($nf as $id=>$found) {
32           if ($found) {
33              $ewiki_links[$id] = ewiki_interwiki($found[0]);
34           }
35        }
36        ewiki_metadb::UNLOAD();
37     }
38 }
39
40
41 ?>