[pmwiki-users] How to use if ($page['=auth']['edit'])

Tom Lederer celok at gmx.net
Sat Sep 9 15:27:02 CDT 2006


Hi all,
after reading http://www.pmwiki.org/wiki/Cookbook/ 
ConditionalMarkupSamples
i assumed that i could use if ($page['=auth']['edit']) in a file:

What i try to do is

Markup("taghead",       "directives", '/\\(:markupname:\\)/ 
ei',        'Keep(MarkupFunction())');

this should display different things to a editor than to a reader. So  
i did:

function MarkupFunction() {
     global $pagename,$ScriptUrl;
     $page = RetrieveAuthPage($pagename, 'read', false,  
READPAGE_CURRENT);
     if ($page['=auth']['edit']) {
	return "You have edit rights.";	
     }
     else {
	return "Read only.";
     }
}

i also tried:     $page = RetrieveAuthPage($pagename, 'edit', false,  
READPAGE_CURRENT);

However, it always displays the "You have edit rights."

Does anyone spot an error, or can tell me how to accomplish this?

Best Regards,
Tom


-- 

Tom
http://www.celok.de
http://www.frappr.com/celok






More information about the pmwiki-users mailing list