t('Example checklist'), '#path' => 'example-checklist', '#description' => t('An example checklist.'), '#help' => t('

This is an example checklist.

'), 'example_group' => [ '#title' => t('Example group'), '#description' => t('

Here are some example items.

'), 'example_item_1' => [ '#title' => t('Example item 1'), 'example_link' => [ '#text' => t('Example.com'), '#path' => 'http://www.example.com/', ], ], 'example_item_2' => [ '#title' => t('Example item 2'), ], ], ]; return $definitions; } /** * 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. * For a working example, see checklistapi_example.module. * * @param array $definitions * The multidimensional array of checklist definitions returned by * hook_checklistapi_checklist_info(). * * @see checklistapi_get_checklist_info() * @see hook_checklistapi_checklist_info() */ function hook_checklistapi_checklist_info_alter(array &$definitions) { // Add an item. $definitions['example_checklist']['example_group']['new_item'] = [ 'title' => t('New item'), ]; // Add a group. $definitions['example_checklist']['new_group'] = [ '#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']); } /** * @} End of "addtogroup hooks". */