You are here

function patterns_trash_pattern in Patterns 7

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

Form constructor for the Patterns removing form.

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


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

See also


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


./patterns.module, line 585


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);