changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / linking / targets.php
1 <?php
2
3 /*
4    Using this plugin, you can utilize link target: settings from within
5    wiki. You can either write [target:_parent:WikiWord] or of course
6    also [[target=_blank:http://example.com/...]]. Between target and
7    the window/frame name, both the colon and the equal sign are allowed.
8 */
9
10 $ewiki_plugins["interxhtml"][] = "ewiki_interxhtml_target";
11
12
13 function ewiki_interxhtml_target($prefix, &$page, &$s) {
14    global $ewiki_links;
15
16    if (strtok($prefix, ":=") == "target") {
17       $href_i = strtolower("$prefix:$page");
18       if ($frame = strtok(":=")) {
19          // ok
20       }
21       elseif ($frame = strtok($page, ":")) {
22          $page = strtok("\000");
23       }
24
25       #-- set extra attribute
26       if ($frame) {
27          $s["xhtml"]["target"] = $frame;
28
29          #-- shorten title
30          //$s["title"] = substr($s["title"], strlen($prefix)+1+strlen($frame)+1);
31       }
32       $ewiki_links[$href_i] = 1;
33       
34    }
35 }
36
37
38 ?>