You are here

function skinr_ui_admin_skins_submit in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr_ui/skinr_ui.admin.inc \skinr_ui_admin_skins_submit()
  2. 6.2 skinr_ui.admin.inc \skinr_ui_admin_skins_submit()

Form submission handler for skinr_ui_list().

Execute the chosen 'Update option' on the selected skinr settings.

1 string reference to 'skinr_ui_admin_skins_submit'
skinr_ui_admin_skins in ./skinr_ui.admin.inc
Form builder: Builds the skin configuration administration overview.

File

./skinr_ui.admin.inc, line 546
Admin page callbacks for the Skinr UI module.

Code

function skinr_ui_admin_skins_submit($form, &$form_state) {
  $operations = module_invoke_all('skinr_ui_operations');
  $operation = $operations[$form_state['values']['operation']];

  // Filter out unchecked nodes
  $skins = array_filter($form_state['values']['skins']);
  if ($function = $operation['callback']) {

    // Add in callback arguments if present.
    if (isset($operation['callback arguments'])) {
      $args = array_merge(array(
        $skins,
      ), $operation['callback arguments']);
    }
    else {
      $args = array(
        $skins,
      );
    }
    call_user_func_array($function, $args);
    cache_clear_all();
  }
  else {

    // We need to rebuild the form to go to a second step. For example, to
    // show the confirmation form for the deletion of nodes.
    $form_state['rebuild'] = TRUE;
  }
}