You are here

function imagecache_action_save in ImageCache 5.2

Same name and namespace in other branches
  1. 6.2 imagecache.module \imagecache_action_save()
3 calls to imagecache_action_save()
imagecache_ui_action_add_form_submit in ./imagecache_ui.module
imagecache_ui_action_form_submit in ./imagecache_ui.module
imagecache_ui_preset_form_submit in ./imagecache_ui.module

File

./imagecache.module, line 895
Dynamic image resizer and image cacher.

Code

function imagecache_action_save($action) {
  if ($action['actionid']) {
    db_query('UPDATE {imagecache_action} SET weight=%d, data=\'%s\' WHERE actionid=%d', $action['weight'], serialize($action['data']), $action['actionid']);
  }
  else {
    $action['actionid'] = db_next_id('{imagecache_action}_actionid');
    db_query('INSERT INTO {imagecache_action} (actionid, presetid, weight, action, data) VALUES (%d, %d, %d,\'%s\', \'%s\')', $action['actionid'], $action['presetid'], $action['weight'], $action['action'], serialize($action['data']));
  }
  $preset = imagecache_preset($action['presetid']);
  imagecache_preset_flush($preset);
  imagecache_presets(true);
  return $action;
}