You are here

function boost_block_form_flush_submit in Boost 6

1 string reference to 'boost_block_form_flush_submit'
boost_block_flush_form in ./boost.module

File

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

Code

function boost_block_form_flush_submit(&$form_state, $form) {
  global $_boost;
  $data = array();

  // Special front page handling
  if (!empty($form['values']['page_callback']) && $form['values']['page_callback'] == 'node_page_default' && BOOST_CACHE_XML) {
    $data[] = array(
      'page_callback' => 'node_feed',
    );
  }
  $data[] = array(
    'page_callback' => $form['values']['page_callback'],
    'page_type' => $form['values']['page_type'],
    'page_id' => $form['values']['page_id'],
  );
  boost_set_base_dir_in_array($data);
  $flushed = 0;
  if (array_key_exists('kill', $form['values'])) {
    if ($data) {
      $flushed += boost_cache_expire_router($data, TRUE);
    }
    if (array_key_exists('path', $form['values'])) {
      $flushed += boost_cache_expire_derivative(array(
        $form['values']['path'],
      ), TRUE, TRUE);
    }
    if (BOOST_VERBOSE >= 7 && isset($_boost['verbose_option_selected']['boost_block_flush_submit'])) {
      $form_path = empty($form['values']['path']) ? '' : $form['values']['path'];
      watchdog('boost', 'Debug: boost_block_form_flush_submit() <br />Page !path was deleted resulting in !flushed pages being flushed from the cache', array(
        '!path' => $form_path,
        '!flushed' => $flushed,
      ));
    }
  }
  else {
    if ($data) {
      $flushed += boost_cache_expire_router($data);
    }
    if (array_key_exists('path', $form['values'])) {
      $flushed += boost_cache_expire_derivative(array(
        $form['values']['path'],
      ), TRUE);
    }
    if (BOOST_VERBOSE >= 7 && isset($_boost['verbose_option_selected']['boost_block_flush_submit'])) {
      $form_path = empty($form['values']['path']) ? '' : $form['values']['path'];
      watchdog('boost', 'Debug: boost_block_form_flush_submit() <br />Page !path was expired resulting in !flushed pages being expired from the cache', array(
        '!path' => $form_path,
        '!flushed' => $flushed,
      ));
    }
  }
}