You are here

function acquia_purge_menu in Acquia Purge 7

Same name and namespace in other branches
  1. 6 acquia_purge.module \acquia_purge_menu()

Implements hook_menu().

File

./acquia_purge.module, line 102
Acquia Purge, Top-notch Varnish purging on Acquia Cloud!

Code

function acquia_purge_menu() {
  $items = array();
  _acquia_purge_service()
    ->processors()
    ->emit('onMenu', $items);

  // Define the autocomplete callback for the administration forms.
  $items['acquia_purge_ajax_autocomplete'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'acquia_purge_autocomplete',
    'access arguments' => array(
      'purge on-screen',
    ),
    'file' => 'acquia_purge.admin.inc',
  );

  // Turn Expire's configuration section into a tabbed interface and add a fake
  // 'Performance' tab, which will redirect to core's form. Then add our full
  // manual purge form as last tab.
  $items['admin/config/system/expire/performance'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Performance',
    'weight' => -20,
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      'admin/config/development/performance',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
  );
  $items['admin/config/system/expire/default'] = array(
    'title' => 'Cache Expiration',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file path' => drupal_get_path('module', 'expire'),
    'weight' => -5,
  );
  $items['admin/config/system/expire/manualpurge'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Manual purge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'acquia_purge_manualpurge_form_full',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'acquia_purge.admin.inc',
  );

  // We'll also do the opposite here, by replicating the tabs from above on
  // core's 'Performance' tab, but by letting them redirect back to the 'Cache
  // Expiration' and 'Manual purge' tabs as admin/config/system/expire.
  $items['admin/config/development/performance/default'] = array(
    'title' => 'Performance',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file path' => drupal_get_path('module', 'system'),
    'weight' => -5,
  );
  $items['admin/config/development/performance/expire'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Cache Expiration',
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      'admin/config/system/expire',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
  );
  $items['admin/config/development/performance/manualpurge'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Manual purge',
    'page callback' => 'drupal_goto',
    'page arguments' => array(
      'admin/config/system/expire/manualpurge',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
  );
  return $items;
}