Hi all.
I've found a number of answers to this problem although none of the 'answers' seem to have the complete code and if they do have code the code errors out.
My process, I tested this line of code
unset($layout_defs['Contacts']['subpanel_setup']['cours_crs_fculty_contacts']);
in my custom/Extension/modules/Contacts/Ext/Layoutdefs/layoutdefs.ext.php file and it does exactly what it should do. It hides the custom cours_crs_fculty_contacts subpanel. After I verified that the unset function worked I thought that all I needed to do was 'wrap' it in an if statement that checked the value of my custom field and everything would be sunshine and light, apparently not. The following code:
if($this->bean->crs_type_person_c == 'Faculty') {
unset($layout_defs['Contacts']['subpanel_setup']['cours_crs_fculty_contacts']);
}
errors out with
Undefined property: SubPanelDefinitions::$bean
and then of course the error is
Trying to get property of non-object
This seems to me to be a very elegant method for dynamically hiding subpanels with very little code required and upgrade safe, if it worked!Can anyone tell me if this function can in fact be created here or is it impossible and I'll need to look at a JS enabled solution that will write CSS to the DIV
Thank you for any assistance you can give me


LinkBack URL
About LinkBacks
Can anyone tell me if this function can in fact be created here or is it impossible and I'll need to look at a JS enabled solution that will write CSS to the DIV



Reply With Quote
Bookmarks