function block_custom_block_form
block_custom_block_form($edit = array())
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
File
- modules/block/block.module, line 522
- Controls the visual building blocks a page is constructed with.
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; }
© 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!block!block.module/function/block_custom_block_form/7.x