function hook_workbench_create_alter in Workbench 7
Same name and namespace in other branches
- 8 workbench.api.php \hook_workbench_create_alter()
Allows modules to alter the default content creation page.
Worekbench supplies a Create Content tab which emulates core's node/add page. The render array for this page may be modified by other modules.
Parameters
$output: A Render API array of content items, passed by reference.
See also
1 invocation of hook_workbench_create_alter()
- workbench_create in ./
workbench.pages.inc - Simple page to show list of content type to create.
File
- ./
workbench.api.php, line 42 - API documentation file for Workbench.
Code
function hook_workbench_create_alter(&$output) {
// Example taken from Workbench Media module.
if (user_access('use workbench_media add form')) {
// Mimic node_add_page() theming.
$items = array(
array(
'title' => t('Upload Media'),
'href' => 'admin/workbench/media/add',
'localized_options' => array(),
'description' => t('Add photos, videos, audio, or other files to the site.'),
),
);
$output['field_workbench_create_media'] = array(
'#title' => t('Create Media'),
'#markup' => theme('node_add_list', array(
'content' => $items,
)),
'#theme' => 'workbench_element',
'#weight' => -1,
);
}
}