You are here

function hook_checklistapi_checklist_info_alter in Checklist API 7

Same name and namespace in other branches
  1. 8 checklistapi.api.php \hook_checklistapi_checklist_info_alter()

Alter checklist definitions.

This hook is invoked by checklistapi_get_checklist_info(). The checklist definitions are passed in by reference. Additional checklists may be added, or existing checklists may be altered or removed.

Parameters

array $definitions: The multidimensional array of checklist definitions returned by hook_checklistapi_checklist_info().

For a working example, see checklistapi_example.module.

See also

checklistapi_get_checklist_info()

hook_checklistapi_checklist_info()

1 function implements hook_checklistapi_checklist_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

checklistapi_example_checklistapi_checklist_info_alter in checklistapi_example/checklistapi_example.module
Implements hook_checklistapi_checklist_info_alter().
1 invocation of hook_checklistapi_checklist_info_alter()
checklistapi_get_checklist_info in ./checklistapi.module
Gets checklist definitions.

File

./checklistapi.api.php, line 115
Hooks provided by the Checklist API module.

Code

function hook_checklistapi_checklist_info_alter(array &$definitions) {

  // Add an item.
  $definitions['example_checklist']['example_group']['new_item'] = array(
    'title' => t('New item'),
  );

  // Add a group.
  $definitions['example_checklist']['new_group'] = array(
    '#title' => t('New group'),
  );

  // Move an item.
  $definitions['example_checklist']['new_group']['example_item_1'] = $definitions['example_checklist']['example_group']['example_item_1'];
  unset($definitions['example_checklist']['example_group']['example_item_1']);

  // Remove an item.
  unset($definitions['example_checklist']['example_group']['example_item_2']);
}