### Eclipse Workspace Patch 1.0 #P pulp Index: sites/all/modules/clickpath/clickpath.module =================================================================== --- sites/all/modules/clickpath/clickpath.module (revision 185) +++ sites/all/modules/clickpath/clickpath.module (working copy) @@ -58,7 +58,14 @@ '#default_value' => variable_get('clickpath_ignore_list', "admin*\nnode/*/*"), '#description' => $description, ); - + + $form['clickpath_consider_list'] = array( + '#type' => 'textarea', + '#title' => t('Paths to consider'), + '#default_value' => variable_get('clickpath_consider_list', "node*"), + '#description' => $description, + ); + $form['clickpath_breadcrumb'] = array( '#type' => 'checkbox', '#title' => t('Override breacrumb trail'), @@ -148,23 +155,31 @@ } function clickpath_save_path($path) { - $path_pattern = variable_get('clickpath_ignore_list', "admin*\nnode/*/*"); + $ignore_pattern = variable_get('clickpath_ignore_list', "admin*"); + $consider_pattern = variable_get('clickpath_consider_list', "node*"); // Match path if necessary - if (!empty($path_pattern)) { + if (!empty($ignore_pattern)) { $aliased_path = drupal_get_path_alias($path); // Compare with the internal and path alias (if any). - $page_match = drupal_match_path($aliased_path, $path_pattern); + $ignore_match = drupal_match_path($aliased_path, $ignore_pattern); + $consider_match = drupal_match_path($aliased_path, $consider_pattern); + if ($aliased_path != $_GET['q']) { - $page_match = $page_match || drupal_match_path($path, $path_pattern); + $ignore_match = $ignore_match || drupal_match_path($path, $ignore_pattern); + $consider_match = $consider_match || drupal_match_path($path, $consider_pattern); + } // Since it's a list of patterns to ignore, flip it. - $page_match = !$page_match; + $ignore_match = !$ignore_match; } else { - $page_match = TRUE; + $ignore_match = TRUE; + $consider_match = FALSE; } + // If $ignore passed and also $consider then it's a match. + $page_match = $ignore_match && $consider_match; if ($page_match) { $title = _clickpath_path_is_frontpage($path) ? t('Home') : drupal_get_title();