You are here

function boost_block_flush_form in Boost 6

Same name and namespace in other branches
  1. 7 boost.blocks.inc \boost_block_flush_form()
1 string reference to 'boost_block_flush_form'
boost_block in ./boost.module
Implementation of hook_block().

File

./boost.module, line 2243
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_block_flush_form() {
  $router_item = _boost_get_menu_router();
  $form['boost_clear']['page_callback'] = array(
    '#type' => 'hidden',
    '#value' => $router_item['page_callback'],
  );
  $form['boost_clear']['page_type'] = array(
    '#type' => 'hidden',
    '#value' => $router_item['page_type'],
  );
  $form['boost_clear']['page_id'] = array(
    '#type' => 'hidden',
    '#value' => $router_item['page_id'],
  );
  $form['boost_clear']['path'] = array(
    '#type' => 'hidden',
    '#value' => $GLOBALS['_boost_path'],
  );
  $filename = boost_file_path($GLOBALS['_boost_path']);
  $ttl = boost_db_get_ttl($filename);
  if ($ttl < 0) {
    $form['boost_clear']['kill'] = array(
      '#type' => 'hidden',
      '#value' => TRUE,
    );
  }
  $form['boost_cache']['clear'] = array(
    '#type' => 'submit',
    '#value' => BOOST_EXPIRE_NO_FLUSH && $ttl >= 0 ? t('Expire Page') : t('Flush Page'),
    '#submit' => array(
      'boost_block_form_flush_submit',
    ),
  );
  return $form;
}