You are here

function block_node_type_create in Patterns 7.2

Wraps a call to drupal_form_submit to define a visualization relationship between the given block and content type

Parameters

string $form_id String containing the form ID. In the case of custom functions the value is empty.:

array $form_state Set of values after parsing the action.:

1 string reference to 'block_node_type_create'
block_patterns in patterns_components/components/block.inc

File

patterns_components/components/block.inc, line 583

Code

function block_node_type_create($form_id, &$form_state) {

  //All the fields are mandatory, so it is not necessary to perform any checking
  $query = db_insert('block_node_type')
    ->fields(array(
    'module',
    'delta',
    'type',
  ))
    ->values(array(
    'module' => $form_state['values']['module'],
    'delta' => $form_state['values']['delta'],
    'type' => $form_state['values']['type'],
  ))
    ->execute();
  $msg = t('The block defined by module %module with delta %delta will be shown for Content type %type.', array(
    '%module' => $form_state['values']['module'],
    '%delta' => $form_state['values']['delta'],
    '%type' => $form_state['values']['type'],
  ));
  return patterns_results(PATTERNS_SUCCESS, $msg);
}