[pmwiki-users] Feature request: Action lists in skins

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 8 09:30:42 CDT 2005


On Fri, Apr 08, 2005 at 11:37:24AM +0100, Hans wrote:
> > So I first installed a few skins. Found that some of them had actions in
> > them that weren't installed at that point. Cursed - I'd have to remove
> > the action to avoid confusing my friend, then re-install them as soon as
> > I'd get around to installing those recipes that implemented the action.the layout.
> 
> This sounds like bad skin design. The skin should not show any
> features which require special cookbook scripts, it should be all part
> of the skin package.

I agree that Jo experienced some badly designed skins, but I have to 
stop well short of saying that it should therefore be all part of the 
skin package.  (I'm not sure this is exactly what you intended here.)

In particular, consider something like ?action=pdf for generating a
PDF version of a page.  Clearly it makes sense for the action to appear
somewhere in the page, but it'd be wrong to say that the ?action=pdf 
code therefore belongs in the skin package.

> This may be fine indeed, but the exact mechanism for this is not clear
> to me yet. I think I could employ the cookbook script "Authenticated
> as conditional" [...]

My current plan:

PmWiki's default authorization functions are being modified so that
the page structure also contains the current authorizations based on 
the user's credentials at the time of access.  Thus, one will be
able to do things like

    (:if auth edit:) You have edit permission
    (:if auth upload:) You can upload attachments
    (:if auth auth:) You can set page passwords
    (:ifend:)

in the markup.  If we have an "ActionList" page containing actions,
the wikiadmin can write:

    * [[Recent Changes]]
    * [[{$FullName}?action=print | Printable View]]
    * [[{$FullName}?action=diff | Page History]]
    (:if auth edit:)* [[{$FullName}?action=edit | Edit Page]]
    (:if auth upload:)* [[{$FullName}?action=upload | Attachments]](:ifend:)

and the "Edit Page" and "Attachments" links will appear only for people
who are authorized to perform such actions.  In addition, we'll
probably have something like:

    (:if !login:)* [[{$FullName}?action=login | Log In]]
    (:if login:)* Logged in as {$LoginName} -- [[{$FullName}?action=logout | Log Out]]
    (:ifend:)

Pm



More information about the pmwiki-users mailing list