You are here

function nd_build_modes_matrix_submit in Node displays 6

Submit build mode matrix form.

1 string reference to 'nd_build_modes_matrix_submit'
nd_buildmodes_matrix_form in includes/nd.buildmodes.inc
Build modes matrix form.

File

includes/nd.buildmodes.inc, line 154
Manage build modes.

Code

function nd_build_modes_matrix_submit($form, &$form_state) {
  $exclude_build_modes = array();
  foreach ($form['#content_types'] as $ckey => $type) {
    $global_exclude = FALSE;
    foreach ($form['#build_modes'] as $bkey => $mode) {

      // Global exclude.
      if ($bkey == 'nd_block_all') {
        $global_exclude = $form_state['values'][$ckey . '-' . $bkey];
        variable_set('nd_contenttype_' . $ckey, $form_state['values'][$ckey . '-' . $bkey]);
        $exclude_build_modes[$ckey][$bkey] = $form_state['values'][$ckey . '-' . $bkey];
      }
      else {
        $value = $global_exclude == TRUE ? $form_state['values'][$ckey . '-' . $bkey . '-disabled'] : $form_state['values'][$ckey . '-' . $bkey];
        $exclude_build_modes[$ckey][$bkey] = $value;
      }
    }
  }
  variable_set('nd_buildmodes_exclude', $exclude_build_modes);
  menu_rebuild();
}