readFromDb(GruppenController::KOMPASS_STAMMESGRUPPEN_GRUPPEN, ['id' => $groupId]); add_settings_section( 'custom_settings_section', __('Edit Group', BDP_LV_PLUGIN_SLUG), 'kompass_prepare_form', $page, [ 'action' => 'update-group', 'page' => 'kompass-groups', 'group_id' => $groupId ] ); _kompass_group_display_elements($page, $group[0]); do_settings_sections(BDP_LV_PLUGIN_SLUG . '-create-group'); kompass_close_form(__('Update', BDP_LV_PLUGIN_SLUG)); } function kompass_create_group_member_form(array $prefilledData = []) { global $dbHandler; $page = BDP_LV_PLUGIN_SLUG . '-create-member'; add_settings_section( 'custom_settings_section', __('Add Member', BDP_LV_PLUGIN_SLUG), 'kompass_prepare_form', $page, [ 'action' => 'create-member', 'page' => 'kompass-groups' ] ); _kompass_group_member_display_elements($page, $prefilledData); do_settings_sections($page); kompass_close_form(__('Add member', BDP_LV_PLUGIN_SLUG)); } function _kompass_group_member_display_elements(string $page, array $prefilledElements = []) { $value = $prefilledElements['kompass_group_member_firstname'] ?? ''; add_settings_field( 'kompass_group_member_field_1', __('First Name', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_firstname', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_lastname'] ?? ''; add_settings_field( 'kompass_group_member_field_2', __('Last Name', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_lastname', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_birthday'] ?? ''; add_settings_field( 'kompass_group_member_field_3', __('Birthday', BDP_LV_PLUGIN_SLUG), 'kompass_print_datebox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_birthday', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_parents'] ?? ''; add_settings_field( 'kompass_group_member_field_4', __('Contact person', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_parents', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_email_1'] ?? ''; add_settings_field( 'kompass_group_member_field_5', __('E-Mail', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_email_1', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_email_2'] ?? ''; add_settings_field( 'kompass_group_member_field_6', __('Alternative E-Mail', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_email_2', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_phone_1'] ?? ''; add_settings_field( 'kompass_group_member_field_7', __('Telephone', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_phone_1', 'value' => $value, 'style' => 'width: 512px']); $value = $prefilledElements['kompass_group_member_phone_2'] ?? ''; add_settings_field( 'kompass_group_member_field_8', __('Alternative Telephone', BDP_LV_PLUGIN_SLUG), 'kompass_print_textbox', $page, 'custom_settings_section', ['setting' => 'kompass_group_member_phone_2', 'value' => $value, 'style' => 'width: 512px']); }