_menu_helper_blocks_append_type_input

custom/menu_helper/menu_helper_blocks/menu_helper_blocks.module, line 595

Versions
6
_menu_helper_blocks_append_type_input(&$form, $node_type_options, $block_name)

Appends to 'Content type' input to a form.

See also

menu_helper_blocks_content_form()

@see menu_helper_blocks_book_form()

Parameters

$form An associative array containing the structure of the form.

$node_type_options A keyed array containing the permitted node types.

$block_name The name of block which is prefixed to all the input names

Return value

An associative array containing the structure of the form.

▾ 2 functions call _menu_helper_blocks_append_type_input()

menu_helper_blocks_book_form in custom/menu_helper/menu_helper_blocks/menu_helper_blocks.module
Form for the content of the 'Add page to book' block.
menu_helper_blocks_content_form in custom/menu_helper/menu_helper_blocks/menu_helper_blocks.module
Form for the content of the 'Add content to menu' block.

Code

<?php
function _menu_helper_blocks_append_type_input(&$form, $node_type_options, $block_name) {
  // Node type
  $form[$block_name .'_type'] = array(
    '#type' => 'select',
    '#title' => t('Content type'),
    '#options' => $node_type_options,
    '#default_value' => $_SESSION[$block_name .'_type'],
    '#required' => TRUE,
  );
}
?>