You are here

protected function BlazyAdminBase::getBundlePath in Blazy 7

Helper function for getting correct bundle for manage field/display path.

1 call to BlazyAdminBase::getBundlePath()
BlazyAdminBase::showAltTitleFieldHint in src/Form/BlazyAdminBase.php
If the image field doesn't have the Title field enabled, tell the user.

File

src/Form/BlazyAdminBase.php, line 767

Class

BlazyAdminBase
A base for blazy admin integration to have re-usable methods in one place.

Namespace

Drupal\blazy\Form

Code

protected function getBundlePath($instance) {
  $path = [];
  switch ($instance['entity_type']) {
    case 'bean':
      $path['field'] = 'admin/structure/block-types/manage/' . $instance['bundle'] . '/fields/' . $instance['field_name'];
      $path['display'] = 'admin/structure/block-types/manage/' . $instance['bundle'] . '/display';
      break;
    case 'taxonomy_term':
      $path['field'] = 'admin/structure/taxonomy/' . $instance['bundle'] . '/fields/' . $instance['field_name'];
      $path['display'] = 'admin/structure/taxonomy/' . $instance['bundle'] . '/display';
      break;
    default:
      $path['field'] = 'admin/structure/types/manage/' . $instance['bundle'] . '/fields/' . $instance['field_name'];
      $path['display'] = 'admin/structure/types/manage/' . $instance['bundle'] . '/display';
      break;
  }
  return $path;
}