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.
9 define("EWIKI_CONTROL_LINE", 0);
10 define("EWIKI_PRINT_TITLE", 1);
13 $ewiki_plugins["view_final"][] = "ewiki_print_control_line_fancy2";
16 function ewiki_print_control_line_fancy2(&$html, $id,$data,$action) {
17 global $ewiki_plugins, $ewiki_t;
19 #-- extract <h2> with info/ link
20 list($h2, $html) = explode("\n", $html, 2);
22 #-- produce control links
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>";
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> ';
36 if ($data["lastmodified"] >= UNIX_MILLENNIUM) {
37 $cl .= '<br /><small>' . strftime(ewiki_t("LASTCHANGED"), @$data["lastmodified"]) . '</small>';
41 $h2 = str_replace("<h2>", '<h2 style="float:left; margin:5pt;">', $h2);
44 $html = '<div class="controlbox" style="border:2px #333377 solid; background-color:#555599;">'.
46 '<div style="text-align:right;">'.$cl.'</div>'.