readFromDb( GruppenController::KOMPASS_STAMMESGRUPPEN_GRUPPEN) as $currentGruppe) { $participantCount = $dbHandler->countSqlRows(GruppenController::KOMPASS_STAMMESGRUPPEN_TEILIS, ['gruppe_id' => $currentGruppe->id]); echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
' . $currentGruppe->gruppen_name .'' . $participantCount . ' ' . kompass_get_group_actions($currentGruppe->id, $participantCount ) .'
'; if ( current_user_can( 'send_mails' ) ) { echo '' . __( 'Mail to multiple groups', BDP_LV_PLUGIN_SLUG ) . '  '; } if (current_user_can('create_teilis')) { echo '' . __( 'New Member', BDP_LV_PLUGIN_SLUG ) . '  '; } if ( current_user_can( 'delete_teilis' ) ) { ?> '; } function kompass_get_group_actions(int $groupId, int $participantCount) : string { $elements = []; if ($participantCount > 0) { $elements[] = '' . __('Show Members', BDP_LV_PLUGIN_SLUG) . ''; if (current_user_can('send_mails')) { $elements[] = '' . __( 'Mail to group', BDP_LV_PLUGIN_SLUG ) . ''; } } else { if (current_user_can('delete_groups')) { $elements[] = '' . __('Delete', BDP_LV_PLUGIN_SLUG) . ''; } } if (current_user_can('edit_groups')) { $elements[] = '' . __('Edit', BDP_LV_PLUGIN_SLUG) . ''; } return implode('
' , $elements); }