[pmwiki-users] quick link for editing another page next to the other page's link in displayed page
Petko Yotov
5ko at 5ko.fr
Sun Sep 16 10:18:53 CDT 2012
tamouse mailing lists writes:
> I like how a tiny question mark is displayed next to a link when the
> page it's pointing to doesn't exist yet. I'd like to replicate when
> the page exists, but only if the reader is authorized to edit the
> page.
The HTML snippets are in the variables $LinkPageExistsFmt and
$LinkPageCreateFmt, but it is a little tricky to modify them depending on
the permissions of a visitor for the "link target" page. It may be possible
to change the link format based on the permissions to edit the "current"
page rather than the "link target" page. Something like this near the END of
config.php:
if(CondAuth($pagename, 'edit')) {$LinkPageExistsFmt = "your HTML here";}
At any rate, if a visitor doesn't have edit permissions and clicks on such
an ?action=edit link, will only see a login form.
Petko
More information about the pmwiki-users
mailing list