block_custom_block_form

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="drupal_7-modules-block-block-module-function-block_custom_block_form-@overview">Blocks administration page<-a>-', array('@overview' => url('admin-structure-block'))),
    '.html?lang=en#required' => TRUE,
    '.html?lang=en#weight' => -18,
  );
  $form['body_field']['.html?lang=en#weight'] = -17;
  $form['body_field']['body'] = array(
    '.html?lang=en#type' => 'text_format',
    '.html?lang=en#title' => t('Block body'),
    '.html?lang=en#default_value' => $edit['body'],
    '.html?lang=en#format' => isset($edit['format']) ? $edit['format'] : NULL,
    '.html?lang=en#rows' => 15,
    '.html?lang=en#description' => t('The content of the block as shown to the user.'),
    '.html?lang=en#required' => TRUE,
    '.html?lang=en#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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部