diff --git a/src/Plugin/Block/HatCreator.php b/src/Plugin/Block/HatCreator.php index 6b06160..a29ed9f 100644 --- a/src/Plugin/Block/HatCreator.php +++ b/src/Plugin/Block/HatCreator.php @@ -38,7 +38,7 @@ class HatCreator extends BlockBase { '#cache' => [ 'max-age' => 0, ], - '#markup' => "
This person has no contact details yet. To get started, "; + $markup .= "
This person has no contact details yet. To get started, "; $markup .= "Add a set of contact details"; $markup .= "
"; @@ -45,7 +45,7 @@ class PersonPanel extends BlockBase { ->getStorage('hat') ->loadByProperties(['person' => $person_id]); if (!reset($hats)) { - $markup .= "This person has no hats yet. A hat is a role that the person plays in the organisation. To get started, add a hat for this person.
"; + $markup .= "This person has no hats yet. A hat is a role that the person plays in the organisation. To get started, add a hat for this person.
"; $plugin_manager = \Drupal::service('plugin.manager.block'); $block = $plugin_manager->createInstance('hat_creator', array()); $markup .= render($block->build()); @@ -53,7 +53,8 @@ class PersonPanel extends BlockBase { // they have hats, so display the case view for each hat. foreach($hats as $hat) { - $markup .= $this->show_cases_for_hat($hat); + $markup .= $this->showCases($hat); + $markup .= $this->showCaseCreationLinks($hat); } } } @@ -67,11 +68,22 @@ class PersonPanel extends BlockBase { } - private function show_cases_for_hat($hat) { + // Renders a view showing cases that hat is involved in. + private function showCases($hat) { $markup = ''; - $markup .= "" . $hat->name->getString() . "
"; + $markup .= "