Current Record: Xataface - How to unset tabs in the table view #47

News

Current Record: Xataface - How to unset tabs in the table view #47

News

Click to minimize this section Details

News id 47
Headline Xataface - How to unset tabs in the table view
Content Inside of a delegate class' fields.ini file, you can specify the notion of "tabs" and actually put separate fields into their tabs. <br /><br />Sometimes you don't want a tab to appear in the view of a record. You can set the permissions of this like this:<br /><br /><blockquote><br /><br />function __tabs__(&$record){<br /> $user =& getUser();<br /> <br /> $t =& $record->_table;<br /> $tabs = $t->_tabs;<br /> if ( $record and !isAdmin() ){<br /> <br /> if ( !$record->val('people_approval_status') )<br /> unset($tabs['__people__']);<br /> if ( !$record->val('researcher_approval_status') )<br /> unset($tabs['__gcms__']);<br /> }<br /> return $tabs;<br />}<br /></blockquote><br /><br />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.
Image (Empty)
Date posted Wed Apr 23 11:29:00 2008
Posted by noreply@blogger.com (Fong Chun Chan)
Status Approved
Categories Blog
Source id Fong's Blog
Source url http://fongxataface.blogspot.com/2008/04/xataface.html
Powered by Xataface
(c) 2005-2024 All rights reserved