You are here

function akamai_page_cache_control_form in Akamai 6

Same name and namespace in other branches
  1. 6.2 akamai.module \akamai_page_cache_control_form()
  2. 7.3 akamai.module \akamai_page_cache_control_form()
  3. 7 akamai.module \akamai_page_cache_control_form()
  4. 7.2 akamai.module \akamai_page_cache_control_form()

Form for purging the current URL from the Akamai cache.

1 string reference to 'akamai_page_cache_control_form'
akamai_block in ./akamai.module
Implementation of hook_block().

File

./akamai.module, line 119
akamai.module Integration with the Akamai CDN Cache Control Web Service.

Code

function akamai_page_cache_control_form() {
  $form = array();
  $path = check_plain($_GET['q']);
  $nid = arg(1);
  if (arg(0) == 'node' && is_numeric($nid) && arg(2) == NULL) {
    $path = arg(0) . '/' . $nid;
  }
  $form['path'] = array(
    '#type' => 'hidden',
    '#value' => $path,
  );
  $form['message'] = array(
    '#value' => t('<p>Clear cache for:<br> @path </p>', array(
      '@path' => $path,
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Refresh Akamai Cache'),
  );
  $form['#node'] = node_load(array(
    'nid' => $nid,
  ));
  return $form;
}