Skip to content

Instantly share code, notes, and snippets.

@chicks
Last active December 17, 2015 03:38
Show Gist options
  • Save chicks/5544412 to your computer and use it in GitHub Desktop.
Save chicks/5544412 to your computer and use it in GitHub Desktop.
Limit which subpanels are displayed by a custom field on User
<?php
// Put this in: custom/modules/Accounts/Layoutdefs/layoutdefs.ext.php
global $current_user;
$edition = $current_user->edition_c;
if ( $edition == "Basic" ) {
unset($layout_defs['Accounts']['subpanel_setup']['documents']);
unset($layout_defs['Accounts']['subpanel_setup']['quotes']);
}
if ( $edition == "Standard" ) {
unset($layout_defs['Accounts']['subpanel_setup']['quotes']);
}
<?php
// Put this in: custom/modules/Users/Ext/Vardefs/vardefs.ext.php
$dictionary['User']['fields']['edition_c']['enforced']='';
$dictionary['User']['fields']['edition_c']['dependency']='';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment