00696: "action" conditonal

Summary: "action" conditonal
Created: 2006-03-11 19:21
Status: Closed - added action page variable in 2.1.4
Category: Feature
From: Sebastian Pipping
Assigned:
Priority: 3
Version: 2.1
OS: 0

Description:
Please add an action conditional (:if action ACTION:).
This would allow very mode systems from simple to very complex.
For example just hiding the edit button using (:if !action edit:) and so on.
I am using this workaround with PmWiki 2.0.13 right now but I would love to see this officially included:

$_GET["action"] = $action;
$Conditions['action'] = '\$_GET["action"]==\$condparm';

Thanks in advance, Sebastian


I've been thinking that we might want an {$Action} page variable, then the if conditional would be

(:if equal {$Action} edit:)

It seems to me that using {$Action} in this way might be more generic and useful in other contexts besides simply conditionals.

Also note that $_GET['action'] is technically not correct, since the action= parameter can come from a 'POST' request or could be modified by a recipe or local customization. Better is probably $GLOBALS['action'].

--Pm


I didn't know about $GLOBALS before. You are right, this is better. I changed my code to

$Conditions['action'] = '\$GLOBALS["action"]==\$condparm';

{$Action} sounds like a good idea.

--Sebastian