You are here

function _textimage_set_variable in Textimage 7.3

Store a 'textimage' configuration variable.

Parameters

string|array $variable: the name of the textimage configuration variable, or the entire configuration array

string $value: the value of the textimage configuration variable to store

1 call to _textimage_set_variable()
textimage_form_settings_submit in ./textimage.admin.inc
Textimage settings form - submission.

File

./textimage.module, line 1119
Textimage - Provides text to image manipulations.

Code

function _textimage_set_variable($variable, $value = NULL) {
  if (is_array($variable)) {
    $vars = $variable;
  }
  else {
    $vars = _textimage_get_variable();
    if ($variable) {
      $vars[$variable] = $value;
    }
  }
  $vars = array_intersect_key($vars, array(
    'store_scheme' => NULL,
    'fonts_handling_module' => NULL,
    'fonts_path' => NULL,
    'default_font' => array(),
    'backgrounds_handling_module' => NULL,
    'backgrounds_path' => NULL,
    'color_selector' => NULL,
  ));
  variable_set('textimage', $vars);
  drupal_static_reset('_textimage_get_variable');
}