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