You are here

function flush_page_cache_custom_build in Flush page cache 7

Same name and namespace in other branches
  1. 6 flush_page_cache.admin.inc \flush_page_cache_custom_build()

Build flush page cache custom array from form values.

2 calls to flush_page_cache_custom_build()
flush_page_cache_admin_settings in ./flush_page_cache.admin.inc
Form builder; Administration page for the 'Flush page cache' module.
flush_page_cache_admin_settings_submit in ./flush_page_cache.admin.inc
Form submission handler; For flush page cache admin settings

File

./flush_page_cache.admin.inc, line 189
Administration pages for the 'Flush page cache' module.

Code

function flush_page_cache_custom_build($values) {
  $custom = array();
  foreach ($values['flush_page_cache_custom']['settings_table'] as $delta => $item) {
    if (isset($values['_triggering_element_name']) && $values['_triggering_element_name'] == 'remove_' . $delta || empty($item['table'])) {
      continue;
    }
    $custom[] = array(
      empty($item['path']) ? '*' : trim($item['path'], '/'),
      empty($item['cid']) ? NULL : $item['cid'],
      $item['table'],
      empty($item['wildcard']) ? FALSE : TRUE,
    );
  }

  // DEBUG:
  // dpm($values); dpm($custom);
  return $custom;
}