You are here

function page_manager_update_task_handler_weight in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 page_manager/page_manager.module \page_manager_update_task_handler_weight()

Set an overidden weight for a task handler.

We do this so that in-code task handlers don't need to get written to the database just because they have their weight changed.

1 call to page_manager_update_task_handler_weight()
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 812
The page manager module provides a UI and API to manage pages.

Code

function page_manager_update_task_handler_weight($handler, $weight) {
  db_delete('page_manager_weights')
    ->condition('name', $handler->name)
    ->execute();
  db_insert('page_manager_weights')
    ->fields(array(
    'name' => $handler->name,
    'weight' => $weight,
  ))
    ->execute();
}