function social_event_an_enroll_preprocess_views_view_field in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 8.5 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 8.6 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 8.7 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 8.8 modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
- 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module \social_event_an_enroll_preprocess_views_view_field()
Implements hook_preprocess_HOOK().
File
- modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.module, line 73 - The Social event AN enroll module.
Code
function social_event_an_enroll_preprocess_views_view_field(&$variables) {
/** @var \Drupal\views\ViewExecutable $view */
$view =& $variables['view'];
if ($view
->id() === 'event_manage_enrollments' && $variables['field']->field === 'profile_entity_sortable') {
$entity =& $variables['row']->_entity;
/** @var \Drupal\social_event_an_enroll\EventAnEnrollManager $service */
$service = \Drupal::service('social_event_an_enroll.manager');
if ($service
->isGuest($entity)) {
$url = Url::fromUserInput('/' . drupal_get_path('module', 'social_event_an_enroll') . '/images/icon.svg');
$variables['output'] = [
'#theme' => 'event_an_enroll_guest',
'#name' => $service
->getGuestName($entity),
'#url' => $url,
];
}
}
}