You are here

function bean_set_default_confirm_submit in Bean (for Drupal 7) 7

Submit function

File

includes/bean.pages.inc, line 543
Bean Functions

Code

function bean_set_default_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    $bean = $form['#bean'];
    $bean
      ->setDefault()
      ->save();
    watchdog('bean', '@type: %title revision %vid was set active.', array(
      '%vid' => $bean->vid,
      '@type' => $bean
        ->typeName(),
      '%title' => $bean
        ->label(),
    ));
    drupal_set_message(t('@type %title revision %vid has been set active.', array(
      '%vid' => $bean->vid,
      '@type' => $bean
        ->typeName(),
      '%title' => $bean
        ->label(),
    )));
  }
}