If.pm
NAME
Communiware::DE::If - Dynamic element If. Implement conditional statement
SYNOPSIS
<:If condition:> html text, may be with other DE's including nested If <:Else:> html text, may be with other DE's including nested If <:EndIf:> Else part is optional
DESCRIPTION
Condition can have one of following form.
- ATTRIBUTE
- false, if attribute is not defined in context, or contain 0 or empty string
- LINKTYPE
- where linktype is name of the link type (including metalink). Returns true if link of given name exists between current user and current item, same as context function RIGHTS(LINKTYPE).
- ACCESS
- where ACCESS is literal word ACCESS. True, if current user have right to access given item (same as RIGHTS(ACCESS).
- LOGICAL EXPRESSION
- Logical expression as described in the Communiware::Expr documentation, which may occupy more than one parameter.
-
Note that in difference of all other dynamic elements, which use logical expressions, If treates first operand (even if it preceeded by negation operator) specially. This operand should be name of attribute, rather than substituted value, and it would be substituted by If authomatically.
-
If attribute name is STATUS or USER_STATUS, than If uses numeric ordnums of statuses for comparation, thus allowing to compare statuses for greater and less semantically rather than lexicographically.
16 октябрь 2007 13:44