You are here

paging.install in Paging 5

Same filename and directory in other branches
  1. 6 paging.install
  2. 7 paging.install

File

paging.install
View source
<?php

/**
 * Implementation of hook_uninstall().
 */
function paging_uninstall() {
  variable_del('paging_separator');
  variable_del('paging_read_more_enabled');
  variable_del('paging_node_types_enabled');
}

/**
 * Implementation of hook_update_N().
 */
function paging_update_1() {
  $ret = array();
  if (module_exists('search')) {
    module_invoke('node', 'search', 'reset');
    module_invoke('node', 'update_index');
    node_update_shutdown();
    $status = module_invoke('node', 'search', 'status');
    $percentage = (int) min(100, 100 * ($status['total'] - $status['remaining']) / max(1, $status['total'])) . '%';
    $ret[] = array(
      'success' => TRUE,
      'query' => t('!percentage of the site has been indexed.', array(
        '!percentage' => $percentage,
      )),
    );
  }
  return $ret;
}

/**
 * Implementation of hook_update_N().
 */
function paging_update_2() {
  if (db_result(db_query("\n    SELECT 1 FROM {system}\n    WHERE type = 'module' AND name = 'paging_gsitemap' AND (status = 1 OR schema_version >= 0)\n  "))) {
    drupal_install_modules(array(
      'paging_xmlsitemap',
    ));
  }
  return array();
}

Functions

Namesort descending Description
paging_uninstall Implementation of hook_uninstall().
paging_update_1 Implementation of hook_update_N().
paging_update_2 Implementation of hook_update_N().