Commit 2ea2b062 authored by Spleshka's avatar Spleshka

Fixed issue with disabled Menu module.

parent 31278181
......@@ -224,8 +224,8 @@ function expire_admin_settings_form() {
'#type' => 'textarea',
'#title' => t('Enter custom URLs'),
'#description' => t('Enter one relative URL per line, e.g. !example1.', array('!example1' => '<strong>comment/[comment:cid]</strong>')) . '<br/>'
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>comment/1</strong>', '!example1a' => '<strong>comment/1</strong>', '!example1b' => '<strong>comment/12</strong>', '!example1c' => '<strong>comment/123</strong>')) . '<br/>'
. t('You may use tokens here.'),
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>comment/1</strong>', '!example1a' => '<strong>comment/1</strong>', '!example1b' => '<strong>comment/12</strong>', '!example1c' => '<strong>comment/123</strong>')) . '<br/>'
. t('You may use tokens here.'),
'#states' => array(
'visible' => array(
':input[name="expire_comment_custom"]' => array('checked' => TRUE),
......@@ -287,8 +287,8 @@ function expire_admin_settings_form() {
'#type' => 'textarea',
'#title' => t('Enter custom URLs'),
'#description' => t('Enter one relative URL per line. It can be the path of a node (e.g. !example1) or of any alias (e.g. !example2). However, it has to be the final URL, not a redirect (use the !link1 and !link2 modules).', array('!example1' => '<strong>user/[user:uid]</strong>', '!example2' => '<strong>my/path</strong>', '!link1' => l('Global Redirect', 'https://drupal.org/project/globalredirect'), '!link2' => l('Redirect', 'https://drupal.org/project/redirect'))) . '<br/>'
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>my/path|wildcard</strong>', '!example1a' => '<strong>my/path</strong>', '!example1b' => '<strong>my/path/one</strong>', '!example1c' => '<strong>my/path/two</strong>')) . '<br/>'
. t('You may use tokens here.'),
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>my/path|wildcard</strong>', '!example1a' => '<strong>my/path</strong>', '!example1b' => '<strong>my/path/one</strong>', '!example1c' => '<strong>my/path/two</strong>')) . '<br/>'
. t('You may use tokens here.'),
'#states' => array(
'visible' => array(
':input[name="expire_user_custom"]' => array('checked' => TRUE),
......@@ -349,8 +349,8 @@ function expire_admin_settings_form() {
'#type' => 'textarea',
'#title' => t('Enter custom URLs'),
'#description' => t('Enter one relative URL per line, e.g. !example1.', array('!example1' => '<strong>file/[file:fid]</strong>')) . '<br/>'
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>file/1</strong>', '!example1a' => '<strong>file/1</strong>', '!example1b' => '<strong>file/12</strong>', '!example1c' => '<strong>file/123</strong>')) . '<br/>'
. t('You may use tokens here.'),
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>file/1</strong>', '!example1a' => '<strong>file/1</strong>', '!example1b' => '<strong>file/12</strong>', '!example1c' => '<strong>file/123</strong>')) . '<br/>'
. t('You may use tokens here.'),
'#states' => array(
'visible' => array(
':input[name="expire_file_custom"]' => array('checked' => TRUE),
......@@ -413,8 +413,8 @@ function expire_admin_settings_form() {
'#type' => 'textarea',
'#title' => t('Enter custom URLs'),
'#description' => t('Enter one relative URL per line. It can be the path of a node (e.g. !example1) or of any alias (e.g. !example2). However, it has to be the final URL, not a redirect (use the !link1 and !link2 modules).', array('!example1' => '<strong>user/[user:uid]</strong>', '!example2' => '<strong>my/path</strong>', '!link1' => l('Global Redirect', 'https://drupal.org/project/globalredirect'), '!link2' => l('Redirect', 'https://drupal.org/project/redirect'))) . '<br/>'
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>my/path|wildcard</strong>', '!example1a' => '<strong>my/path</strong>', '!example1b' => '<strong>my/path/one</strong>', '!example1c' => '<strong>my/path/two</strong>')) . '<br/>'
. t('You may use tokens here.'),
. t('If you want to match a path with any ending, add "|wildcard" to the end of the line (see !link1 for details). Example: !example1 will match !example1a, but also !example1b, !example1c, etc.', array('!link1' => l('function cache_clear_all', 'https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_clear_all/7'), '!example1' => '<strong>my/path|wildcard</strong>', '!example1a' => '<strong>my/path</strong>', '!example1b' => '<strong>my/path/one</strong>', '!example1c' => '<strong>my/path/two</strong>')) . '<br/>'
. t('You may use tokens here.'),
'#states' => array(
'visible' => array(
':input[name="expire_votingapi_custom"]' => array('checked' => TRUE),
......@@ -426,48 +426,50 @@ function expire_admin_settings_form() {
// MENU LINK SETTINGS.
$form['tabs']['menu_links'] = array(
'#type' => 'fieldset',
'#title' => t('Menu links expiration'),
'#group' => 'tabs',
'#weight' => 1,
);
if (module_exists('menu')) {
$form['tabs']['menu_links'] = array(
'#type' => 'fieldset',
'#title' => t('Menu links expiration'),
'#group' => 'tabs',
'#weight' => 1,
);
$form['tabs']['menu_links']['actions'] = array(
'#type' => 'fieldset',
'#title' => t('Menu link actions'),
);
$form['tabs']['menu_links']['actions'] = array(
'#type' => 'fieldset',
'#title' => t('Menu link actions'),
);
$form['tabs']['menu_links']['actions']['expire_menu_link_actions'] = array(
'#type' => 'checkboxes',
'#description' => t('Page cache for user will be expired after selected actions.'),
'#options' => array(
EXPIRE_MENU_LINK_INSERT => t('Menu link insert'),
EXPIRE_MENU_LINK_UPDATE => t('Menu link update'),
EXPIRE_MENU_LINK_DELETE => t('Menu link delete'),
),
'#default_value' => variable_get('expire_menu_link_actions', array()),
);
$form['tabs']['menu_links']['actions']['expire_menu_link_actions'] = array(
'#type' => 'checkboxes',
'#description' => t('Page cache for user will be expired after selected actions.'),
'#options' => array(
EXPIRE_MENU_LINK_INSERT => t('Menu link insert'),
EXPIRE_MENU_LINK_UPDATE => t('Menu link update'),
EXPIRE_MENU_LINK_DELETE => t('Menu link delete'),
),
'#default_value' => variable_get('expire_menu_link_actions', array()),
);
$form['tabs']['menu_links']['expire_menu_link_override_menus'] = array(
'#type' => 'fieldset',
'#tree' => TRUE,
'#title' => t('What menus should expire their page urls (and at what depth) when menu is updated?'),
);
$form['tabs']['menu_links']['expire_menu_link_override_menus'] = array(
'#type' => 'fieldset',
'#tree' => TRUE,
'#title' => t('What menus should expire their page urls (and at what depth) when menu is updated?'),
);
$options = array();
for ($i = 0; $i <= MENU_MAX_DEPTH; $i++) {
$options[$i] = $i ? t('@depth depth', array('@depth' => $i)) : t('None');
}
$options = array();
for ($i = 0; $i <= MENU_MAX_DEPTH; $i++) {
$options[$i] = $i ? t('@depth depth', array('@depth' => $i)) : t('None');
}
$menu_options = array_filter(variable_get('expire_menu_link_override_menus', array()));
foreach (menu_get_menus() as $menu_name => $menu_label) {
$form['tabs']['menu_links']['expire_menu_link_override_menus'][$menu_name] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => !empty($menu_options[$menu_name]) ? $menu_options[$menu_name] : 0,
'#title' => check_plain($menu_label),
);
$menu_options = array_filter(variable_get('expire_menu_link_override_menus', array()));
foreach (menu_get_menus() as $menu_name => $menu_label) {
$form['tabs']['menu_links']['expire_menu_link_override_menus'][$menu_name] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => !empty($menu_options[$menu_name]) ? $menu_options[$menu_name] : 0,
'#title' => check_plain($menu_label),
);
}
}
// Add the token tree UI.
......
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