You are here

function acquia_purge_manualpurge_form_page in Acquia Purge 7

Single button form that lets administrative users purge the current page.

File

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

Code

function acquia_purge_manualpurge_form_page($form, &$form_state) {
  if (_acquia_purge_service()
    ->diagnostics()
    ->isSystemBlocked()) {
    return array();
  }

  // Retrieve the base form and register our validation and submit callbacks.
  _acquia_purge_manualpurge_base($form, $form_state);
  $form['submits']['page']['#submit'] = array(
    '_acquia_purge_manualpurge_submit',
  );
  unset($form['submits']['paths']);

  // Rewrite the paths array to just contain this page, variations might be
  // added later on if _acquia_purge_input_path_variations() gets called.
  $request_uri = str_replace('##' . base_path(), '', '##' . request_uri());
  $form['paths'] = array();
  $form['paths']['path'][] = array(
    '#type' => 'hidden',
    '#default_value' => $request_uri,
  );
  return $form;
}