Loading organigrams.module +6 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id // Pick out the terms by checking on tid in the key. if (substr($key, 0, 3) == 'tid') { // Get the position value. if (isset($value['#term']) && !empty($value['#term']->get('field_o_position')->first())) { $position = $value['#term']->get('field_o_position')->first()->getValue(); // If the positions is s, prepend 'Staff' to the term title. if ($position['value'] == 's') { Loading @@ -89,6 +90,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id } } } } /** * Custom submit function for the vocabulary add form. Loading organigrams.routing.yml +5 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ organigrams.view: path: '/organigram/{taxonomy_vocabulary}' defaults: _controller: '\Drupal\organigrams\Controller\OrganigramsController::viewOrganigram' _title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle' _title_callback: '\Drupal\Core\Entity\Controller\EntityController::title' requirements: _permission: 'view organigrams' _custom_access: '\Drupal\organigrams\Controller\OrganigramsController::isOrganigram' options: parameters: taxonomy_vocabulary: with_config_overrides: TRUE src/TaxonomyTermTree.php +7 −5 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ class TaxonomyTermTree { return; } if (isset($object) && !empty($object->get('field_o_position')->first())) { // Get the position of the child. $position = $object->get('field_o_position')->first()->getValue(); Loading @@ -168,6 +169,7 @@ class TaxonomyTermTree { if (!in_array($position['value'], $positions)) { return; } } // Set default name for the object. Replace | with a linebreak. $markup = str_replace('|', '<br />', $object->getName()); Loading Loading
organigrams.module +6 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id // Pick out the terms by checking on tid in the key. if (substr($key, 0, 3) == 'tid') { // Get the position value. if (isset($value['#term']) && !empty($value['#term']->get('field_o_position')->first())) { $position = $value['#term']->get('field_o_position')->first()->getValue(); // If the positions is s, prepend 'Staff' to the term title. if ($position['value'] == 's') { Loading @@ -89,6 +90,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id } } } } /** * Custom submit function for the vocabulary add form. Loading
organigrams.routing.yml +5 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ organigrams.view: path: '/organigram/{taxonomy_vocabulary}' defaults: _controller: '\Drupal\organigrams\Controller\OrganigramsController::viewOrganigram' _title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle' _title_callback: '\Drupal\Core\Entity\Controller\EntityController::title' requirements: _permission: 'view organigrams' _custom_access: '\Drupal\organigrams\Controller\OrganigramsController::isOrganigram' options: parameters: taxonomy_vocabulary: with_config_overrides: TRUE
src/TaxonomyTermTree.php +7 −5 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ class TaxonomyTermTree { return; } if (isset($object) && !empty($object->get('field_o_position')->first())) { // Get the position of the child. $position = $object->get('field_o_position')->first()->getValue(); Loading @@ -168,6 +169,7 @@ class TaxonomyTermTree { if (!in_array($position['value'], $positions)) { return; } } // Set default name for the object. Replace | with a linebreak. $markup = str_replace('|', '<br />', $object->getName()); Loading