function forward_block_configure in Forward 7.3
Same name and namespace in other branches
- 7 forward.module \forward_block_configure()
- 7.2 forward.module \forward_block_configure()
Implements hook_block_configure().
File
- ./
forward.module, line 1292 - Allows forwarding of entities by email, and provides a record of how often each has been forwarded.
Code
function forward_block_configure($delta) {
switch ($delta) {
case 'stats':
$block_options = array(
'allTime' => t('Most Emailed of All Time'),
'recent' => t('Most Recently Emailed'),
);
$form['forward_block_type'] = array(
'#type' => 'radios',
'#title' => t('Block type'),
'#default_value' => variable_get('forward_block_type', 'allTime'),
'#options' => $block_options,
'#description' => t('Choose the type of statistics to display'),
);
$block_options = array();
$entity_types = entity_get_info();
foreach ($entity_types as $type => $info) {
if (!empty($info['view modes'])) {
$block_options[$type] = check_plain($info['label']);
}
}
$form['forward_block_entity_type'] = array(
'#type' => 'radios',
'#title' => t('Entity type'),
'#default_value' => variable_get('forward_block_entity_type', 'node'),
'#options' => $block_options,
'#description' => t('Choose the type of entities to display'),
);
return $form;
case 'form':
$form['forward_block_form'] = array(
'#type' => 'radios',
'#title' => t('Interface'),
'#default_value' => variable_get('forward_block_form', variable_get('forward_interface_type', 'link')),
'#options' => array(
'form' => t('Display inline form'),
'link' => t('Link to separate page'),
),
'#description' => t('Choose whether to display the full form in the block or just an email this page link.'),
);
return $form;
}
}