public static function InsertUtility::aggregateStyles in Insert 8.2
Parameters
string $insertType:
Return value
array
2 calls to InsertUtility::aggregateStyles()
File
- src/
Utility/ InsertUtility.php, line 52
Class
Namespace
Drupal\insert\UtilityCode
public static function aggregateStyles($insertType) {
$styles = \Drupal::moduleHandler()
->invokeAll('insert_styles', [
$insertType,
]);
uasort($styles, function ($a, $b) {
$weightA = !$a instanceof ImageStyle && isset($a['weight']) ? $a['weight'] : 0;
$weightB = !$b instanceof ImageStyle && isset($b['weight']) ? $b['weight'] : 0;
if ($weightA === 0 && $weightB === 0) {
$labelA = $a instanceof ImageStyle ? $a
->label() : $a['label'];
$labelB = $b instanceof ImageStyle ? $b
->label() : $b['label'];
return strcasecmp($labelA, $labelB);
}
return $weightA < $weightB ? -1 : 1;
});
return $styles;
}