remove other link on select widget:type

Archived from the Xataface Users forum.

fantomasdm — Mon May 14, 2012 5:26 am

is it possible to remove other link on widget with type select?


shannah — Tue May 15, 2012 9:51 am

Currently the only way to remove this is with permissions. If you deny the user the ‘new’ permission to the table from which the valuelist is built (i.e. the table where records are inserted by clicking the “other” link”, then the link won’t appear..


jimr451 — Tue May 15, 2012 11:34 am

Thanks - I put this function in my class file:

Code: Select all
<? class tables_categories {       function getPermissions(&$record){        return Dataface_PermissionsTool::READ_ONLY();    } }    ?>

Note - I don’t need any editing on that table so I set this broadly.


fantomasdm — Tue May 15, 2012 11:57 pm

I’m using this code for table that popolate valuelist:

Code: Select all
class tables_users { function getPermissions(&$record) {    $auth=& Dataface_AuthenticationTool::getInstance();    $user =& $auth->getLoggedInUser();    if ( !$user ) return Dataface_PermissionsTool::NO_ACCESS();    if ( $user )    {       $perm=Dataface_PermissionsTool::getRolePermissions($user->val('role'));       if($_GET['-table'] =="protocolli")          $perm['new']=0;       return $perm ;    } } }

Now only from table that using widget:type=select (protocolli’s table) new is not possible!