Skip to content
Snippets Groups Projects
Commit c54053a1 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

EXPHR: add support for newly-created (in uw_cfg_common) website lead role

parent 7d93918b
No related branches found
No related tags found
1 merge request!40Feature/exptime kpaxman site info
......@@ -13,4 +13,5 @@
.dashboard__site-info {
float: right;
margin-bottom: 0.2rem;
}
......@@ -168,8 +168,25 @@ function uw_dashboard_preprocess_page(&$variables) {
$string .= \Drupal::service('extension.list.profile')->getList()['uw_base_profile']->info['version'];
// Get the website lead(s).
$string .= ' • Website lead: ';
$string .= 'not set';
$query = \Drupal::entityQuery('user')
->condition('status', 1)
->condition('roles', 'uw_role_website_lead')
->sort('field_uw_last_name', 'ASC')
->sort('field_uw_first_name', 'ASC');
$uids = $query->execute();
$users = User::loadMultiple($uids);
$user_list = [];
foreach ($users as $user) {
$user_list[] = Link::fromTextAndUrl($user->getDisplayName(), Url::fromUri('mailto:' . $user->getEmail()))->toString();
}
if (!$user_list) {
$user_list[] = 'not set';
}
$string .= ' • Website lead';
if (count($user_list) > 1) {
$string .= 's';
}
$string .= ': ' . implode(', ', $user_list);
// Get the site owner(s).
$query = \Drupal::entityQuery('user')
......
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