You are here

function empty_page_callbacks_form_submit in Empty Page 7

Form submit handler for adding / editing an Empty Page callback.

_state

Parameters

array $form:

File

./empty_page.admin.inc, line 173
Administrative functionality for Empty Page module.

Code

function empty_page_callbacks_form_submit($form, &$form_state) {
  $is_existing_callback = isset($form_state['values']['empty_page_callback_cid']);
  $callback = new stdClass();
  if ($is_existing_callback) {

    // We're editing an existing callback.
    $callback->cid = $form_state['values']['empty_page_callback_cid'];
  }
  else {

    // This is a new editor.
    $callback->created = REQUEST_TIME;
  }
  $data = array();
  $callback->path = $form_state['values']['empty_page_callback_path'];
  $callback->page_title = $form_state['values']['empty_page_callback_page_title'];

  // TODO: Handle saving of custom perms.
  $callback->changed = REQUEST_TIME;
  empty_page_save_callback($callback);
  empty_page_clear_menu_cache();
  drupal_set_message(t('Changes saved.'));
  $redirect = 'admin/structure/empty-page';
  drupal_goto($redirect);
}