-2
function ts_core_form_menu_overview_form_alter (&$form, &$form_state, $form_id) {
  $form['mlid:11242']['hidden']['#type'] = 'hidden';
  $form['mlid:11246']['hidden']['#type'] = 'hidden';
  $form['mlid:11249']['hidden']['#type'] = 'hidden';
  $form['mlid:11250']['hidden']['#type'] = 'hidden';
  $form['mlid:11252']['hidden']['#type'] = 'hidden';
  $form['mlid:11253']['hidden']['#type'] = 'hidden';
  $form['mlid:11254']['hidden']['#type'] = 'hidden';
  $form['mlid:11255']['hidden']['#type'] = 'hidden';
  $form['mlid:11256']['hidden']['#type'] = 'hidden';
  $form['mlid:11257']['hidden']['#type'] = 'hidden';
  $form['mlid:11258']['hidden']['#type'] = 'hidden';
  $form['mlid:11262']['hidden']['#type'] = 'hidden';
  $form['mlid:11263']['hidden']['#type'] = 'hidden';
  $form['mlid:11264']['hidden']['#type'] = 'hidden';
  $form['mlid:11265']['hidden']['#type'] = 'hidden';
  $form['mlid:11285']['hidden']['#type'] = 'hidden';
  $form['mlid:11286']['hidden']['#type'] = 'hidden';
  $form['mlid:11287']['hidden']['#type'] = 'hidden';
  $form['mlid:11290']['hidden']['#type'] = 'hidden';
  $form['mlid:16459']['hidden']['#type'] = 'hidden';
  $form['mlid:6698']['hidden']['#type'] = 'hidden';
  $form['mlid:11241']['hidden']['#type'] = 'hidden';
  $form['mlid:11267']['hidden']['#type'] = 'hidden';
  $form['mlid:11243']['hidden']['#type'] = 'hidden';
  $form['mlid:16969']['hidden']['#type'] = 'hidden';
}
1
  • You can generally loop in every way that PHP provides you with. I think you might want to explain your specific use case (why do you want to hide those checkboxes from the menu overview page, are those the "enabled" checkboxes?) as well as the specific source of that list of mlids that you want to hide. If you want to hide the full column, then you should update your question or ask a new one, as that is an important difference to other users here trying to help you.
    – berliner
    Feb 15 at 20:26

1 Answer 1

0

function ts_core_form_menu_overview_form_alter (&$form, &$form_state { $dest = drupal_get_destination(); //call back function to

if ($dest['destination'] == 'homepage_rbf') return; // query string search foreach ($form as $key => $item ) { if (strpos($key, 'mlid') === 0) { $form[$key]['hidden']['#type'] = 'hidden'; } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.