AnsweredAssumed Answered

disable subpanel button in 6.5

Question asked by jlabuelo on Jun 7, 2015
Latest reply on Jun 8, 2015 by Dhaivat Naik
Hi there

I am trying to disable the subpanels "Select" button and the "Quick Create", for a custom Module I have created, following the instructions that I have found in this forum.... 

My first approach was modifying the layoutdefs.ext.php removing the button options. Te file is located in custom/modules/My_Module/Ext/Layoutdefs/



$layout_defs["R2_Microchip"]["subpanel_setup"]['r2_microchip_r2_vacina_1'] = ar$
  'order' => 100,
  'module' => 'R2_Vacina',
  'subpanel_name' => 'default',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_R2_MICROCHIP_R2_VACINA_1_FROM_R2_VACINA_TITLE',
  'get_subpanel_data' => 'r2_microchip_r2_vacina_1',
);

I did this for all the subpanels present in the file. The problem is that if I click "Repair and Rebuild", the file layoutdefs.ext.php gets back to the original values, having the code lines that show the Select and Create button I want to disable. I have tried to modify the permissions of the file moving then to 555... but still after Quick Repair and Rebuild, nothing happens and the buttons are still there.

My second option was trying to add this code line in the view.detail.php in custom/modules/My_Module/Views/view.detail.php

 $subpanel = new SubPanelTiles($this->bean, $this->module);
 $subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanel_name]['top_buttons'] = array();
                        $subpanel->subpanel_definitions->layout_defs['subpanel_setup']['r2_microchip_cases_1']['top_buttons'] = array();


However still nothing happens after "Quick Repair and Rebuild". 

Could please someone give me some advise about how can I disable the buttons of the subpanels esasily for a custom module?

Btw we are using Community 6.5 Thanks a lot!

Outcomes