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 [19/04/26 15:49 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-logged in Users =====+===== 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 Edit ''../lib/tpl/monobook/conf/tabs.php'' to add the check of ''AUTH_ADMIN'' for the tabs for Page Source and Revisions
  
 <code php> <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     //old versions/revisions tab
     if (!empty($INFO["exists"]) &&     if (!empty($INFO["exists"]) &&
             actionOK("revisions")             actionOK("revisions")
-        && (auth_quickaclcheck($ID) == AUTH_ADMIN))+        && (auth_quickaclcheck($ID) == AUTH_ADMIN)) // check AUTH_ADMIN is logged in to see old revisions
         { //check if action is disabled         { //check if action is disabled
         //ATTENTION: "ca-history" is used as css id selector!         //ATTENTION: "ca-history" is used as css id selector!
Line 21: Line 33:
             $_monobook_tabs["ca-history"]["class"] = "selected";             $_monobook_tabs["ca-history"]["class"] = "selected";
         }         }
-         
-</code> 
- 
-<code php> 
- 
- }elseif (actionOK("source") && (auth_quickaclcheck($ID) == AUTH_ADMIN)){ //check if action is disabled 
-        $_monobook_tabs["ca-edit"]["text"     = $lang["btn_source"]; //language comes from DokuWiki core 
-        $_monobook_tabs["ca-edit"]["accesskey"] = "E"; 
  
 </code> </code>

Navigation