You are here

function blockgroup_block_configure in Block Group 7.2

Same name and namespace in other branches
  1. 7 blockgroup.module \blockgroup_block_configure()

Implements hook_block_configure().

File

./blockgroup.module, line 148
Add block groups to block configuration page

Code

function blockgroup_block_configure($delta = '') {
  $blockgroup = blockgroup_load($delta);
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Group title'),
    '#maxlength' => 64,
    '#description' => t('A brief description of your block group. Used on the <a href="@overview">Blocks administration page</a>.', array(
      '@overview' => url('admin/structure/block'),
    )),
    '#weight' => -19,
  );
  $form['machine_name'] = array(
    '#type' => 'machine_name',
    '#title' => t('Machine name'),
    '#maxlength' => BLOCKGROUP_MAX_BLOCKGROP_NAME_LENGTH_UI,
    '#description' => t('A unique name. It must only contain lowercase letters, numbers and hyphens.'),
    '#machine_name' => array(
      'exists' => 'blockgroup_edit_blockgroup_name_exists',
      'source' => array(
        'settings',
        'title',
      ),
    ),
  );
  if (!empty($blockgroup->delta)) {
    $form['title']['#default_value'] = $blockgroup->title;
    $form['machine_name']['#default_value'] = $blockgroup->delta;
    $form['machine_name']['#disabled'] = TRUE;
  }
  return $form;
}