Plugin Directory

Changeset 2511130


Ignore:
Timestamp:
04/07/2021 11:14:22 PM (5 years ago)
Author:
microtango
Message:

0.9.6

Location:
microtango
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • microtango/trunk/microtango-init.php

    r2332975 r2511130  
    11<?php
    22
    3 add_action( 'wp_enqueue_scripts', 'microtango_enqueue_files' );
     3add_action('wp_enqueue_scripts', 'microtango_enqueue_files' );
    44add_shortcode('mt_courses', 'microtango_shortcode_courses');
    55add_shortcode('mt_reservation', 'microtango_shortcode_reservation');
     6add_shortcode('mt_video', 'microtango_shortcode_video');
    67add_shortcode('mt_form', 'microtango_shortcode_form');
    78
    89function microtango_enqueue_files()
    910{
    10     wp_enqueue_script( 'microtango', 'https://cdn.microtango.de/scripts/mtrest-2.0.0.min.js', null);
    11     wp_enqueue_script( 'microtango-cms-init', 'https://cdn.microtango.de/scripts/mt-cms-init-1.0.0.min.js', array('microtango'), false, true);
     11    wp_enqueue_script('microtango', 'https://cdn.microtango.de/scripts/mtrest-2.0.0.min.js', null);
     12    wp_enqueue_script('microtango-cms-init', 'https://cdn.microtango.de/scripts/mt-cms-init-1.0.0.min.js', array('microtango'), false, true);
    1213}
    1314
     
    110111}
    111112
     113function microtango_shortcode_video($atts, $content = "")
     114{
     115    global $microtango_settings;
     116
     117    // Attributes
     118    $atts = shortcode_atts(
     119        array(
     120            'videogroup' => '',
     121            'restkey' => get_option($microtango_settings['settings'])['restkey'],
     122            'showvideotext' => get_option($microtango_settings['settings'])['showvideotext'],
     123            'videonotfoundtext' => get_option($microtango_settings['settings'])['videonotfoundtext'],
     124            'logintext' => get_option($microtango_settings['settings'])['logintext'],
     125            'loadcss' => isset(get_option($microtango_settings['settings'])['loadcss']) ? get_option($microtango_settings['settings'])['loadcss'] : '0' === '1',
     126        ),
     127        $atts,
     128        'mt_reservation'
     129    );
     130
     131    if ( empty ($content) ) {
     132        $content = get_option($microtango_settings['settings'])['defaultrowtemplate'];
     133    }
     134   
     135    if ( empty ($content) ) {
     136        $content = "Kurs|{{Subject}}#Start|{{StartDateText}}#Von|{{Timespan}}#Stunden|{{RepeatCount}}#Verfügbarkeit|{{AvailabilityText}}#|{{Attend}}";
     137    }
     138
     139    $columns = "\"" . str_replace("#", "\", \"", $content) . "\"";
     140
     141    // Code
     142    $return = <<<EOT
     143    <script>MicrotangoCMSHelper.addVideo(
     144        {
     145            "restKey": "{$atts['restkey']}",
     146            "showVideoText": "{$atts['showvideotext']}",
     147            "videoNotFoundText": "{$atts['videonotfoundtext']}",
     148            "loginText": "{$atts['logintext']}",
     149            "loadCSS": "{$atts['loadcss']}",
     150            "templates": { "id": "mtuserdefined", "columns": [{$columns}] },
     151            "update": [{"videoGroup": "{$atts['videogroup']}"}],
     152        });
     153    </script>
     154EOT;
     155
     156    return htmlspecialchars_decode($return);
     157}
     158
    112159function microtango_shortcode_form($atts, $content = "")
    113160{
  • microtango/trunk/microtango-settings-init.php

    r2322385 r2511130  
    3434        'fullybookedtext' => '',
    3535        'reservationtext' => '',
     36        'logintext' => '',
     37        'showvideotext' => '',
     38        'videonotfoundtext' => '',
    3639        'loadcss' => '',
    3740        'loadtemplate' => ''
     
    6467    microtango_settings_add_text_field('fullybookedtext', 'Course is sould out', 40, null, 'Default: Not free space', $data, 'optional');
    6568    microtango_settings_add_text_field('reservationtext', 'Reservation text', 20, null, 'Default: My Reservations', $data, 'optional');
     69    microtango_settings_add_text_field('logintext', 'Login text', 20, null, 'Default: Einloggen', $data, 'optional');
     70    microtango_settings_add_text_field('showvideotext', 'Show video text', 20, null, 'Default: Play Video', $data, 'optional');
     71    microtango_settings_add_text_field('videonotfoundtext', 'No video found text', 40, null, 'Default: No video found', $data, 'optional');
    6672    microtango_settings_add_checkbox_field('loadcss', 'Load CSS', 'Load custom styles', $data, 'optional');
    6773    microtango_settings_add_checkbox_field('loadtemplate', 'Load Templates', 'Load custom templates', $data, 'optional');
  • microtango/trunk/microtango.php

    r2332975 r2511130  
    44Plugin URI: https://microtango.de/
    55Description: Microtango WP integration. Requires subscription from DMS. Will include the Microtango REST API to show your cloud data.
    6 Version: 0.9.5
     6Version: 0.9.6
    77Author: microtango
    88Author URI: https://profiles.wordpress.org/microtango/
     
    1111Text Domain: microtango
    1212
    13 Copyright 2019-2020 DMS Computer Contor
     13Copyright 2019-2021 DMS Computer Contor
    1414
    1515Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
     
    3030    "settings_page_title" => "Microtango Options",
    3131    "settings" => "microtango_settings",
    32     "version" => "0.9.5"
     32    "version" => "0.9.6"
    3333);
    3434
  • microtango/trunk/readme.txt

    r2358584 r2511130  
    44Requires at least: 4.8.0
    55Requires PHP: 5.6.0
    6 Tested up to: 5.5.0
    7 Stable tag: 0.9.5
     6Tested up to: 5.7.0
     7Stable tag: 0.9.6
    88License: MIT License
    99License URI: http://opensource.org/licenses/MIT
     
    9393== Changelog ==
    9494
     95= 0.9.6 =
     96* Add video function
     97
    9598= 0.9.5 =
    9699* Fix for missing default value (load css, load template)
Note: See TracChangeset for help on using the changeset viewer.