[pmwiki-users] (conditional markup) if action XXX
noskule
noskule at gmx.net
Tue Mar 7 05:23:47 CST 2006
Patrick R. Michaud schrieb:
>On Mon, Mar 06, 2006 at 09:30:00PM +0100, noskule wrote:
>
>
>>Hi list
>>is there a way to get an conditional markup so I could write
>>
>>(:if !action edit :)* [[{$FullName?action=edit|Edit}]](:if:)
>>(:if !action view :)* [[{$FullName?action=view|View}]](:if:)
>>
>>
>
>Traditionally we have done this by using CSS classes to hide
>the relevant link:
>
> $HTMLStylesFmt['action'] = " .$action { display:none; } ";
>
>
>
this I would prefer insted of the conditional markup. I did see you
added a <li class="edit" . . .
So I could apply a css definition to a skinsection. it could look like:
.wikicmds li.edit { display:none; } or
.wikicmds li.edit a.wikilink{ color:gray; }
so in general every action has (could have) a css class which would
allow it to show/hide it after checking
* is this action allready in use
* show only action that the user hase permission
could this be set in skin.php like
if action=edit
$HTMLStylesFmt['action'] = ".wikicmds li.edit { display:none; }"; #or set to gray
if auth=edit
$HTMLStylesFmt['action'] = ".wikicmds li.edit { display:none; }"; #
or even better, would it be possible to make an "array" with all actions
(edit, attr, diff, ..) that style them after checking the about action
and auth?
>There will eventually be a way to grab parameters (such as action)
>from urls and posted data into markup; I just haven't decided
>the syntax yet. I may decide to use {?action} as a variation on
>page variable markups, such that we get
>
> (:if equal {?action} edit:) ...
> (:if equal {?action} view:) ...
>
>Pm
>
>
>
>
More information about the pmwiki-users
mailing list