function block_custom_block_form

Form constructor for the custom block form.

Parameters

$edit: (optional) An associative array of information retrieved by block_custom_get_block() if an existing block is being edited, or an empty array otherwise. Defaults to array().

Related topics

1 call to block_custom_block_form()
block_block_configure in modules/block/block.module
Implements hook_block_configure().

File

modules/block/block.module, line 517

Code

function block_custom_block_form($edit = array()) {
    $edit += array(
        'info' => '',
        'body' => '',
    );
    $form['info'] = array(
        '#type' => 'textfield',
        '#title' => t('Block description'),
        '#default_value' => $edit['info'],
        '#maxlength' => 64,
        '#description' => t('A brief description of your block. Used on the <a href="@overview">Blocks administration page</a>.', array(
            '@overview' => url('admin/structure/block'),
        )),
        '#required' => TRUE,
        '#weight' => -18,
    );
    $form['body_field']['#weight'] = -17;
    $form['body_field']['body'] = array(
        '#type' => 'text_format',
        '#title' => t('Block body'),
        '#default_value' => $edit['body'],
        '#format' => isset($edit['format']) ? $edit['format'] : NULL,
        '#rows' => 15,
        '#description' => t('The content of the block as shown to the user.'),
        '#required' => TRUE,
        '#weight' => -17,
    );
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.