Skip to content
Snippets Groups Projects
Commit 2feeb207 authored by Eric Rasmussen's avatar Eric Rasmussen Committed by Tim Steiner
Browse files

[gh-500] Purge varnish when Draggable Views form is saved

parent 7a3fbdbc
Branches
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state ...@@ -26,6 +26,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state
'#title' => t('Purge varnish on all sites'), '#title' => t('Purge varnish on all sites'),
'#access' => user_access('administer varnish') && conf_path() == 'sites/default', '#access' => user_access('administer varnish') && conf_path() == 'sites/default',
'#weight' => -1, '#weight' => -1,
'varnish_path' => array( 'varnish_path' => array(
'#type' => 'radios', '#type' => 'radios',
'#required' => TRUE, '#required' => TRUE,
...@@ -35,6 +36,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state ...@@ -35,6 +36,7 @@ function unl_varnish_form_system_performance_settings_alter(&$form, &$form_state
), ),
'#default_value' => '^/wdn', '#default_value' => '^/wdn',
), ),
'purge' => array( 'purge' => array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Purge varnish system-wide'), '#value' => t('Purge varnish system-wide'),
...@@ -82,3 +84,11 @@ function unl_varnish_file_update($file) { ...@@ -82,3 +84,11 @@ function unl_varnish_file_update($file) {
function unl_varnish_node_update($node) { function unl_varnish_node_update($node) {
varnish_purge_all_pages(); varnish_purge_all_pages();
} }
/**
* Implements hook_form_FORM_ID_alter().
* Purges varnish when a Draggable Views form is saved.
*/
function unl_varnish_form_views_form_drag_page_alter(&$form, $form_state, $form_id) {
$form['#submit'][] = 'varnish_purge_all_pages';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment