You are here

function page_manager_handler_rearrange in Chaos Tool Suite (ctools) 6

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

Rearrange the order of variants.

1 string reference to 'page_manager_handler_rearrange'
page_manager_get_operations in page_manager/page_manager.admin.inc
Take the operations array from a task and expand it.

File

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

Code

function page_manager_handler_rearrange(&$form, &$form_state) {
  $page = $form_state['page'];
  $form['handlers'] = array(
    '#tree' => TRUE,
  );
  foreach ($page->handler_info as $id => $info) {
    if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) {
      continue;
    }
    $handler = $page->handlers[$id];
    $plugin = page_manager_get_task_handler($handler->handler);
    $form['handlers'][$id]['title'] = array(
      '#value' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
    );
    $form['handlers'][$id]['weight'] = array(
      '#type' => 'weight',
      '#default_value' => $info['weight'],
      '#delta' => 30,
    );
  }
}