You are here

function _skinr_ui_mass_update_helper in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr_ui/skinr_ui.admin.inc \_skinr_ui_mass_update_helper()

Helper function for skin configuration mass updates.

2 calls to _skinr_ui_mass_update_helper()
skinr_ui_mass_update in ./skinr_ui.admin.inc
Mass update skin configurations, updating all skin configurations in the $skins array with the field values in $updates.
_skinr_ui_mass_update_batch_process in ./skinr_ui.admin.inc
Batch operation for skin configuration mass updates.

File

./skinr_ui.admin.inc, line 282
Admin page callbacks for the Skinr UI module.

Code

function _skinr_ui_mass_update_helper($sid, $updates) {
  drupal_static_reset('skinr_skin_load_multiple');
  $skin = skinr_skin_load($sid);

  // For efficiency manually store the original skin configuration before
  // applying any changes.
  $skin->original = clone $skin;
  foreach ($updates as $name => $value) {
    $skin->{$name} = $value;
  }
  skinr_skin_save($skin);
  return $skin;
}