OOPS, you have been faster than me.... :-)
cool thing with expressions!
Regards
Am 16.11.2006 um 14:26 schrieb Robin Elfrink:
Edgar Bueltemeyer wrote:
<roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" *condition="session:username:test"*/>
I took your path and added support for expressions. In the above
example it would be:condition="session:username==test"
Robin Index: program/include/main.inc =================================================================== --- program/include/main.inc (revision 369) +++ program/include/main.inc (working copy) @@ -1135,6 +1135,23 @@ $command = strtolower($command); $attrib = parse_attrib_string($str_attrib) + $add_attrib;
- // check if tag is conditional
- if ($attrib['condition'] &&
preg_match('/^(session|config):([a-zA-Z0-9_]+)([=<>!]+)(.*)
$/', $attrib['condition'], $condition))
- {
switch ($condition[1])
{
case 'session':
if (!eval("return (\$_SESSION['" . $condition[2] .
"']" . $condition[3] . "'" . $condition[4] . "');"))
$command = 'none';
break;
case 'config':
if (!eval("return (\$CONFIG['" . $condition[2] . "']" .
$condition[3] . "'" . $condition[4] . "');"))
$command = 'none';
break;
}
- }
- // execute command switch ($command) {
Index: skins/default/templates/mail.html
--- skins/default/templates/mail.html (revision 369) +++ skins/default/templates/mail.html (working copy) @@ -45,6 +45,7 @@ id="messagelist" cellspacing="0" summary="Message list"
- condition="config:drafts_mbox==Drafts" messageIcon="/images/icons/dot.png" unreadIcon="/images/icons/unread.png" deletedIcon="/images/icons/deleted.png"