function block_attributes_form_alter in Block Attributes 7
Implements hook_form_alter().
Alter block add and edit forms to add attributes configuration fields.
File
- ./
block_attributes.module, line 232 - Enhanced control over the HTML attributes of any Block.
Code
function block_attributes_form_alter(&$form, &$form_state, $form_id) {
// Form ids of modules with block creation pages also need to be checked.
if (user_access('administer block attributes') && in_array($form_id, array(
'block_admin_configure',
'block_add_block_form',
'menu_block_add_block_form',
))) {
// Load statically cached block object used to display the form.
$block = block_load($form['module']['#value'], $form['delta']['#value']);
_block_attributes_form_alter($form, $block);
}
}