You are here

function block_node_type_delete in Patterns 7.2

Wraps a call to drupal_form_submit to remove 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_delete'
block_patterns in patterns_components/components/block.inc

File

patterns_components/components/block.inc, line 607

Code

function block_node_type_delete($form_id, &$form_state) {

  //All the fields are mandatory, so it is not necessary to perform any checking
  $query = db_delete('block_node_type')
    ->condition('module', $form_state['values']['module'])
    ->condition('delta', $form_state['values']['delta'])
    ->condition('type', $form_state['values']['type'])
    ->execute();
  $msg = t('The block defined by module %module with delta %delta will not 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);
}