You are here

function search_by_page_setting_set in Search by Page 7

Same name and namespace in other branches
  1. 6 search_by_page.module \search_by_page_setting_set()

Sets a setting for Search by Page or a sub-module.

This is like the Drupal variable_set() function, except that it is environment-aware.

Parameters

$name: Name of the setting.

$environment: ID of the environment.

$value: Value to set.

See also

search_by_page_setting_get()

3 calls to search_by_page_setting_set()
SearchByPageUnitTest::testStripTags in tests/search_by_page.test
Tests the search_by_page_strip_tags function.
search_by_page_admin_settings_submit in ./search_by_page.module
Submit handler for search_by_page_admin_settings().
search_by_page_update_6000 in ./search_by_page.install
Add language, environment, and uid fields to sbp_path table.

File

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

Code

function search_by_page_setting_set($name, $environment, $value) {
  $stuff = variable_get('search_by_page_settings', array());
  if (!isset($stuff[$environment])) {
    $stuff[$environment] = array();
  }
  $stuff[$environment][$name] = $value;
  variable_set('search_by_page_settings', $stuff);
}