You are here

function i18n_variable_set in Internationalization 5.3

Same name and namespace in other branches
  1. 5 i18n.module \i18n_variable_set()
  2. 5.2 i18n.module \i18n_variable_set()
  3. 6 i18n.module \i18n_variable_set()
  4. 7 i18n_variable/i18n_variable.module \i18n_variable_set()

Set a persistent language dependent variable.

Parameters

$name: The name of the variable to set.

$value: The value to set. This can be any PHP data type; these functions take care of serialization as necessary.

1 call to i18n_variable_set()
i18n_variable_form_submit in ./i18n.module
Save multilingual variables and remove them from form

File

./i18n.module, line 1123
Internationalization (i18n) module

Code

function i18n_variable_set($name, $value, $language) {
  global $conf, $i18n_conf;
  db_lock_table('i18n_variable');
  db_query("DELETE FROM {i18n_variable} WHERE name = '%s' AND language='%s'", $name, $language);
  db_query("INSERT INTO {i18n_variable} (name, language, value) VALUES ('%s', '%s', '%s')", $name, $language, serialize($value));
  db_unlock_tables();
  cache_clear_all('variables:' . $language, 'cache');
  $conf[$name] = $value;
  $i18n_conf[$name] = $value;
}