You are here

function theme_acquia_purge_status_widget in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.admin.inc \theme_acquia_purge_status_widget()

Returns HTML for the Acquia Purge status widget.

Parameters

array $variables: An associative array containing:

  • total: Total amount of actions initially queued for purging.
  • remaining: Remaining number of purge actions still to be processed.
  • processed: Number of purge actions that have already taken place.
  • percent: Value between 0-100 representing the progress percentage.
  • running: Whether URLs are being purged or not.
  • purgehistory: Array with recently purged URL's.

File

./acquia_purge.admin.inc, line 175
Admin page callbacks and theme functions for the Acquia Purge module.

Code

function theme_acquia_purge_status_widget($variables) {
  $progress_bar = theme('acquia_purge_status_bar_widget', $variables);

  // Prepare the table which we use as container.
  $table_variables = array(
    'header' => array(),
    'rows' => array(
      array(
        $progress_bar,
      ),
    ),
  );

  // Render the history list and add it to the table.
  if (count($variables['purgehistory'])) {
    $table_variables['rows'][] = array(
      theme('item_list', array(
        'items' => $variables['purgehistory'],
        'title' => t('Recently refreshed:'),
      )),
    );
  }

  // Render the table.
  $table = theme('table', $table_variables);

  // Return the HTML.
  return '<div id="acquia-purge-status-widget">' . $table . '</div>';
}