You are here

function mongodb_block_ui_custom_block_form in MongoDB 7

Define the custom block form.

2 calls to mongodb_block_ui_custom_block_form()
mongodb_block_ui_add_block_form in mongodb_block_ui/mongodb_block_ui.admin.inc
Menu callback: display the custom mongodb_block_ui addition form.
mongodb_block_ui_admin_configure in mongodb_block_ui/mongodb_block_ui.admin.inc
Menu callback; displays the mongodb_block_ui configuration form.

File

mongodb_block_ui/mongodb_block_ui.module, line 214
Controls the visual building mongodb_block_uis a page is constructed with.

Code

function mongodb_block_ui_custom_block_form($edit = array()) {
  $edit += array(
    'info' => '',
    'body' => array(
      'value' => '',
      'format' => filter_default_format(),
    ),
  );
  $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/mongodb_block'),
    )),
    '#required' => TRUE,
    '#weight' => -19,
  );
  $form['body_field']['#weight'] = -17;
  $form['body_field']['body'] = array(
    '#type' => 'text_format',
    '#title' => t('Block body'),
    '#default_value' => $edit['body']['value'],
    '#format' => $edit['body']['format'],
    '#rows' => 15,
    '#description' => t('The content of the block as shown to the user.'),
    '#required' => TRUE,
    '#weight' => -17,
    '#access' => filter_access(filter_format_load($edit['body']['format'])),
  );
  return $form;
}