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
--- 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;
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;
}
--- 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"