You are here

function _cms_content_sync_add_form_group in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 cms_content_sync.module \_cms_content_sync_add_form_group()
  2. 2.0.x cms_content_sync.module \_cms_content_sync_add_form_group()

Display the push group either to select pools or to display the usage on other sites. You can use $form['cms_content_sync_group'] afterwards to access it.

Parameters

array $form: The form array.

3 calls to _cms_content_sync_add_form_group()
_cms_content_sync_add_push_pool_form in ./cms_content_sync.module
Add the push widgets to the form, providing flow and pool selection.
_cms_content_sync_add_usage_form in ./cms_content_sync.module
Add a button "Show usage" to show all sites using this content.
_cms_content_sync_add_version_mismatches_form in ./cms_content_sync.module
Add a button "Show version mismatches" to show all sites using a different entity type version.

File

./cms_content_sync.module, line 631
Module file for cms_content_sync.

Code

function _cms_content_sync_add_form_group(&$form) {
  if (isset($form['cms_content_sync_group'])) {
    return;
  }

  // Try to show the group right above the status checkbox if it exists.
  if (isset($form['status'])) {
    $weight = $form['status']['#weight'] - 1;
  }
  else {
    $weight = 99;
  }
  $form['cms_content_sync_group'] = [
    '#type' => 'details',
    '#open' => FALSE,
    '#title' => _cms_content_sync_get_repository_name(),
    '#weight' => $weight,
  ];

  // If we got a advanced group we use it.
  if (isset($form['advanced'])) {
    $form['cms_content_sync_group']['#type'] = 'details';
    $form['cms_content_sync_group']['#group'] = 'advanced';
  }
}