function cacheexclude_admin_settings in CacheExclude 6.2
Same name and namespace in other branches
- 5.2 cacheexclude.module \cacheexclude_admin_settings()
- 5 cacheexclude.module \cacheexclude_admin_settings()
- 7.2 cacheexclude.module \cacheexclude_admin_settings()
Administrative settings form.
1 string reference to 'cacheexclude_admin_settings'
- cacheexclude_menu in ./
cacheexclude.module - Implementation of hook_menu().
File
- ./
cacheexclude.module, line 23
Code
function cacheexclude_admin_settings() {
$form['cacheexclude_list'] = array(
'#type' => 'textarea',
'#title' => t('Pages to exclude from caching'),
'#default_value' => variable_get('cacheexclude_list', ''),
'#width' => 40,
'#height' => 10,
'#description' => t("Enter one page per line as Drupal paths. Don't begin link with trailing slash. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
'%blog' => 'blog',
'%blog-wildcard' => 'blog/*',
'%front' => '<front>',
)),
);
// Options to exclude by node type.
$full_types = node_get_types();
foreach ($full_types as $type) {
$types[$type->type] = $type->name;
}
$form['cacheexclude_node_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Content types to exclude from caching'),
'#default_value' => variable_get('cacheexclude_node_types', array()),
'#options' => $types,
'#description' => t("Check all content types that you do not want to be cached."),
);
// Add an additional submit handler to clear the cache after list is updated.
$full_form = system_settings_form($form);
$full_form['#submit'][] = 'cacheexclude_admin_settings_submit';
return $full_form;
}