You are here

function search_by_page_force_remove in Search by Page 6

Same name and namespace in other branches
  1. 8 search_by_page.module \search_by_page_force_remove()
  2. 7 search_by_page.module \search_by_page_force_remove()

Removes a page from Search by Page.

The page will immediately be unavailable in search results, and will not be reindexed (unless hook_sbp_paths() submits it for indexing again).

Parameters

$module: Module that submitted this path for indexing.

$id: ID given in hook_sbp_paths() for this path.

$environment: Environment ID where this path should be removed. If omitted, all environments are checked.

4 calls to search_by_page_force_remove()
sbp_attach_nodeapi in ./sbp_attach.module
Implementation of hook_nodeapi().
sbp_nodes_nodeapi in ./sbp_nodes.module
Implementation of hook_nodeapi().
sbp_paths_delete_confirm_submit in ./sbp_paths.module
Submit callback for sbp_paths_delete_confirm().
sbp_users_user in ./sbp_users.module
Implements hook_user().

File

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

Code

function search_by_page_force_remove($module, $id, $environment = NULL) {
  $envs = array();
  if (isset($environment)) {
    $envs = array(
      $environment,
    );
  }
  else {
    $envs = search_by_page_list_environments();
  }
  foreach ($envs as $env) {
    $item = _search_by_page_lookup(0, '', $id, $module, $env);
    if ($item) {
      _search_by_page_remove_path($item->pid);
    }
  }
}