Sometimes you don't want a tab to appear in the view of a record. You can set the permissions of this like this:
function __tabs__(&$record){
$user =& getUser();
$t =& $record->_table;
$tabs = $t->_tabs;
if ( $record and !isAdmin() ){
if ( !$record->val('people_approval_status') )
unset($tabs['__people__']);
if ( !$record->val('researcher_approval_status') )
unset($tabs['__gcms__']);
}
return $tabs;
}
Here we call the __tabs__ function to actually process the tabs before they are run. And then we unset the tabs that we don't want the user to see.
No comments:
Post a Comment