You are here

function _cms_content_sync_display_usage in CMS Content Sync 8

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

Replace the "Show usage" button with the actual usage information.

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

array

Throws

Exception

1 string reference to '_cms_content_sync_display_usage'
_cms_content_sync_add_usage_form in ./cms_content_sync.module
Add a button "Show usage" to show all sites using this content.

File

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

Code

function _cms_content_sync_display_usage($form, &$form_state) {
  $entity = $form_state
    ->getFormObject()
    ->getEntity();
  $result = _cms_content_sync_display_pool_usage($entity);
  if (!$result) {
    $result = '<div class="messages messages--status">' . t('No usage yet.') . '</div>';
  }
  return [
    '#type' => 'fieldset',
    '#title' => t('Usage'),
    '#markup' => $result,
  ];
}