function _skinr_skin_get_defaults in Skinr 8.2
Same name and namespace in other branches
- 7.2 skinr.module \_skinr_skin_get_defaults()
Returns all default skin configuration objects.
8 calls to _skinr_skin_get_defaults()
- Skin::getStorage in src/
Entity/ Skin.php - SkinrApiTest::testSkinrSkinDefaultsDuplicates in src/
Tests/ SkinrApiTest.php - Test default skin configurations (in code) with duplicates.
- 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).
- SkinrApiTestCase::testSkinrSkinDefaultsDuplicates in src/
Tests/ skinr.test - Test default skin configurations (in code) with duplicates.
2 string references to '_skinr_skin_get_defaults'
- SkinrApiTest::testSkinrSkinDefaultsDuplicates in src/
Tests/ SkinrApiTest.php - Test default skin configurations (in code) with duplicates.
- SkinrApiTestCase::testSkinrSkinDefaultsDuplicates in src/
Tests/ skinr.test - Test default skin configurations (in code) with duplicates.
File
- ./
skinr.module, line 731 - Handles core Skinr functionality.
Code
function _skinr_skin_get_defaults() {
$default_skins =& drupal_static(__FUNCTION__);
if (!isset($default_skins)) {
if ($cached = \Drupal::cache()
->get('skinr_skin_defaults')) {
$default_skins = $cached->data;
return $default_skins;
}
// Don't use ModuleHandler::invokeAll() to prevent oddly merged defaults.
$default_skins = array();
foreach (\Drupal::moduleHandler()
->getImplementations('skinr_skin_defaults') as $module) {
$function = $module . '_skinr_skin_defaults';
if (function_exists($function)) {
$result = call_user_func_array($function, array());
if (isset($result) && is_array($result)) {
$default_skins = array_merge($default_skins, $result);
}
elseif (isset($result)) {
$default_skins[] = $result;
}
}
}
// Let modules modify the skin configuration.
\Drupal::moduleHandler()
->alter('skinr_skin_defaults', $default_skins);
\Drupal::cache()
->set('skinr_skin_defaults', $default_skins);
}
return $default_skins;
}