You are here

function patterns_trash_pattern in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns.module \patterns_trash_pattern()

Form constructor for the Patterns removing form.

Creates a confirm_form to make sure the removing operation was intentional.

Parameters

mixed $pid The ID of the Pattern to enable.:

See also

patterns_remove_pattern_submit()

1 string reference to 'patterns_trash_pattern'
patterns_menu in ./patterns.module
Implements hook_menu().

File

./patterns.module, line 529

Code

function patterns_trash_pattern($form, &$form_state, $pid = NULL) {
  $pattern = patterns_utils_if_invalid_go_back($pid);
  $form['pid'] = array(
    '#type' => 'value',
    '#value' => $pid,
  );
  $form['name'] = array(
    '#type' => 'value',
    '#value' => @$pattern->name,
  );
  $disclaimer = t('Trashed patterns can be restored later on.');
  return confirm_form($form, t('Proceed with moving pattern %pattern into the trash bin?', array(
    '%pattern' => $pattern->title,
  )), 'admin/patterns', $disclaimer);
}