You are here

function _textimage_preset_create in Textimage 7.2

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \_textimage_preset_create()
  2. 5 textimage.module \_textimage_preset_create()
  3. 6.2 textimage_admin.inc \_textimage_preset_create()

Create a preset.

Parameters

string $name: name of the preset to be created

string $description: description

string|array $settings: settings

2 calls to _textimage_preset_create()
textimage_get_presets in ./textimage.module
Todo.
textimage_preset_edit_submit in ./textimage.admin.inc
Todo.

File

./textimage.admin.inc, line 599
Textimage admin page callback

Code

function _textimage_preset_create($name, $description, $settings) {

  // Serialize preset settings if not yet done.
  if (!is_string($settings)) {
    $settings = serialize($settings);
  }
  return db_insert('textimage_preset')
    ->fields(array(
    'name' => $name,
    'description' => $description,
    'settings' => $settings,
  ))
    ->execute();
}