public function LoginDestination::viewTriggers in Login Destination 8.2
Same name and namespace in other branches
- 8 src/Entity/LoginDestination.php \Drupal\login_destination\Entity\LoginDestination::viewTriggers()
Prepare list of triggers for displaying.
Return value
string HTML view for list of triggers.
Overrides LoginDestinationInterface::viewTriggers
File
- src/
Entity/ LoginDestination.php, line 227
Class
- LoginDestination
- Defines a login destination configuration entity.
Namespace
Drupal\login_destination\EntityCode
public function viewTriggers() {
$items = [];
foreach ($this->triggers as $trigger) {
if (empty($trigger)) {
continue;
}
switch ($trigger) {
case LoginDestination::TRIGGER_REGISTRATION:
$items[] = $this
->t('Registration');
break;
case LoginDestination::TRIGGER_LOGIN:
$items[] = $this
->t('Login');
break;
case LoginDestination::TRIGGER_ONE_TIME_LOGIN:
$items[] = $this
->t('One-time login link');
break;
case LoginDestination::TRIGGER_LOGOUT:
$items[] = $this
->t('Logout');
break;
}
}
return $this
->renderItemList($items, $this
->t('All triggers'));
}