Skip to content
Snippets Groups Projects
Commit 844d32a5 authored by dpi's avatar dpi
Browse files

Cleaned up some strings and documentation.

Requires Courier update.
parent a70d7cf6
No related branches found
No related tags found
No related merge requests found
administer rng:
title: 'Administer RNG.'
title: 'Administer RNG'
description: 'Manage settings for RNG.'
restrict access: TRUE
administer event types:
title: 'Administer event types.'
title: 'Administer event types'
description: 'Manage which entity bundles are designated as events.'
restrict access: TRUE
......@@ -14,7 +14,7 @@ administer registration types:
restrict access: TRUE
administer registration entity:
title: 'Administer all registration entities.'
title: 'Administer all registration entities'
description: 'Create, and perform any action on all registrations.'
restrict access: TRUE
......
<?php
/**
* @file
* Contains \Drupal\rng\EventManager.
*/
/**
* @file
* Contains \Drupal\rng\EventManager.
*/
namespace Drupal\rng;
......
......@@ -279,7 +279,7 @@ interface EventMetaInterface {
public function getRegistrants($entity_type_id = NULL);
/**
* Count number of identities the current has proxy register access
* Count number of identities the current user has proxy register access
* including himself.
*
* @return integer
......
......@@ -16,6 +16,7 @@ use Drupal\courier\IdentityChannelManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\courier\Entity\TemplateCollection;
/**
* Creates a template collection and provides a user interface to its templates.
......@@ -115,11 +116,18 @@ Each template requires content suitable to the channel.');
if ($template_collection = $this->getTemplateCollection()) {
foreach ($template_collection->getTemplates() as $entity) {
$item = [];
$item[] = [
'#type' => 'link',
'#title' => $entity->getEntityType()->getLabel(),
'#url' => $entity->urlInfo('edit-form'),
];
if ($entity->hasLinkTemplate('edit-form')) {
$item[] = [
'#type' => 'link',
'#title' => $entity->getEntityType()->getLabel(),
'#url' => $entity->urlInfo('edit-form'),
];
}
else {
$item[] = [
'#markup' => $entity->getEntityType()->getLabel(),
];
}
$form['links']['#items'][] = $item;
}
......@@ -132,23 +140,15 @@ Each template requires content suitable to the channel.');
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$configuration = $this->getConfiguration();
// Create new
if (!isset($configuration['template_collection'])) {
/** @var \Drupal\courier\TemplateCollectionInterface $template_collection */
$template_collection = $this->entityManager->getStorage('courier_template_collection')->create(
['template' => 'rng_custom']
);
$template_collection->save();
if (!$template_collection->isNew()) {
$templates[] = $this->entityManager->getStorage('courier_email')->create();
foreach ($templates as $template) {
$template_collection->setTemplate($template);
}
$template_collection = TemplateCollection::create([
'template' => 'rng_custom',
]);
if ($template_collection->save()) {
$this->identityChannelManager->addTemplates($template_collection);
$template_collection->save();
}
......
......@@ -58,6 +58,8 @@ class RouteSubscriber extends RouteSubscriberBase {
'_entity_is_event' => 'TRUE',
];
$options = [];
// Option will invoke EntityConverter ParamConverter to upcast the
// entity in $canonical_path.
$options['parameters'][$entity_type]['type'] = 'entity:' . $entity_type;
// Manage Event.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment