Try to learn something about everything, and everything about somethingThomas Huxley “Darwin's bulldog” (1824-1895)

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:computers:dokuwiki_tweaks [18/04/26 19:28 BST] – [DokuWiki Tweaks] johnpublic:computers:dokuwiki_tweaks [19/04/26 16:02 BST] (current) – [Hide Revisions and Page Source for not-logged in Users] john
Line 3: Line 3:
 ====== DokuWiki Tweaks ====== ====== DokuWiki Tweaks ======
  
 +===== Hide Revisions and Page Source for not-ADMIN in Users =====
 +
 +Edit ''../lib/tpl/monobook/conf/tabs.php'' to add the check of ''AUTH_ADMIN'' for the tabs for Page Source and Revisions
 +
 +<code php>
 + 
 +            if(!empty($INFO["exists"])){
 +                $_monobook_tabs["ca-edit"]["text"] = $lang["btn_edit"]; //language comes from DokuWiki core
 +            }else{
 +                $_monobook_tabs["ca-edit"]["text"] = $lang["btn_create"]; //language comes from DokuWiki core
 +            }
 +        }
 +    }elseif (actionOK("source") && (auth_quickaclcheck($ID) == AUTH_ADMIN)){ //check if action is disabled and also that AUTH_ADMIN is logged in
 +        $_monobook_tabs["ca-edit"]["text"     = $lang["btn_source"]; //language comes from DokuWiki core
 +        $_monobook_tabs["ca-edit"]["accesskey"] = "E";
 +    }
 +
 +
 +    //old versions/revisions tab
 +    if (!empty($INFO["exists"]) &&
 +            actionOK("revisions")
 +        && (auth_quickaclcheck($ID) == AUTH_ADMIN)) // check AUTH_ADMIN is logged in to see old revisions
 +        { //check if action is disabled
 +        //ATTENTION: "ca-history" is used as css id selector!
 +        $_monobook_tabs["ca-history"]["text"     = $lang["btn_revs"]; //language comes from DokuWiki core
 +        $_monobook_tabs["ca-history"]["href"     = wl(cleanID(getId()), array("do" => "revisions"), false, "&");
 +        $_monobook_tabs["ca-history"]["accesskey"] = "O";
 +        if ($ACT === "revisions"){ //$ACT comes from DokuWiki core
 +            $_monobook_tabs["ca-history"]["class"] = "selected";
 +        }
 +
 +</code>
 ===== Include / Blog "Read More..." ===== ===== Include / Blog "Read More..." =====
  

Navigation