function block_configuration_actions in Configuration Management 6
This function is used to register the actions this config supports. These actions can be used later on with an #action identifier to act on a specific part of the config dataset.
File
- modules/
block.inc, line 7
Code
function block_configuration_actions() {
return array(
'block_add_block_form' => array(
'#description' => t('Add block'),
'#summary' => 'block_configuration_summaries',
'#parameters' => array(
'module',
),
'#success map' => array(
'/delta' => array(
'#create' => true,
'#value php' => '$value = db_result(db_query("SELECT delta FROM {blocks} bl INNER JOIN {boxes} bo ON bl.delta = bo.bid AND bl.module = \\"block\\" WHERE info = \\"%s\\"", $context->parent->item["info"]));',
),
),
'#identifiers' => array(
'delta',
),
),
'block_admin_display_form' => array(
'#description' => t('Set/Change the region or order of a block'),
'#summary' => 'block_configuration_summaries',
'#parameters' => array(
'@blocks1',
'theme',
),
'#build map' => array(
'/[module][delta]' => array(
'#required' => true,
),
'/region' => array(
'#default' => 'left',
),
'/[status=0]/region' => array(
'#value' => -1,
),
'/theme' => array(
'#default callback' => array(
'variable_get' => array(
'theme_default',
'garland',
),
),
),
// The blocks1 parameter is needed to make sure all default values are retained
'/@blocks1' => array(
'#create' => true,
'#value php' => '$value = _block_rehash();',
),
'/@blocks2' => array(
'#create' => true,
'#value php' => '$parent = &$context->parent;' . "\n" . '$value = array($parent->item["module"] ."_". $parent->item["delta"] => $parent->item);',
),
),
'#build data' => '@blocks2',
'#identifiers' => array(
'delta',
),
),
'block_admin_configure' => array(
'#description' => t('Change configurations for a custom block'),
'#summary' => 'block_configuration_summaries',
'#parameters' => array(
'module',
'delta',
),
'#build map' => array(
'/info[module=block][delta]' => array(
'#default php' => '$value = db_result(db_query("SELECT bo.info FROM {blocks} bl INNER JOIN {boxes} bo ON bl.delta = bo.bid AND bl.module = \\"block\\" WHERE bl.delta = \\"%d\\"", $context->parent->item["delta"]));',
),
),
'#identifiers' => array(
'delta',
),
),
'block_box_delete' => array(
'#description' => t('Delete a custom block'),
'#summary' => 'block_configuration_summaries',
'#parameters' => array(
'delta',
),
'#identifiers' => array(
'delta',
),
),
);
}