You are here

function patterns_restore_pattern in Patterns 7.2

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

Restores a previously trashed pattern.

Sets the pattern status in the database to PATTERNS_STATUS_OK

Parameters

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

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

File

./patterns.module, line 484

Code

function patterns_restore_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('Restored patterns can be trashed again later on.');
  return confirm_form($form, t('Proceed with restoring pattern %pattern from the trash bin?', array(
    '%pattern' => $pattern->title,
  )), 'admin/patterns', $disclaimer);
}