You are here

pathologic_test.module in Pathologic 8

File

tests/modules/pathologic_test/pathologic_test.module
View source
<?php

/**
 * Implements hook_pathologic_alter(), for testing that functionality.
 */
function pathologic_test_pathologic_alter(&$url_params, $parts, $settings) {
  if (is_array($parts['qparts']) && isset($parts['qparts']['test'])) {
    if ($parts['qparts']['test'] === 'add_foo_qpart') {

      // Add a "foo" query part
      if (empty($url_params['options']['query'])) {
        $url_params['options']['query'] = [];
      }
      $url_params['options']['query']['foo'] = 'bar';
    }
    elseif ($parts['qparts']['test'] === 'use_original') {
      $url_params['options']['use_original'] = TRUE;
    }
  }
}

Functions

Namesort descending Description
pathologic_test_pathologic_alter Implements hook_pathologic_alter(), for testing that functionality.