You are here

function twitter_block_delete in Twitter Block 7

Same name and namespace in other branches
  1. 7.2 twitter_block.admin.inc \twitter_block_delete()

Form constructor for the custom Twitter block deletion form.

Parameters

$module: The name of the module that implements the block to be deleted. This should always equal 'twitter_block' since it only allows custom Twitter blocks to be deleted.

$delta: The unique ID of the block within the context of $module.

See also

twitter_block_delete_submit()

1 string reference to 'twitter_block_delete'
twitter_block_menu in ./twitter_block.module
Implements hook_menu().

File

./twitter_block.admin.inc, line 128
Admin page callbacks for the Twitter Block module.

Code

function twitter_block_delete($form, &$form_state, $module, $delta) {
  $block = block_load($module, $delta);
  $twitter_block = twitter_block_block_get($block->delta);
  $form['info'] = array(
    '#type' => 'hidden',
    '#value' => $twitter_block['info'] ? $twitter_block['info'] : $twitter_block['title'],
  );
  $form['bid'] = array(
    '#type' => 'hidden',
    '#value' => $block->delta,
  );
  return confirm_form($form, t('Are you sure you want to delete the block %name?', array(
    '%name' => $twitter_block['info'],
  )), 'admin/structure/block', '', t('Delete'), t('Cancel'));
}