You are here

function esi_admin_menu_output_alter in ESI: Edge Side Includes 7.3

Same name and namespace in other branches
  1. 6.2 esi.module \esi_admin_menu_output_alter()

Implements hook_admin_menu_output_alter().

Integrate with admin_menu to add a cache flush for ESI.

File

./esi.module, line 224
Adds support for ESI (Edge-Side-Include) integration, allowing components\ to be delivered by ESI, with support for per-component cache times.

Code

function esi_admin_menu_output_alter(&$admin_menu) {

  // Add an entry for resetting the ESI caches.
  $destination = drupal_get_destination();
  if ($admin_menu['icon'] && isset($admin_menu['icon']['icon']['flush-cache']) && is_array($admin_menu['icon']['icon']['flush-cache'])) {
    $admin_menu['icon']['icon']['flush-cache']['esi'] = array(
      '#title' => t('Edge-side Includes'),
      '#href' => 'admin_menu/flush-cache/esi',
      '#options' => array(
        'query' => $destination,
      ),
    );
  }
  ksort($admin_menu['icon']['icon']['flush-cache']);
}