You are here

function patterns_publish_pattern in Patterns 7.2

Same name and namespace in other branches
  1. 6.2 patterns.module \patterns_publish_pattern()
  2. 6 patterns.module \patterns_publish_pattern()
  3. 7 includes/servers.inc \patterns_publish_pattern()

Callback function for route /admin/patterns/publish/

Sets the flag public to TRUE in the database and invokes the hook_patterns_publish in all the modules implementing it.

Parameters

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

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

File

includes/servers.inc, line 16
Functions related to importing and publishing patterns on the web.

Code

function patterns_publish_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('Published patterns can be unpublished again later on.');
  return confirm_form($form, t('Proceed with publishing pattern %pattern', array(
    '%pattern' => $pattern->title,
  )), 'admin/patterns', $disclaimer);
}