You are here

function page_manager_disable_form_submit in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 page_manager/page_manager.admin.inc \page_manager_disable_form_submit()

Disable the page after it has been confirmed.

File

page_manager/page_manager.admin.inc, line 1827
Administrative functions for the page manager.

Code

function page_manager_disable_form_submit(&$form, &$form_state) {
  $page =& $form_state['page'];
  if ($function = ctools_plugin_get_function($page->subtask, 'enable callback')) {
    $result = $function($page, TRUE);
    menu_rebuild();
    $form_state['new trail'] = array(
      'actions',
      'enable',
    );

    // We don't want to cause this to cache if it wasn't already. If it was
    // cached, however, we want to update the enabled state.
    if (empty($form_state['page']->changed)) {
      $form_state['do not cache'] = TRUE;
    }
  }
}