function skinr_skin_revert in Skinr 7.2
Same name and namespace in other branches
- 8.2 skinr.module \skinr_skin_revert()
Revert a skin configuration object that's stored in code to its default state.
Parameters
$sid: A skin configuration ID.
Return value
If revert failed, returns FALSE. If it succeeded, returns TRUE.
2 calls to skinr_skin_revert()
- SkinrApiTestCase::testSkinrSkinDefaults in tests/
skinr.test - Test default skin configurations (in code).
- skinr_ui_revert_confirm_submit in ./
skinr_ui.admin.inc - Form submission handler for skinr_ui_revert_confirm().
File
- ./
skinr.module, line 963 - Handles core Skinr functionality.
Code
function skinr_skin_revert($sid) {
if (!($uuid = skinr_skin_sid_to_uuid($sid))) {
return FALSE;
}
$default_skins = _skinr_skin_get_defaults();
if (!isset($default_skins[$uuid])) {
return FALSE;
}
if ($status = skinr_skin_import($default_skins[$uuid], TRUE)) {
drupal_static_reset('skinr_skin_uuid_to_sid');
drupal_static_reset('skinr_skin_sid_to_uuid');
}
return $status;
}