Loading css/orgchart-layout.css +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ box-sizing: border-box; content: ''; position: absolute; border: 0px solid #CCCCCC; border: 0px solid #cccccc; } .orgchart li:not(:only-child)::before { Loading organigrams.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ function hook_organigrams_taxonomy_term_tree_alter(array &$items) { * * @param string $markup * Contains rendered html. * @param object $object * @param object $term * Contains a taxonomy term. */ function hook_organigrams_taxonomy_term_markup_alter(string &$markup, object $term) { Loading organigrams.install +1 −0 Original line number Diff line number Diff line <?php /** * @file * Installation hooks for Organigrams module. Loading organigrams.services.yml +1 −1 Original line number Diff line number Diff line services: organigrams.taxonomy_term_tree: class: Drupal\organigrams\TaxonomyTermTree arguments: ['@entity_type.manager', '@entity_field.manager'] arguments: ['@entity_type.manager', '@entity_field.manager', '@module_handler', '@renderer'] src/Form/OrganigramsImportD7Form.php +31 −1 Original line number Diff line number Diff line Loading @@ -8,12 +8,40 @@ use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\Entity\Term; use Drupal\Core\Link; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; /** * Provides the settings form for this module. */ class OrganigramsImportD7Form extends FormBase { /** * The entity type manager. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ protected $entityTypeManager; /** * Constructs a new object. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager service. */ public function __construct(EntityTypeManagerInterface $entity_type_manager) { $this->entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('entity_type.manager') ); } /** * Returns a unique string identifying the form. * Loading Loading @@ -76,7 +104,9 @@ class OrganigramsImportD7Form extends FormBase { $form_state->setErrorByName('organigrams_d7_json', $this->t('No organigram found in the JSON.')); } else { $vocabularies = \Drupal::entityQuery('taxonomy_vocabulary')->execute(); $vocabularies = $this->entityTypeManager->getStorage('taxonomy_term')->getQuery() ->accessCheck(TRUE) ->execute(); if (isset($vocabularies[$organigram->organigram->machine_name])) { $form_state->setErrorByName('organigrams_d7_json', $this->t('An organigram with the machine name "@machine_name" already exists. Change the machine name or remove the existing one to import this organigram.', [ Loading Loading
css/orgchart-layout.css +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ box-sizing: border-box; content: ''; position: absolute; border: 0px solid #CCCCCC; border: 0px solid #cccccc; } .orgchart li:not(:only-child)::before { Loading
organigrams.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ function hook_organigrams_taxonomy_term_tree_alter(array &$items) { * * @param string $markup * Contains rendered html. * @param object $object * @param object $term * Contains a taxonomy term. */ function hook_organigrams_taxonomy_term_markup_alter(string &$markup, object $term) { Loading
organigrams.install +1 −0 Original line number Diff line number Diff line <?php /** * @file * Installation hooks for Organigrams module. Loading
organigrams.services.yml +1 −1 Original line number Diff line number Diff line services: organigrams.taxonomy_term_tree: class: Drupal\organigrams\TaxonomyTermTree arguments: ['@entity_type.manager', '@entity_field.manager'] arguments: ['@entity_type.manager', '@entity_field.manager', '@module_handler', '@renderer']
src/Form/OrganigramsImportD7Form.php +31 −1 Original line number Diff line number Diff line Loading @@ -8,12 +8,40 @@ use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\Entity\Term; use Drupal\Core\Link; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; /** * Provides the settings form for this module. */ class OrganigramsImportD7Form extends FormBase { /** * The entity type manager. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ protected $entityTypeManager; /** * Constructs a new object. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager service. */ public function __construct(EntityTypeManagerInterface $entity_type_manager) { $this->entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('entity_type.manager') ); } /** * Returns a unique string identifying the form. * Loading Loading @@ -76,7 +104,9 @@ class OrganigramsImportD7Form extends FormBase { $form_state->setErrorByName('organigrams_d7_json', $this->t('No organigram found in the JSON.')); } else { $vocabularies = \Drupal::entityQuery('taxonomy_vocabulary')->execute(); $vocabularies = $this->entityTypeManager->getStorage('taxonomy_term')->getQuery() ->accessCheck(TRUE) ->execute(); if (isset($vocabularies[$organigram->organigram->machine_name])) { $form_state->setErrorByName('organigrams_d7_json', $this->t('An organigram with the machine name "@machine_name" already exists. Change the machine name or remove the existing one to import this organigram.', [ Loading