changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / aview / control2.php
1 <?php
2
3 # This plugin adds a fancy (CSS) control link box to the top of each
4 # page, including and next (right) to the PageTitle. The old control
5 # line is disabled to achieve this.
6 # ... as seen on a system, which appeared to be some CVS frontend.
7
8
9 define("EWIKI_CONTROL_LINE", 0);
10 define("EWIKI_PRINT_TITLE", 1);
11
12
13 $ewiki_plugins["view_final"][] = "ewiki_print_control_line_fancy2";
14
15
16 function ewiki_print_control_line_fancy2(&$html, $id,$data,$action) {
17    global $ewiki_plugins, $ewiki_t;
18
19    #-- extract <h2> with info/ link
20    list($h2, $html) = explode("\n", $html, 2);
21
22    #-- produce control links
23    $cl = "";
24    if (!empty($data["forced_version"])) {
25       $cl = '<a href="'.ewiki_script("edit", $id,
26             array("version"=>$data["forced_version"], "edit"=>"old")).
27             '">'.ewiki_t("OLDVERCOMEBACK")."</a>";
28    }
29    else {
30       foreach ($ewiki_config["action_links"]["view"] as $action => $title) if (!empty($ewiki_plugins["action"][$action])) {
31          if (EWIKI_PROTECTED_MODE && (!ewiki_auth($uu, $uu, $action) || EWIKI_PROTECTED_MODE_HIDING && empty($ewiki_ring))) { continue; }
32          $cl .= '<a href="'.ewiki_script($action,$id).'">'.$title.'</a> ';
33       }
34    }
35
36    if ($data["lastmodified"] >= UNIX_MILLENNIUM) { 
37       $cl .= '<br /><small>' . strftime(ewiki_t("LASTCHANGED"), @$data["lastmodified"]) . '</small>';
38    }
39
40    #-- change <h2>
41    $h2 = str_replace("<h2>", '<h2 style="float:left; margin:5pt;">', $h2);
42
43    #-- output
44    $html = '<div class="controlbox" style="border:2px #333377 solid; background-color:#555599;">'.
45            "$h2\n".
46            '<div style="text-align:right;">'.$cl.'</div>'.
47            "</div>\n".
48            $html;
49
50 }
51
52
53 ?>