Added full_name field to actors, and made the administer entities permission finer grained

This commit is contained in:
2021-02-08 13:38:54 +00:00
parent 6fbaf433e8
commit 3dd71bf2c0
11 changed files with 62 additions and 38 deletions

View File

@ -49,15 +49,16 @@ class ContextualMenu extends BlockBase {
*/
private function generateLinksForAddingNewActivities($title, $query = []) {
$title = t($title);
$markup = "<h1>$title: </h1>";
$markup = "<br /><p><strong>$title: </strong>";
$allActivityTypes = \Drupal::service('entity_type.bundle.info')->getBundleInfo('oc_activity');
foreach($allActivityTypes as $machine_name => $activityType) {
$label = $activityType['label'];
$url = \Drupal\Core\Url::fromRoute("entity.oc_activity.add_form", ['oc_activity_type' => $machine_name]);
$url->setOption('query', $query);
$link = \Drupal\Core\Link::fromTextAndUrl($label, $url)->toString();
$markup .= "<p>$link</p>";
$markup .= "&nbsp;&nbsp; $link";
}
$markup .= "</p>";
return "<div class='openactor_add_links'>$markup</div>";
}
}