|
|
|
@ -1031,6 +1031,7 @@ function reserve_yyyymmdd($month, $day) {
|
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
function reserve_get_reserve_bundles() { |
|
|
|
|
$bundles = array(); |
|
|
|
|
$fieldmap = \Drupal::entityManager()->getFieldMap(); |
|
|
|
|
foreach ($fieldmap as $entity_type => $typedef) { |
|
|
|
|
foreach ($typedef as $field) { |
|
|
|
@ -1079,13 +1080,16 @@ function ebundle_split($ebundle, $part) {
|
|
|
|
|
* e.g.: Room (node) |
|
|
|
|
*/ |
|
|
|
|
function ebundles_formatted() { |
|
|
|
|
$result = array(); |
|
|
|
|
$info = \Drupal::service("entity_type.bundle.info")->getAllBundleInfo(); |
|
|
|
|
$ebundles = reserve_get_reserve_bundles(); |
|
|
|
|
if (count($ebundles)) { |
|
|
|
|
foreach ($ebundles as $ebundle) { |
|
|
|
|
$type = ebundle_split($ebundle, 'type'); |
|
|
|
|
$bundle = ebundle_split($ebundle, 'bundle'); |
|
|
|
|
$result[$ebundle] = $info[$type][$bundle]['label'] . " ($type)"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|