drupal - Is it possible to set a module's checkbox to "readonly"? -


I am writing security modules to enable some modules for a multizite dropup setup. Right now, we can easily disable the modules form using the following snippet.

We want to set the read-only form elements and then enable the ability to enable / disable only one subset.

ex> function disable_form_fields_form_alter (and $ form, $ form_state, $ form_id) {// Get the handle on the DRPL user var global $ user; // If we are UID == 1 then we can edit this stuff ... if ($ user-> UID! = 1 & amp; variable_get ('osu_update_lockdown', 1) == 1 ) {If ($ form_id == 'system_modules') {// Not all modules have been disabled $ module_to_disabled = array_diff_key ($ form ['status'] ['# options'], array_flip ($ form ['status'] ['# Disabled_modules'])); // Not in our disabled list, it adds as foreach ($ modules_to_disabled $ name = & gt; $ value) {$ form ['status'] ['# disabled_modules'] [] = $ name; } // disable non-checkbox foreign currency ($ form ['position'] ['# option'] as $ key => $ val) {$ form ['status'] ['# process'] ['System_modules_disable'] [0] [] = $ key; } / Inactive check box Foreign currency ($ form ['status'] [' # default_value '] as $ key = & gt; $ val) {$ form [' status'] ['# process'] [' system_modules_disable '] [0] [] = $ val; } Unset ($ form ['button'] ['submit']); }}}}

You tried with elements with '' = = FALSE properties is ?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -