Module:
... $this->registerHook('actionAdminControllerSetMedia'); public function hookActionAdminControllerSetMedia($params) { $modules = array('ps_facetedsearch', 'contactform', $this->name); if($this->context->controller->controller_name == 'AdminModules' && in_array(Tools::getValue('configure'), $modules)) { $jsDef = []; foreach ($modules as $module){ if ($module == 'ps_facetedsearch'){ $jsDef = [ 'button_back' => 'show', 'button_translate' => 'hide', 'button_update' => 'hide', 'button_hooks' => 'hide', ]; } if ($module == 'contactform'){ $jsDef = [ 'button_back' => 'hide', 'button_translate' => 'hide', 'button_update' => 'hide', 'button_hooks' => 'hide', ]; } if ($module == $this->name){ $jsDef = [ 'button_back' => 'show', 'button_translate' => 'show', 'button_update' => 'hide', 'button_hooks' => 'show', ]; } } Media::addJsDef($jsDef); $this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/admin.js'); } }
and javascript:
$(document).ready(function(){ if (button_back == 'hide') { document.getElementById('desc-module-back').style.display = 'none'; }; if (button_translate == 'hide') { document.getElementById('desc-module-translate').style.display = 'none'; }; if (button_update == 'hide') { document.getElementById('desc-module-update').style.display = 'none'; }; if (button_hooks == 'hide') { document.getElementById('desc-module-hook').style.display = 'none'; }; });