Commit 5a2c1066 authored by Mike Carper's avatar Mike Carper

#998056 by fgm: add uninstall & admin page.

parent 450eab99
<?php
// $Id$
/**
* @file
* Provides form for changing settings
*/
/**
* Implementation of the former hook_settings().
*/
function expire_admin_settings_form() {
drupal_set_title(t('Cache Expiration'));
$form['expire'] = array(
'#type' => 'fieldset',
'#title' => t('What to expire'),
);
$form['expire']['expire_flush_front'] = array(
'#type' => 'checkbox',
'#title' => t('Expire front page'),
'#default_value' => variable_get('expire_flush_front', EXPIRE_FLUSH_FRONT),
'#description' => t('When expiring a node: if promoted to front page, expire front page.'),
);
$form['expire']['expire_flush_node_terms'] = array(
'#type' => 'checkbox',
'#title' => t('Expire node term pages'),
'#default_value' => variable_get('expire_flush_node_terms', EXPIRE_FLUSH_NODE_TERMS),
'#description' => t('When expiring a node: expire taxonomy pages for its terms.'),
);
$form['expire']['expire_flush_menu_items'] = array(
'#type' => 'radios',
'#title' => t('Expire menus'),
'#options' => array(0 => t('No'), EXPIRE_FLUSH_MENU_ITEMS => t('Family'), 2 => t('Entire menu')),
'#default_value' => variable_get('expire_flush_menu_items', EXPIRE_FLUSH_MENU_ITEMS),
'#description' => t('When expiring a node: expire related menu items or entire menu'),
);
$form['expire']['expire_flush_cck_references'] = array(
'#type' => 'checkbox',
'#title' => t('Expire CCK node references'),
'#default_value' => variable_get('expire_flush_cck_references', EXPIRE_FLUSH_CCK_REFERENCES),
'#description' => t('When expiring a node: expire its node references and nodes containing it in their own ndoe references.'),
);
$form['format'] = array(
'#type' => 'fieldset',
'#title' => t('Expire protocol'),
);
$form['format']['expire_include_base_url'] = array(
'#type' => 'checkbox',
'#title' => t('Include base URL in expires'),
'#default_value' => variable_get('expire_include_base_url', EXPIRE_INCLUDE_BASE_URL),
'#description' => t('Include the base URL in expire requests. Compatible with Domain Access'),
);
return system_settings_form($form);
}
; $Id$
name = Cache Expiration
description = Logic for expiring page caches
name = "Cache Expiration"
description = "Logic for expiring page caches"
recommends[] = nodereferrer
package = Performance and scalability
package = "Performance and scalability"
core = 6.x
<?php
// $Id$
/**
* @file
* Install file for expire module
*/
/**
* Implementation of hook_uninstall().
*/
function expire_uninstall() {
$vars = array(
'expire_flush_front',
'expire_flush_node_terms',
'expire_flush_menu_items',
'expire_flush_cck_references',
'expire_include_base_url',
);
foreach ($vars as $var) {
variable_del($var);
}
$t = get_t();
drupal_set_message($t('Removed Expire variables'));
}
......@@ -13,6 +13,29 @@ define('EXPIRE_FLUSH_CCK_REFERENCES', TRUE);
define('EXPIRE_FLUSH_FRONT', TRUE);
define('EXPIRE_INCLUDE_BASE_URL', TRUE);
/**
* Implementation of hook_menu().
*/
function expire_menu() {
$items = array();
$items['admin/settings/performance/default'] = array(
'title' => 'Performance',
'type' => MENU_DEFAULT_LOCAL_TASK,
'file path' => drupal_get_path('module', 'system'),
);
$items['admin/settings/performance/expire'] = array(
'type' => MENU_LOCAL_TASK,
'title' => 'Cache Expiration',
'page callback' => 'drupal_get_form',
'page arguments' => array('expire_admin_settings_form'),
'access arguments' => array('administer site configuration'),
'file path' => drupal_get_path('module', 'boost'),
'file' => 'expire.admin.inc',
);
return $items;
}
/**
* Implementation of hook_comment(). Acts on comment modification.
*/
......@@ -119,7 +142,7 @@ function expire_user($op, &$edit, &$account, $category = NULL) {
* @param $node
* node object
*/
function expire_node($node) {
function expire_node(&$node) {
$paths = array();
// Check node object
......@@ -524,3 +547,4 @@ function expire_get_domains(&$node) {
}
return $domains;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment