You are here

function skinr_set in Skinr 6

Same name and namespace in other branches
  1. 6.2 skinr.module \skinr_set()

Save an entry to Skinr.

5 calls to skinr_set()
comment_skinr_form_index_handler in modules/comment.skinr.inc
Skinr form index handler.
node_skinr_form_index_handler in modules/node.skinr.inc
Skinr form index handler.
skinr_submit_handler in includes/handlers.inc
Skinr submit handler.
views_skinr_submit_handler_view in modules/views.skinr.inc
_panels_skinr_save_and_clear_cache in modules/panels.skinr.inc

File

./skinr.module, line 489

Code

function skinr_set($theme, $module, $key, $value) {
  $skinr = variable_get('skinr_' . $theme, array());

  // Make sure we're getting valid data.
  if (empty($module) || empty($key)) {
    return;
  }
  if (!$value && isset($skinr[$module][$key])) {
    unset($skinr[$module][$key]);
  }
  else {
    if (!isset($skinr[$module])) {
      $skinr[$module] = array();
    }
    $skinr[$module][$key] = $value;
  }
  variable_set('skinr_' . $theme, $skinr);
}