Basic implementation event signup

This commit is contained in:
2024-05-27 16:59:30 +02:00
parent a66f2d2422
commit a69d83bc0a
321 changed files with 138376 additions and 644 deletions

View File

@ -0,0 +1,9 @@
<?php
function kompass_get_email_link(string $email) : string {
return '<a href="mailto:' . $email . '">' . $email . '</a>';
}
function kompass_print_email_link(string $email)
{
echo kompass_get_email_link($email);
}

View File

@ -1,9 +1,13 @@
<?php
function kompass_get_telephone_link(string $telephonnumber) : string {
$numberInternational = $telephonnumber;
if (str_starts_with($numberInternational, '0')) {
$numberInternational = '+49' . substr($numberInternational,1);
}
return '<a href="tel:' . $numberInternational . '">' . $telephonnumber . '</a>';
}
function kompass_print_telephone_link(string $telephonnumber)
{
$numberInternational = $telephonnumber;
if (str_starts_with($numberInternational, '0')) {
$numberInternational = '+49' . substr($numberInternational,1);
}
echo '<a href="tel:' . $numberInternational . '">' . $telephonnumber . '</a>';
echo kompass_get_telephone_link($telephonnumber);
}

View File

@ -1,6 +1,13 @@
<?php
function _kompass_print_textbox($settingName, $settingValue, $style = '') {
echo '<input style="' . $style . '" type="text" name="' . $settingName . '" value="' . $settingValue. '" />';
function _kompass_print_textbox($settingName, $settingValue, $style = '', $appendix = '', $lines = 1, $data_type = 'text') {
if (1 === $lines) {
echo '<input style="' . $style . '" type="' . $data_type . '" name="' . $settingName . '" value="' . $settingValue . '" />';
} else {
echo '<textarea style="' . $style . '" name="' . $settingName . '" rows=' . $lines . '>' . $settingValue . '</textarea>';
}
if (null !== $appendix) {
echo '&nbsp;' . $appendix;
}
if (defined('WP_DEBUG') && WP_DEBUG == true) {
echo '<br />' . $settingName;
}
@ -12,8 +19,12 @@ function kompass_print_textbox(array $args) {
}
$setting = get_option($args['setting'], null);
$setting = $setting ?? ( $args['value'] ?? '' );
$appendix = $args['appendix'] ?? null;
$lines = $args['lines'] ?? 1;
$type = $args['type'] ?? 'text';
$style = isset($args['style']) ? $args['style'] : '';
$style = isset($args['style']) ? $args['style'] : '';
$value = esc_attr($setting);
if (isset($args['unit_division'])) {
@ -23,5 +34,7 @@ function kompass_print_textbox(array $args) {
if ($value === null && isset($args['value'])) {
$value = $args['value'];
}
_kompass_print_textbox($args['setting'], $value, $style);
_kompass_print_textbox($args['setting'], $value, $style, $appendix, $lines, $type);
}