You are here

public static function HudtInternal::getSummary in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/HudtInternal.php \HookUpdateDeployTools\HudtInternal::getSummary()

Generate the import summary.

Parameters

array $completed: Array of completed imports.

int $total_requested: The number to be processed.

Return value

string The report of what was completed.

6 calls to HudtInternal::getSummary()
Features::revert in src/Features.php
Safely revert an array of Features and provide feedback.
Menus::import in src/Menus.php
Imports menus using the menu_import module & template.
PageManager::import in src/PageManager.php
Imports Page Manager pages using the panels module & template.
Redirects::import in src/Redirects.php
Imports a set of redirects from an import csv file.
Rules::import in src/Rules.php
Imports rules using the rule_import module & template.

... See full list

File

src/HudtInternal.php, line 108

Class

HudtInternal
Methods for processes internal to Hook Deploy Update Tools.

Namespace

HookUpdateDeployTools

Code

public static function getSummary($completed, $total_requested, $operation) {
  $t = get_t();
  $count = count($completed);
  $completed_string = print_r($completed, TRUE);
  $remove = array(
    "Array",
    "(\n",
    ")\n",
  );
  $completed_string = str_replace($remove, '', $completed_string);

  // Adjust for misaligned second line.
  $completed_string = str_replace('             [', '     [', $completed_string);
  $vars = array(
    '@count' => $count,
    '!completed' => $completed_string,
    '@total' => $total_requested,
    '@operation' => $operation,
  );
  return $t("Summary: @operation @count/@total.  Completed the following:\n !completed", $vars);
}