changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / linking / link_css.php
1 <?php
2
3 /*
4  this _link_regex_callback() plugin includes the correct css
5  class names into the <a> links generated by ewiki_format()
6
7  known classes (always lowercase):
8   <a class="wikipage" href="...">
9   <a class="binary" href="...">
10   <b class="notfound">...</b><a class="notfound" href="...">
11   <a class="email" href="...">
12   <a class="anchor" href="...">
13   <a class="http" href="..."> and all others
14   <a class="interwiki" href="...">
15   <a class="meatball" href="..."> and all others
16 */
17
18
19
20 $ewiki_plugins["link_final"][] = "ewiki_link_css";
21
22
23
24 function ewiki_link_css(&$html, $type, $href, $title) {
25
26    if (count($type)) {
27
28       ksort($type);
29
30       $classes = strtolower(implode(" ", $type));
31
32       if (strpos(">?</a>", $html)) {
33          $html = str_replace("<b ", '<b class="'.$classes.'" ', $html);
34       }
35
36       if (!strpos($type, "image")) {
37          $html = str_replace("<a ", '<a class="'.$classes.'" ', $html);
38       }
39    }
40 }
41
42
43 ?>