=== Microtango ===
Contributors: microtango
Tags: Microtango, Tanzschule, Übersicht, Kurse, Anmeldung
Requires at least: 4.1.0
Requires PHP: 7.0.0
Tested up to: 7.1.0
Stable tag: 1.0.0
License: MIT License
License URI: http://opensource.org/licenses/MIT

Microtango WordPress integration.

This plugin requires a Microtango subscription. It loads data from the Microtango REST API and renders it on your site via shortcodes.

A German documentation file is included as `readme_de.txt`.

== Description ==

Microtango integrates the Microtango REST API into WordPress.

= Features include: =

* Provides three shortcodes: **mt_courses**, **mt_reservation** and **mt_video**.

= Usage: =

<blockquote>
[mt_courses]
or
[mt_courses webcategory="WTP2"]
or
[mt_courses webcategory="WTP2" orderby="StartWeekday, Name"]
or
[mt_courses webcategory="WTP1"]Kursname|{{Subject}} ({{Name}})#Tag / Zeit|{{StartWeekdayText}} {{Timespan}}#Startdatum|{{StartDateText}}#|{{AttendButton}}[/mt_courses]
or
[mt_courses webcategory="WTP1"]Kursname|{{Subject}} ({{Name}})#1. Termin|{{DatesText.[0]}}#2. Termin|{{DatesText.[1]}}#3. Termin|{{DatesText.[2]}}#|{{AttendButton}}[/mt_courses]

[mt_reservation]

[mt_video]
or
[mt_video videogroup="GK"]
</blockquote>

<h4>mt_courses parameters:</h4>
* mtattendform (optional): Use the built-in Microtango attend form. Values: `popup` (default) or `standalone`.
* webcategory (optional): Web category filter.
* orderby (optional): Sort order.
* template (optional): `1-9`, selects one of the additional templates.
* templateid (optional): ID of the HTML template.
* category (optional): Category filter.
* attendurl (optional): URL for the attend form.

Content `[mt_courses] ... [/mt_courses]`:
Defines the table columns in the format:
`Column title | {{FieldName}}#Column title | {{FieldName}}`

Default:
Course|{{Subject}}#Start|{{StartDateText}}#From|{{Timespan}}#Lessons|{{RepeatCount}}#Availability|{{AvailabilityText}}#|{{AttendButton}}

FieldName:
Values from the Microtango REST API (https://api.microtango.de/swagger -> RESTCourseModel). Possible values:
* Id: adea471d-d109-416f-9638-5362b490b37a
* Season: 21-1
* Name: 3TK-06
* Subject: Paare Tanzkreis Fr
* StartDate: 2021-01-01T00:00:00
* StartDateText: 01.01.2021
* StartTime: 20:30:00
* StartTimeText: 20:30
* StartWeekday: 5
* StartWeekdayText: Freitag
* StartMonthText: Januar
* EndDate: 2021-12-24T00:00:00
* EndDateText: 24.12.2021
* EndTime: 21:30:00
* EndTimeText: 21:30
* EndWeekday: 5
* EndWeekdayText: Freitag
* EndMonthText: Dezember
* Timespan: 20:30 - 21:30
* Length: 1 Stunde
* TimeCondition: wöchentlich 1 Stunde
* Price: 0
* PriceClub: 35
* PriceText: 35,00
* PriceTextFull: 35,00 € monatlich
* HallName: Großer Saal
* HallAddress: Testweg 1, 12345 Musterhausen
* TeacherName: Dr. Sch. Nitzel
* AssistantName: Ein Name
* ProgramName: Grundkurs 1
* Category: GK
* WebCategory: Grundkurs1
* Availability: G, Y or R
* AvailabilityText: Plätze verfügbar, Wenig Plätze verfügbar, Ausgebucht
* RepeatCount: 12
* SkipDays: 7
* WebNotes: Sonstige Informationen
* AttendFormShowPartner: true
* AttendFormShowLegalGuardian: false
* FreeText1, FreeText2, FreeText3, FreeText4, FreeText5, FreeText6, FreeText7, FreeText8, FreeText9
* DatesText.[x]: 04.05.2023 (x= 0 - RepeatCount)
* Dates.[x]: 2023-05-04T18:00:00 (x= 0 - RepeatCount)

Special fields:
* Attend: Generates the attend link.
* AttendButton: Generates an attend button (includes booked information).
* ScheduleInfo: Shows a popup with the timetable.

Example:
[mt_courses]
or
[mt_courses webcategory="WTP2"]
or
[mt_courses webcategory="WTP2" orderby="StartWeekday, Name"]
or
[mt_courses webcategory="WTP1"]Kursname|{{Subject}}{{Name}}#Tag / Zeit|{{StartWeekdayText}} {{Timespan}}#Startdatum|{{StartDateText}}#|{{Attend}}[/mt_courses]

<h4>mt_reservation:</h4>
Shows the online reservation form for customers.

<h4>mt_video:</h4>
Shows the available videos for customers.

Example:
[mt_video videogroup="GK"]
[mt_video videogroup="GK", videoPublic=true]

== Installation ==
Use the standard WordPress plugin search and installer.
Activate the plugin.
Open the Microtango settings page under **Settings -> Microtango** in the WordPress admin.

Manual Installation

1. Upload the `microtango` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress

== Frequently Asked Questions ==

= Where do you use this plugin? =

In the WordPress admin dashboard, open **Settings** -> **Microtango**.

== Screenshots ==

1. Typical settings page.

== Changelog ==

= 1.0.0 =
* i18n: English as default language for plugin UI strings.
* i18n: Add German translation files (de_DE / de).
* i18n: Load text domain from /languages.
* Docs: Ship updated German documentation as readme_de.txt.
* Breaking: Remove the mt_form shortcode.
* Hardening: Settings sanitize callback and safer option loading.
* Fix: Settings menu path documentation (Settings -> Microtango).
* Internal: Shared helpers, unique template IDs, video template shape, loadTemplate for video.

= 0.9.31 =
* Fix: Load bundled JavaScript in the head.

= 0.9.30 =
* Security: Hardening against stored XSS via shortcode attributes (CVE-2026-1821).
* Compatibility: Bundle the JavaScript library with the plugin (no external CDN script loading).

= 0.9.29 =
* Bugfix for bracket

= 0.9.28 =
* Bugfix for missing settings

= 0.9.27 =
* Bugfix for missing settings

= 0.9.26 =
* Optimization for preview of changes

= 0.9.25 =
* Add StartWeekday and EndWeekday as Number (1=Monday, 7=Sunday)
* Add orderby Parameter to mt_courses. E.g.[mt_courses orderby="StartWeekday, Name"] to sort by Weekday and then by Name.

= 0.9.24 =
* Add missing Dates.[x] (x= 0 - RepeatCount) to documentation
* Add missing DatesText.[x] (x= 0 - RepeatCount) to documentation

= 0.9.23 =
* Fix missing templates 2-9

= 0.9.22 =
* Add "Disabled" to the settings. Will disable the plugin, but still show the plugin in preview.
* Add additional 9 course templates to settings. The templates can used with the template parameter for mt_courses shortcut. E.g [mt_courses template=1].

= 0.9.21 =
* Small fixes

= 0.9.20 =
* Add videoPublic parameter to video shortcode

= 0.9.19 =
* Fix missing RestKey for video

= 0.9.18 =
Small fixes

= 0.9.17 =
Small fixes

= 0.9.16 =
* WP Version 4.0.0 - 5.8.1

= 0.9.15 =
* Fallback to popup, if mtattendform is missing

= 0.9.14 =
* Reintroduce old attend link and add new attend button

= 0.9.13 =
* Remove old attend button

= 0.9.12 =
* Bugfix for multi inline templates

= 0.9.11 =
* Small bugfix

= 0.9.10 =
* Template for mt_video

= 0.9.9 =
* Add possible field to readme

= 0.9.8 =
* Translate setting defaults to german

= 0.9.7 =
* Translate setting defaults to german

= 0.9.6 =
* Add video function

= 0.9.5 =
* Fix for missing default value (load css, load template)

= 0.9.4 =
* Documentation update. Support for PartnerMandatory parameter

= 0.9.3 =
* Change cdn resource names

= 0.9.2 =
* Move resources to cdn

= 0.9.1 =
* Fix for Safari blocking 3rd party cookies

= 0.9.0 =
* Add online-reservation handling

= 0.8.3 =
* Small JS error handling

= 0.8.2 =
* Documentation update

= 0.8.1 =
* Missing course not found fix

= 0.8.0 =
* Shortcodes renaming

= 0.7.0 =
* Naming fixes for release

= 0.6.0 =
* First catalog upload

= 0.6.0 =
* Include js and css
* JS handling for wp

= 0.4.0 =
* Add settings page
- Setting for API rest Key
- Setting for default list row settings

= 0.3.0 =
* MT attend form handling

= 0.2.0 =
* Some readme text

= 0.1.0 =
* Initial release
