changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / mpi / mpi_redirectlinks.php
1 <?php
2
3 /*
4    <?plugin RedirectLinks to="WardsWiki" ?>
5
6    will make ALL WikiWords of the current page link to the according
7    pages on another Wiki (see intermap), see also FallBack plugin
8 */
9
10
11 $ewiki_plugins["mpi"]["redirectlinks"] = "ewiki_mpi_redirectlinks";
12 $ewiki_plugins["format_prepare_linking"][] = "ewiki_redirect_links_iw";
13
14
15 function ewiki_mpi_redirectlinks($action, $args, &$s, &$iii) {
16    global $ewiki_config;
17    if (($to = $args["to"]) || ($to = $args[0])) {
18       $ewiki_config["links_redirect_iw"] = ewiki_array($ewiki_config["interwiki"], $to);
19    }
20 }
21
22 function ewiki_redirect_links_iw(&$src) {
23    global $ewiki_config, $ewiki_links;
24    foreach ($ewiki_links as $i=>$v) {
25       if (!strpos($v, "://") && !strpos($i, ":")) {
26          $ewiki_links[$i] = $ewiki_config["links_redirect_iw"] . urlencode($i);
27       }
28    }
29 }
30
31 ?>