You are here

function skinr_skin_revert in Skinr 8.2

Same name and namespace in other branches
  1. 7.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()
SkinrApiTest::_testSkinrSkinDefaults in src/Tests/SkinrApiTest.php
Test default skin configurations (in code).
SkinrApiTestCase::testSkinrSkinDefaults in src/Tests/skinr.test
Test default skin configurations (in code).

File

./skinr.module, line 805
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;
}