node_form_block_admin_configure_alter
function node_form_block_admin_configure_alter
node_form_block_admin_configure_alter(&$form, &$form_state)
Implements hook_form_FORMID_alter().
Adds node-type specific visibility options to block configuration form.
See also
File
- modules/node/node.module, line 2424
- The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
function node_form_block_admin_configure_alter(&$form, &$form_state) { $default_type_options = db_query("SELECT type FROM {block_node_type} WHERE module = :module AND delta = :delta", array( ':module' => $form['module']['#value'], ':delta' => $form['delta']['#value'], ))->fetchCol(); $form['visibility']['node_type'] = array( '#type' => 'fieldset', '#title' => t('Content types'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 5, ); $form['visibility']['node_type']['types'] = array( '#type' => 'checkboxes', '#title' => t('Show block for specific content types'), '#default_value' => $default_type_options, '#options' => node_type_get_names(), '#description' => t('Show this block only on pages that display content of the given type(s). If you select no types, there will be no type-specific limitation.'), ); $form['#submit'][] = 'node_form_block_admin_configure_submit'; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!node!node.module/function/node_form_block_admin_configure_alter/7.x