You are here

function page_manager_save_task_handler in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 page_manager/page_manager.module \page_manager_save_task_handler()

Write a task handler to the database.

2 calls to page_manager_save_task_handler()
page_manager_page_save in page_manager/plugins/tasks/page.inc
Write a page subtask to the database.
page_manager_save_page_cache in page_manager/page_manager.module
Write all changes from the page cache and clear it out.

File

page_manager/page_manager.module, line 583
The page manager module provides a UI and API to manage pages.

Code

function page_manager_save_task_handler(&$handler) {
  $update = isset($handler->did) ? array(
    'did',
  ) : array();

  // Let the task handler respond to saves:
  if ($function = ctools_plugin_load_function('page_manager', 'task_handlers', $handler->handler, 'save')) {
    $function($handler, $update);
  }
  drupal_write_record('page_manager_handlers', $handler, $update);
  db_query("DELETE FROM {page_manager_weights} WHERE name = '%s'", $handler->name);

  // If this was previously a default handler, we may have to write task handlers.
  if (!$update) {

    // @todo wtf was I going to do here?
  }
  return $handler;
}