Sources for file plugins/smarty/block.access.php in version 2.0 Release Candidate 2
Click on a comment to hide it. Click here to show all comments.
/*
* Smarty plugin - Onyx: PHP Application Backend
* -------------------------------------------------------------
* Type: block function
* Name: access
* Purpose: display contents only if access is permitted
* Arguments: acl - comma delimited list of groups/users allowed to access
* -------------------------------------------------------------
*/
function smarty_block_access($args, $content, $this)
{
global $access;
if (!is_null($content)) {
// split it, for our else situation
$content = explode('<::ONYX::ACCESS::FUNCTION::SPLIT>', $content);
if ($access->check($this->_tag_stack[0][1]['acl']))
echo $content[0];
else
echo $content[1];
}
}
/* vim: set expandtab: */
?>
