You are here

function search_by_page_path_parts in Search by Page 6

Same name and namespace in other branches
  1. 7 search_by_page.module \search_by_page_path_parts()

Splits a path into the main path and any query parts.

Parameters

$path: Path to split.

Return value

Array, first element is main path (after resolving aliases), second is query string.

5 calls to search_by_page_path_parts()
sbp_paths_sbp_details in ./sbp_paths.module
Implementation of Search by Page hook_sbp_details().
sbp_paths_sbp_query_modify in ./sbp_paths.module
Implementation of Search by Page hook_sbp_query_modify().
SearchByPageUnitTest::testPathParts in tests/search_by_page.test
Tests the search_by_page_path_parts() function.
search_by_page_update_index in ./search_by_page.module
Implementation of hook_update_index().
_search_by_page_do_search in ./search_by_page.module
Internal function: performs a search, for hook_search($op = 'search').

File

./search_by_page.module, line 186
Main module file for Drupal module Search by Page.

Code

function search_by_page_path_parts($path) {

  // see if there is a ? in the path
  $path = drupal_get_normal_path($path);
  $stuff = explode('?', $path, 2);
  if (count($stuff) > 1) {
    return $stuff;
  }

  // see if there is an & in the path
  return explode('&', $path, 2);
}