You are here

function patterns_d2d_share_patterns in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_d2d/includes/patterns_d2d.form.inc \patterns_d2d_share_patterns()
1 string reference to 'patterns_d2d_share_patterns'
patterns_d2d_menu_alter in patterns_d2d/patterns_d2d.module
Implements hook_menu_alter().

File

patterns_d2d/includes/patterns_d2d.form.inc, line 70
Push public patterns to friend instances.

Code

function patterns_d2d_share_patterns() {
  $build['main'] = array(
    '#title' => t('Publish Settings'),
    '#type' => 'fieldset',
  );
  $build['main'][] = drupal_get_form('patterns_d2d_form_outgoing_configure');
  $build['main'][] = drupal_get_form('patterns_d2d_form_incoming_configure');
  if (variable_get('patterns_d2d_auto_publish', FALSE)) {
    $friend = patterns_d2d_get_friend(variable_get('patterns_d2d_server', PATTERNS_D2D_SERVER));
    if ($friend === FALSE) {
      drupal_set_message(t('Server not listed as friend instance.'), 'error');
    }
    else {
      drupal_set_message(t('Server is listed as friend instance. Click !link to show details about the instance patterns are published to.', array(
        '!link' => l(t('here'), 'admin/drupaltodrupal/instances/' . $friend['id'] . '/details'),
      )));

      // TODO: proper t()
    }
  }
  return $build;
}