Version Description
Download this release
Release Info
Developer | MotoPress |
Plugin | Timetable and Event Schedule by MotoPress |
Version | 2.4.0 |
Comparing to | |
See all releases |
Code changes from version 2.3.19 to 2.4.0
- admin/help/index.php +68 -54
- admin/import/index.php +28 -14
- classes/class-core.php +60 -2
- classes/class-hooks.php +2 -1
- classes/class-offer.php +214 -0
- classes/controllers/class-controller-events.php +22 -5
- classes/models/class-events.php +27 -3
- languages/mp-timetable.pot +79 -33
- media/css/admin.css +1 -1
- media/js/blocks/dist/index.js +1 -1
- media/js/events/event.min.js +1 -1
- media/js/mptt-option-ajax.js +70 -0
- media/js/mptt-option-ajax.min.js +1 -0
- media/less/admin.less +98 -0
- mp-timetable.php +1 -1
- readme.txt +3 -0
- templates/settings/general.php +23 -11
admin/help/index.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<div class="wrap">
|
|
|
2 |
<h1 class="wp-heading-inline">Help</h1>
|
3 |
<p><?php
|
4 |
|
@@ -13,58 +14,71 @@
|
|
13 |
);
|
14 |
?></p>
|
15 |
<hr/>
|
16 |
-
|
17 |
-
<
|
18 |
-
<
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
<
|
35 |
-
<
|
36 |
-
<
|
37 |
-
<
|
38 |
-
<
|
39 |
-
<
|
40 |
-
<
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
</div>
|
1 |
<div class="wrap">
|
2 |
+
|
3 |
<h1 class="wp-heading-inline">Help</h1>
|
4 |
<p><?php
|
5 |
|
14 |
);
|
15 |
?></p>
|
16 |
<hr/>
|
17 |
+
|
18 |
+
<div class="motopress-offer-primary">
|
19 |
+
<h2>Quick Start Guide</h2>
|
20 |
+
<ol>
|
21 |
+
<li>
|
22 |
+
<p><strong>Add Columns</strong><br/>
|
23 |
+
Make sure you created Columns prior to adding Events for the events to be then assigned to the created columns.</p>
|
24 |
+
</li>
|
25 |
+
<li>
|
26 |
+
<p><strong>Add Events</strong><br/>
|
27 |
+
The events will be displayed in the actual timetable. Event details will be shown on each event’s individual page.</p>
|
28 |
+
<ol>
|
29 |
+
<li>
|
30 |
+
<p><strong>Add Event Category</strong><br/>
|
31 |
+
Events can be presented under different categories, which can be chosen in the shortcode parameters below.</p>
|
32 |
+
</li>
|
33 |
+
</ol>
|
34 |
+
</li>
|
35 |
+
<li>
|
36 |
+
<p><strong>Add Timetable to a Page</strong></p>
|
37 |
+
<ol>
|
38 |
+
<li>Find "TimeTable" icon on TinyMCE panel in Classic Editor.</li>
|
39 |
+
<li>Build Timetable shortcode manually.
|
40 |
+
<p>Shortcode <code>[mp-timetable ... ]</code> attributes:</p>
|
41 |
+
<ul>
|
42 |
+
<li><code>col</code> - comma-separated column IDs.</li>
|
43 |
+
<li><code>events</code> - comma-separated event IDs.</li>
|
44 |
+
<li><code>event_categ</code> - comma-separated event category IDs.</li>
|
45 |
+
<li><code>increment</code> - hour measure; possible values <kbd>1</kbd> - hour (1h), <kbd>0.5</kbd> - half an hour (30min), <kbd>0.25</kbd> - quarter an hour (15min).</li>
|
46 |
+
<li><code>title</code> - display event title; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
47 |
+
<li><code>time</code> - display event time; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
48 |
+
<li><code>sub-title</code> - display event subtitle; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
49 |
+
<li><code>description</code> - display event description; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
50 |
+
<li><code>user</code> - display event head; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
51 |
+
<li><code>row_height</code> - event block height in pixels; example <kbd>45</kbd></li>
|
52 |
+
<li><code>font_size</code> - base font size for the table; example <kbd>12px</kbd>, <kbd>2em</kbd>, <kbd>80%</kbd>.</li>
|
53 |
+
<li><code>view</code> - filter style; possible values <kbd>dropdown_list</kbd> or <kbd>tabs</kbd>.</li>
|
54 |
+
<li><code>view_sort</code> - order of items in filter; possible values <kbd><i>empty string</i></kbd>, <kbd>menu_order</kbd>, <kbd>post_title</kbd>.</li>
|
55 |
+
<li><code>label</code> - filter label; default is <kbd>All Events</kbd>.</li>
|
56 |
+
<li><code>hide_label</code> - display 'All Events' label or not; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
57 |
+
<li><code>hide_hrs</code> - hide first (hours) column; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
58 |
+
<li><code>hide_empty_rows</code> - hide empty rows; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
59 |
+
<li><code>group</code> - merge cells with common events; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
60 |
+
<li><code>disable_event_url</code> - disable event URL; possible values <kbd>1</kbd> or <kbd>0</kbd>.</li>
|
61 |
+
<li><code>text_align</code> - horizontal align; possible values <kbd>left</kbd>, <kbd>center</kbd>, <kbd>right</kbd>.</li>
|
62 |
+
<li><code>text_align_vertical</code> - vertical align ; possible values <kbd>default</kbd>, <kbd>top</kbd>, <kbd>middle</kbd>, <kbd>bottom</kbd>.</li>
|
63 |
+
<li><code>id</code> - unique ID.</li>
|
64 |
+
<li><code>custom_class</code> - CSS class.</li>
|
65 |
+
<li><code>responsive</code> - mobile layout; possible values <kbd>1</kbd> - display as list, <kbd>0</kbd> - display as table.</li>
|
66 |
+
<li><code>table_layout</code> - column width; possible values <kbd>auto</kbd>, <kbd>fixed</kbd>.</li>
|
67 |
+
</ul>
|
68 |
+
</li>
|
69 |
+
<li>Use "TimeTable" block in the new Block Editor.</li>
|
70 |
+
</ol>
|
71 |
+
</li>
|
72 |
+
</ol>
|
73 |
+
</div>
|
74 |
+
<?php
|
75 |
+
|
76 |
+
/*
|
77 |
+
* Offer free plugins
|
78 |
+
*
|
79 |
+
*/
|
80 |
+
require_once Mp_Time_Table::get_plugin_path() . 'classes/class-offer.php';
|
81 |
+
$plugins_offer = new \mp_timetable\plugin_core\classes\Plugins_Offer();
|
82 |
+
$plugins_offer->render();
|
83 |
+
?>
|
84 |
</div>
|
admin/import/index.php
CHANGED
@@ -1,14 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
use mp_timetable\plugin_core\classes\View as View;
|
3 |
-
|
4 |
-
View::get_instance()->render_html('../admin/import/header', $data);
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
if ( current_user_can('
|
11 |
-
View::get_instance()->render_html('../admin/import/
|
12 |
-
}
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
use mp_timetable\plugin_core\classes\View as View;
|
3 |
+
|
4 |
+
View::get_instance()->render_html('../admin/import/header', $data);
|
5 |
+
|
6 |
+
?>
|
7 |
+
<div class="motopress-offer-primary">
|
8 |
+
<?php
|
9 |
+
|
10 |
+
if ( current_user_can('export') ) {
|
11 |
+
View::get_instance()->render_html('../admin/import/export', $data);
|
12 |
+
}
|
13 |
+
|
14 |
+
if ( current_user_can('import') ) {
|
15 |
+
View::get_instance()->render_html('../admin/import/import', $data);
|
16 |
+
}
|
17 |
+
?>
|
18 |
+
</div>
|
19 |
+
<?php
|
20 |
+
/*
|
21 |
+
* Offer free plugins
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
require_once Mp_Time_Table::get_plugin_path() . 'classes/class-offer.php';
|
25 |
+
$plugins_offer = new \mp_timetable\plugin_core\classes\Plugins_Offer();
|
26 |
+
$plugins_offer->render();
|
27 |
+
|
28 |
+
View::get_instance()->render_html('../admin/import/footer', $data);
|
classes/class-core.php
CHANGED
@@ -564,10 +564,38 @@ class Core {
|
|
564 |
);
|
565 |
|
566 |
wp_enqueue_script( 'underscore' );
|
|
|
567 |
wp_enqueue_style( 'mptt-admin-style', Mp_Time_Table::get_plugin_url( 'media/css/admin.css' ), array(), $this->version );
|
568 |
|
569 |
-
wp_enqueue_script( 'mptt-functions', Mp_Time_Table::get_plugin_url( 'media/js/mptt-functions' . $this->get_prefix() . '.js' ), array(), $this->version );
|
570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
if ( ! empty( $current_screen ) ) {
|
572 |
switch ( $current_screen->id ) {
|
573 |
case 'mp-event':
|
@@ -617,6 +645,36 @@ class Core {
|
|
617 |
}
|
618 |
}
|
619 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
|
621 |
/**
|
622 |
* Get prefix
|
564 |
);
|
565 |
|
566 |
wp_enqueue_script( 'underscore' );
|
567 |
+
|
568 |
wp_enqueue_style( 'mptt-admin-style', Mp_Time_Table::get_plugin_url( 'media/css/admin.css' ), array(), $this->version );
|
569 |
|
570 |
+
wp_enqueue_script( 'mptt-functions', Mp_Time_Table::get_plugin_url( 'media/js/mptt-functions' . $this->get_prefix() . '.js' ), array(), $this->version );
|
571 |
+
|
572 |
+
if ( ! empty( $_GET[ 'page' ] ) ) {
|
573 |
+
switch ( $_GET[ 'page' ] ) {
|
574 |
+
case 'mptt-settings' :
|
575 |
+
case 'mptt-import' :
|
576 |
+
case 'mptt-help' :
|
577 |
+
wp_register_script( 'mptt-option-ajax', Mp_Time_Table::get_plugin_url( 'media/js/mptt-option-ajax' . $this->get_prefix() . '.js' ), array( 'jquery' ), $this->version );
|
578 |
+
wp_enqueue_script( 'mptt-option-ajax' );
|
579 |
+
wp_localize_script(
|
580 |
+
'mptt-option-ajax',
|
581 |
+
'MPTT',
|
582 |
+
array(
|
583 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
584 |
+
'nonce' => wp_create_nonce( 'mptt-install-plugins' ),
|
585 |
+
'status_download' => esc_html__( 'Install Plugin', 'mp-timetable' ),
|
586 |
+
'status_activated' => esc_html__( 'Activated', 'mp-timetable' ),
|
587 |
+
'status_active' => esc_html__( 'Active', 'mp-timetable' ),
|
588 |
+
'status_inactive' => esc_html__( 'Inactive', 'mp-timetable' ),
|
589 |
+
'status_loading' => esc_html__( 'Loading...', 'mp-timetable' ),
|
590 |
+
'status_activate' => esc_html__( 'Activate', 'mp-timetable' ),
|
591 |
+
)
|
592 |
+
);
|
593 |
+
break;
|
594 |
+
default :
|
595 |
+
break;
|
596 |
+
}
|
597 |
+
}
|
598 |
+
|
599 |
if ( ! empty( $current_screen ) ) {
|
600 |
switch ( $current_screen->id ) {
|
601 |
case 'mp-event':
|
645 |
}
|
646 |
}
|
647 |
}
|
648 |
+
|
649 |
+
public function wp_ajax_install_plugin_ajax() {
|
650 |
+
|
651 |
+
$action = isset( $_REQUEST[ "action" ] ) ? $_REQUEST[ "action" ] : null;
|
652 |
+
|
653 |
+
if ( $action && $action === 'install_plugin_ajax' ) {
|
654 |
+
|
655 |
+
if ( empty( $_POST[ 'status' ] ) ) {
|
656 |
+
wp_send_json_error();
|
657 |
+
}
|
658 |
+
|
659 |
+
$status = sanitize_key( $_POST[ 'status' ] );
|
660 |
+
|
661 |
+
require_once Mp_Time_Table::get_plugin_path() . 'classes/class-offer.php';
|
662 |
+
$plugins_offer = new Plugins_Offer();
|
663 |
+
|
664 |
+
switch ( $status ) {
|
665 |
+
case 'activate' :
|
666 |
+
$plugins_offer->activatePluginAjax();
|
667 |
+
break;
|
668 |
+
case 'install' :
|
669 |
+
$plugins_offer->installPluginAjax();
|
670 |
+
break;
|
671 |
+
default :
|
672 |
+
break;
|
673 |
+
}
|
674 |
+
|
675 |
+
wp_send_json_success();
|
676 |
+
}
|
677 |
+
}
|
678 |
|
679 |
/**
|
680 |
* Get prefix
|
classes/class-hooks.php
CHANGED
@@ -186,7 +186,8 @@ class Hooks extends Core {
|
|
186 |
add_action( 'add_meta_boxes', array( Post::get_instance(), 'add_meta_boxes' ) );
|
187 |
add_action( 'save_post', array( Post::get_instance(), 'save_custom_post' ), 40, 2 );
|
188 |
add_action( 'wp_ajax_route_url', array( Core::get_instance(), "wp_ajax_route_url" ) );
|
189 |
-
|
|
|
190 |
register_importer( 'mptt-importer', 'Timetable', __( 'Import Timetable events, categories, tags and images.', 'mp-timetable' ), array( Import::get_instance(), 'import' ) );
|
191 |
}
|
192 |
|
186 |
add_action( 'add_meta_boxes', array( Post::get_instance(), 'add_meta_boxes' ) );
|
187 |
add_action( 'save_post', array( Post::get_instance(), 'save_custom_post' ), 40, 2 );
|
188 |
add_action( 'wp_ajax_route_url', array( Core::get_instance(), "wp_ajax_route_url" ) );
|
189 |
+
add_action( 'wp_ajax_install_plugin_ajax', array( Core::get_instance(), 'wp_ajax_install_plugin_ajax' ) );
|
190 |
+
|
191 |
register_importer( 'mptt-importer', 'Timetable', __( 'Import Timetable events, categories, tags and images.', 'mp-timetable' ), array( Import::get_instance(), 'import' ) );
|
192 |
}
|
193 |
|
classes/class-offer.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace mp_timetable\plugin_core\classes;
|
4 |
+
|
5 |
+
class Plugins_Offer {
|
6 |
+
|
7 |
+
public function __construct() { }
|
8 |
+
|
9 |
+
public static function activatePluginAjax() {
|
10 |
+
|
11 |
+
check_ajax_referer( 'mptt-install-plugins', 'nonce' );
|
12 |
+
|
13 |
+
$error = esc_html__( 'Could not activate the plugin.', 'mp-timetable' );
|
14 |
+
|
15 |
+
if ( ! current_user_can( 'activate_plugins' ) ) {
|
16 |
+
|
17 |
+
wp_send_json_error( $error );
|
18 |
+
}
|
19 |
+
|
20 |
+
if ( isset( $_POST[ 'plugin' ] ) ) {
|
21 |
+
|
22 |
+
$activate = activate_plugins( $_POST[ 'plugin' ] );
|
23 |
+
|
24 |
+
if ( ! is_wp_error( $activate ) ) {
|
25 |
+
wp_send_json_success(
|
26 |
+
[
|
27 |
+
'is_activated' => true
|
28 |
+
]
|
29 |
+
);
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
wp_send_json_error( $error );
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function installPluginAjax() {
|
37 |
+
|
38 |
+
check_ajax_referer( 'mptt-install-plugins', 'nonce' );
|
39 |
+
|
40 |
+
$slug = wp_unslash( strtok( $_POST[ 'plugin' ], '/' ) );
|
41 |
+
|
42 |
+
if ( empty( $_POST[ 'plugin' ] ) ) {
|
43 |
+
wp_send_json_error( esc_html__( 'Could not install the plugin.', 'mp-timetable' ) );
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
47 |
+
wp_send_json_error( esc_html__( 'Sorry, you are not allowed to install plugins on this site.', 'mp-timetable' ) );
|
48 |
+
}
|
49 |
+
|
50 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
51 |
+
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
52 |
+
|
53 |
+
$api = plugins_api(
|
54 |
+
'plugin_information',
|
55 |
+
array(
|
56 |
+
'slug' => sanitize_key( $slug ),
|
57 |
+
'fields' => array(
|
58 |
+
'sections' => false,
|
59 |
+
),
|
60 |
+
)
|
61 |
+
);
|
62 |
+
|
63 |
+
if ( is_wp_error( $api ) ) {
|
64 |
+
|
65 |
+
wp_send_json_error( $api->get_error_message() );
|
66 |
+
}
|
67 |
+
|
68 |
+
$skin = new \WP_Ajax_Upgrader_Skin();
|
69 |
+
$upgrader = new \Plugin_Upgrader( $skin );
|
70 |
+
$result = $upgrader->install( $api->download_link );
|
71 |
+
|
72 |
+
wp_cache_flush();
|
73 |
+
|
74 |
+
if ( is_wp_error( $result ) ) {
|
75 |
+
|
76 |
+
wp_send_json_error( $result->get_error_message() );
|
77 |
+
} elseif ( is_wp_error( $skin->result ) ) {
|
78 |
+
|
79 |
+
wp_send_json_error( $skin->result->get_error_message() );
|
80 |
+
} elseif ( $skin->get_errors()->has_errors() ) {
|
81 |
+
|
82 |
+
wp_send_json_error( $skin->get_error_messages() );
|
83 |
+
} elseif ( is_null( $result ) ) {
|
84 |
+
|
85 |
+
global $wp_filesystem;
|
86 |
+
|
87 |
+
$error = esc_html__( 'Unable to connect to the filesystem. Please confirm your credentials.' );
|
88 |
+
|
89 |
+
if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
|
90 |
+
$error = esc_html__( $wp_filesystem->errors->get_error_message() );
|
91 |
+
}
|
92 |
+
|
93 |
+
wp_send_json_error( $error );
|
94 |
+
}
|
95 |
+
|
96 |
+
$install_status = install_plugin_install_status( $api );
|
97 |
+
|
98 |
+
if ( is_plugin_inactive( $install_status[ 'file' ] ) ) {
|
99 |
+
wp_send_json_success(
|
100 |
+
[
|
101 |
+
'is_activated' => false
|
102 |
+
]
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
wp_send_json_error( esc_html__( 'Could not install the plugin.', 'mp-timetable' ) );
|
107 |
+
}
|
108 |
+
|
109 |
+
private function getPluginLists() {
|
110 |
+
|
111 |
+
$plugins = array(
|
112 |
+
'getwid' => array(
|
113 |
+
'slug' => 'getwid',
|
114 |
+
'name' => 'Getwid: 40+ Free Gutenberg Blocks',
|
115 |
+
'path' => 'getwid/getwid.php',
|
116 |
+
'icon' => 'https://ps.w.org/getwid/assets/icon.svg',
|
117 |
+
'description' => 'Getwid is a collection of 40+ Gutenberg blocks that greatly extends the library of existing core WordPress blocks and 35+ unique pre-made block templates for the Block Editor.'
|
118 |
+
),
|
119 |
+
'stratum' => array(
|
120 |
+
'slug' => 'stratum',
|
121 |
+
'name' => 'Stratum: 20+ Free Elementor Widgets',
|
122 |
+
'path' => 'stratum/stratum.php',
|
123 |
+
'icon' => 'https://ps.w.org/stratum/assets/icon.svg',
|
124 |
+
'description' => 'Stratum is a free collection of 20+ Elementor addons with the aim of enhancing the existing widget functionality of your favorite page builder.'
|
125 |
+
),
|
126 |
+
'hotel-booking' => array(
|
127 |
+
'slug' => 'motopress-hotel-booking-lite',
|
128 |
+
'name' => 'Hotel Booking: WordPress Booking Plugin',
|
129 |
+
'path' => 'motopress-hotel-booking-lite/motopress-hotel-booking.php',
|
130 |
+
'icon' => 'https://ps.w.org/motopress-hotel-booking-lite/assets/icon-128x128.png',
|
131 |
+
'description' => 'Hotel Booking plugin by MotoPress is the ultimate WordPress property rental system with a real lodging business in mind.'
|
132 |
+
)
|
133 |
+
);
|
134 |
+
|
135 |
+
return $plugins;
|
136 |
+
}
|
137 |
+
|
138 |
+
private function getPluginInstallationLink( $slug ) {
|
139 |
+
|
140 |
+
$action = 'install-plugin';
|
141 |
+
|
142 |
+
return wp_nonce_url(
|
143 |
+
add_query_arg(
|
144 |
+
array(
|
145 |
+
'action' => $action,
|
146 |
+
'plugin' => $slug
|
147 |
+
),
|
148 |
+
admin_url( 'update.php' )
|
149 |
+
),
|
150 |
+
$action.'_'.$slug
|
151 |
+
);
|
152 |
+
}
|
153 |
+
|
154 |
+
// check status
|
155 |
+
private function getPluginData( $plugin ) {
|
156 |
+
|
157 |
+
if ( array_key_exists( $plugin['path'], get_plugins() ) ) {
|
158 |
+
|
159 |
+
if ( is_plugin_active( $plugin['path'] ) ) {
|
160 |
+
$plugin['status_text'] = esc_html__( 'Active', 'mp-timetable' );
|
161 |
+
$plugin['status_class'] = 'active';
|
162 |
+
$plugin['action_class'] = 'button button-secondary disabled';
|
163 |
+
$plugin['action_text'] = esc_html__( 'Activated', 'mp-timetable' );
|
164 |
+
} else {
|
165 |
+
$plugin['status_text'] = esc_html__( 'Inactive', 'mp-timetable' );
|
166 |
+
$plugin['status_class'] = 'inactive';
|
167 |
+
$plugin['action_class'] = 'button button-secondary';
|
168 |
+
$plugin['action_text'] = esc_html__( 'Activate', 'mp-timetable' );
|
169 |
+
}
|
170 |
+
} else {
|
171 |
+
$plugin['status_text'] = esc_html__( 'Not Installed', 'mp-timetable' );
|
172 |
+
$plugin['status_class'] = 'not-installed';
|
173 |
+
$plugin['action_class'] = 'button button-primary';
|
174 |
+
$plugin['action_text'] = esc_html__( 'Install Plugin', 'mp-timetable' );
|
175 |
+
}
|
176 |
+
|
177 |
+
return $plugin;
|
178 |
+
}
|
179 |
+
|
180 |
+
public function render() {
|
181 |
+
?>
|
182 |
+
<div class="motopress-offer-secondary">
|
183 |
+
|
184 |
+
<h2>More free plugins for you</h2>
|
185 |
+
<?php
|
186 |
+
foreach ( $this->getPluginLists() as $key => $plugin ) :
|
187 |
+
|
188 |
+
$plugin = $this->getPluginData( $plugin );
|
189 |
+
?>
|
190 |
+
<div class="plugin-container">
|
191 |
+
<div class="plugin-item">
|
192 |
+
<div class="details">
|
193 |
+
<img src="<?php echo esc_url( $plugin['icon'] ); ?>">
|
194 |
+
<h5 class="plugin-name"><?php echo esc_html( $plugin['name'] ); ?></h5>
|
195 |
+
<p class="plugin-description"><?php echo esc_html( $plugin['description'] ); ?></p>
|
196 |
+
</div>
|
197 |
+
<div class="actions">
|
198 |
+
<div class="status">
|
199 |
+
<strong>Status: <span class="status-label <?php echo esc_attr( $plugin['status_class'] ); ?>">
|
200 |
+
<?php echo esc_html( $plugin['status_text'] ); ?></span></strong>
|
201 |
+
</div>
|
202 |
+
<div class="action-button">
|
203 |
+
<button data-path="<?php echo esc_attr( $plugin[ 'path' ] ); ?>" class="<?php echo esc_attr( $plugin['action_class'] ); ?>">
|
204 |
+
<?php echo esc_html( $plugin['action_text'] ); ?>
|
205 |
+
</button>
|
206 |
+
</div>
|
207 |
+
</div>
|
208 |
+
</div>
|
209 |
+
</div>
|
210 |
+
<?php endforeach; ?>
|
211 |
+
</div>
|
212 |
+
<?php
|
213 |
+
}
|
214 |
+
}
|
classes/controllers/class-controller-events.php
CHANGED
@@ -40,9 +40,18 @@ class Controller_Events extends Controller {
|
|
40 |
*/
|
41 |
public function action_delete() {
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
$result = $this->get('events')->delete_event(
|
46 |
|
47 |
if ($result === false) {
|
48 |
wp_send_json_error(array('status' => $result));
|
@@ -95,11 +104,19 @@ class Controller_Events extends Controller {
|
|
95 |
*/
|
96 |
public function action_update_event_data() {
|
97 |
|
98 |
-
$
|
99 |
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
-
$result = $this->get('events')->update_event_data($
|
103 |
|
104 |
if ($result === false) {
|
105 |
wp_send_json_error(array('status' => false));
|
40 |
*/
|
41 |
public function action_delete() {
|
42 |
|
43 |
+
$id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
|
44 |
+
|
45 |
+
$event_id = 0;
|
46 |
+
$timeslot = $this->get('events')->get_timeslot_by_id( $id );
|
47 |
+
|
48 |
+
if ( $timeslot ) {
|
49 |
+
$event_id = (int) $timeslot->event_id;
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( $event_id && current_user_can( 'edit_post', $event_id ) ) {
|
53 |
|
54 |
+
$result = $this->get('events')->delete_event( $id );
|
55 |
|
56 |
if ($result === false) {
|
57 |
wp_send_json_error(array('status' => $result));
|
104 |
*/
|
105 |
public function action_update_event_data() {
|
106 |
|
107 |
+
$data = $_REQUEST[ 'data' ];
|
108 |
|
109 |
+
$event_id = 0;
|
110 |
+
$id = (int) $data[ 'id' ];
|
111 |
+
$timeslot = $this->get('events')->get_timeslot_by_id( $id );
|
112 |
+
|
113 |
+
if ( $timeslot ) {
|
114 |
+
$event_id = (int) $timeslot->event_id;
|
115 |
+
}
|
116 |
+
|
117 |
+
if ( $event_id && current_user_can( 'edit_post', $event_id ) ) {
|
118 |
|
119 |
+
$result = $this->get('events')->update_event_data( $data );
|
120 |
|
121 |
if ($result === false) {
|
122 |
wp_send_json_error(array('status' => false));
|
classes/models/class-events.php
CHANGED
@@ -117,11 +117,21 @@ class Events extends Model {
|
|
117 |
. " WHERE t.`{$params["field"]}` = {$params['id']} "
|
118 |
. " ORDER BY p.`menu_order`, t.`{$order_by}`"
|
119 |
);
|
120 |
-
|
121 |
foreach ( $event_data as $key => $event ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
$event_data[ $key ]->event_start = date( 'H:i', strtotime( $event_data[ $key ]->event_start ) );
|
123 |
$event_data[ $key ]->event_end = date( 'H:i', strtotime( $event_data[ $key ]->event_end ) );
|
124 |
-
$event_data[ $key ]->user =
|
125 |
$event_data[ $key ]->post = get_post( $event_data[ $key ]->event_id );
|
126 |
$event_data[ $key ]->description = stripcslashes( $event_data[ $key ]->description );
|
127 |
}
|
@@ -684,6 +694,9 @@ class Events extends Model {
|
|
684 |
* @return false|int
|
685 |
*/
|
686 |
public function update_event_data( $data ) {
|
|
|
|
|
|
|
687 |
$result = $this->wpdb->update(
|
688 |
$this->table_name,
|
689 |
array(
|
@@ -693,7 +706,7 @@ class Events extends Model {
|
|
693 |
'column_id' => $data[ 'weekday_ids' ],
|
694 |
'user_id' => $data[ 'user_id' ],
|
695 |
),
|
696 |
-
array( 'id' => $
|
697 |
array(
|
698 |
'%s',
|
699 |
'%s',
|
@@ -900,4 +913,15 @@ class Events extends Model {
|
|
900 |
}
|
901 |
}
|
902 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
903 |
}
|
117 |
. " WHERE t.`{$params["field"]}` = {$params['id']} "
|
118 |
. " ORDER BY p.`menu_order`, t.`{$order_by}`"
|
119 |
);
|
120 |
+
|
121 |
foreach ( $event_data as $key => $event ) {
|
122 |
+
|
123 |
+
$user = false;
|
124 |
+
$wpUser = get_user_by( 'id', $event_data[ $key ]->user_id );
|
125 |
+
|
126 |
+
if ( ! empty( $wpUser ) ) {
|
127 |
+
$user = new \stdClass();
|
128 |
+
$user->ID = $wpUser->ID;
|
129 |
+
$user->display_name = $wpUser->data->display_name;
|
130 |
+
}
|
131 |
+
|
132 |
$event_data[ $key ]->event_start = date( 'H:i', strtotime( $event_data[ $key ]->event_start ) );
|
133 |
$event_data[ $key ]->event_end = date( 'H:i', strtotime( $event_data[ $key ]->event_end ) );
|
134 |
+
$event_data[ $key ]->user = $user;
|
135 |
$event_data[ $key ]->post = get_post( $event_data[ $key ]->event_id );
|
136 |
$event_data[ $key ]->description = stripcslashes( $event_data[ $key ]->description );
|
137 |
}
|
694 |
* @return false|int
|
695 |
*/
|
696 |
public function update_event_data( $data ) {
|
697 |
+
|
698 |
+
$id = (int) $data[ 'id' ];
|
699 |
+
|
700 |
$result = $this->wpdb->update(
|
701 |
$this->table_name,
|
702 |
array(
|
706 |
'column_id' => $data[ 'weekday_ids' ],
|
707 |
'user_id' => $data[ 'user_id' ],
|
708 |
),
|
709 |
+
array( 'id' => $id ),
|
710 |
array(
|
711 |
'%s',
|
712 |
'%s',
|
913 |
}
|
914 |
}
|
915 |
|
916 |
+
public function get_timeslot_by_id( $id ) {
|
917 |
+
|
918 |
+
global $wpdb;
|
919 |
+
|
920 |
+
$timeslot = $wpdb->get_row(
|
921 |
+
$wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id )
|
922 |
+
);
|
923 |
+
|
924 |
+
return $timeslot;
|
925 |
+
}
|
926 |
+
|
927 |
}
|
languages/mp-timetable.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Timetable and Event Schedule plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Timetable and Event Schedule 2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mp-timetable\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2021-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: mp-timetable\n"
|
@@ -35,7 +35,7 @@ msgid "https://motopress.com"
|
|
35 |
msgstr ""
|
36 |
|
37 |
#. translators: 1: Timetable and Event Schedule 2:: five stars rating
|
38 |
-
#: admin/help/index.php:
|
39 |
#: templates/settings/general.php:41
|
40 |
msgid "If you like %1$s please leave us a %2$s rating."
|
41 |
msgstr ""
|
@@ -160,7 +160,7 @@ msgstr ""
|
|
160 |
|
161 |
#: classes/class-core.php:442
|
162 |
#: classes/class-core.php:453
|
163 |
-
#: classes/class-hooks.php:
|
164 |
#: classes/class-shortcode.php:260
|
165 |
msgid "Events"
|
166 |
msgstr ""
|
@@ -200,7 +200,7 @@ msgstr ""
|
|
200 |
|
201 |
#: classes/class-core.php:481
|
202 |
#: classes/class-core.php:492
|
203 |
-
#: classes/class-hooks.php:
|
204 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:116
|
205 |
#: templates/popup/index.php:5
|
206 |
#: media/js/blocks/dist/index.js:1
|
@@ -246,65 +246,111 @@ msgstr ""
|
|
246 |
msgid "No Columns found in Trash"
|
247 |
msgstr ""
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
#: classes/class-hooks.php:81
|
250 |
msgid "Timetable Sidebar"
|
251 |
msgstr ""
|
252 |
|
253 |
#: classes/class-hooks.php:83
|
254 |
-
#: classes/class-hooks.php:
|
255 |
#: classes/class-shortcode.php:371
|
256 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:21
|
257 |
#: media/js/blocks/dist/index.js:1
|
258 |
msgid "Timetable"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: classes/class-hooks.php:
|
262 |
msgid "Import Timetable events, categories, tags and images."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: classes/class-hooks.php:
|
266 |
msgid "Add Event"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: classes/class-hooks.php:
|
270 |
msgid "Add Column"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: classes/class-hooks.php:
|
274 |
msgid "Event Categories"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: classes/class-hooks.php:
|
278 |
msgid "Event Tags"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: classes/class-hooks.php:
|
282 |
#: classes/modules/class-post.php:41
|
283 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:89
|
284 |
#: media/js/blocks/dist/index.js:1
|
285 |
msgid "Settings"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: classes/class-hooks.php:
|
289 |
msgid "Export / Import"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: classes/class-hooks.php:
|
293 |
msgid "Help & Shortcode"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: classes/class-hooks.php:
|
297 |
msgid "Quick Start Guide"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: classes/class-hooks.php:
|
301 |
msgid "Help"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: classes/class-hooks.php:
|
305 |
msgid "Leave a Review"
|
306 |
msgstr ""
|
307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
#: classes/class-permalinks.php:26
|
309 |
msgid "Timetable Permalinks"
|
310 |
msgstr ""
|
@@ -577,28 +623,28 @@ msgstr ""
|
|
577 |
msgid "Timeslots"
|
578 |
msgstr ""
|
579 |
|
580 |
-
#: classes/models/class-events.php:
|
581 |
msgid "Tags"
|
582 |
msgstr ""
|
583 |
|
584 |
-
#: classes/models/class-events.php:
|
585 |
msgid "Categories"
|
586 |
msgstr ""
|
587 |
|
588 |
-
#: classes/models/class-events.php:
|
589 |
msgid "Duplicate"
|
590 |
msgstr ""
|
591 |
|
592 |
-
#: classes/models/class-events.php:
|
593 |
msgid "A post type mismatch has been detected."
|
594 |
msgstr ""
|
595 |
|
596 |
-
#: classes/models/class-events.php:
|
597 |
msgid "Sorry, you are not allowed to edit this item."
|
598 |
msgstr ""
|
599 |
|
600 |
#. translators: New post title of the duplicated post
|
601 |
-
#: classes/models/class-events.php:
|
602 |
msgid "%s - Copy"
|
603 |
msgstr ""
|
604 |
|
@@ -1095,41 +1141,41 @@ msgstr ""
|
|
1095 |
msgid "General Settings"
|
1096 |
msgstr ""
|
1097 |
|
1098 |
-
#: templates/settings/general.php:
|
1099 |
msgid "Template Mode"
|
1100 |
msgstr ""
|
1101 |
|
1102 |
-
#: templates/settings/general.php:
|
1103 |
msgid "Theme Mode"
|
1104 |
msgstr ""
|
1105 |
|
1106 |
-
#: templates/settings/general.php:
|
1107 |
msgid "Developer Mode"
|
1108 |
msgstr ""
|
1109 |
|
1110 |
-
#: templates/settings/general.php:
|
1111 |
msgid "Choose Theme Mode to display the content with the styles of your theme. Choose Developer Mode to control appearance of the content with custom page templates, actions and filters."
|
1112 |
msgstr ""
|
1113 |
|
1114 |
-
#: templates/settings/general.php:
|
1115 |
msgid "This option can't be changed if your theme is initially integrated with the plugin."
|
1116 |
msgstr ""
|
1117 |
|
1118 |
-
#: templates/settings/general.php:
|
1119 |
msgid "Permalink Settings"
|
1120 |
msgstr ""
|
1121 |
|
1122 |
-
#: templates/settings/general.php:
|
1123 |
msgid "Configure permalink settings in <a href=\"%s\">Settings > Permalinks</a>"
|
1124 |
msgstr ""
|
1125 |
|
1126 |
-
#: templates/settings/general.php:
|
1127 |
msgid "Save"
|
1128 |
msgstr ""
|
1129 |
|
1130 |
#: templates/shortcodes/empty-search-events.php:1
|
1131 |
-
#: templates/theme/widget-upcoming-view.php:
|
1132 |
-
#: templates/widgets/widget-view.php:
|
1133 |
msgid "no events found"
|
1134 |
msgstr ""
|
1135 |
|
2 |
# This file is distributed under the same license as the Timetable and Event Schedule plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Timetable and Event Schedule 2.4.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mp-timetable\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2021-08-10T22:38:00+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: mp-timetable\n"
|
35 |
msgstr ""
|
36 |
|
37 |
#. translators: 1: Timetable and Event Schedule 2:: five stars rating
|
38 |
+
#: admin/help/index.php:11
|
39 |
#: templates/settings/general.php:41
|
40 |
msgid "If you like %1$s please leave us a %2$s rating."
|
41 |
msgstr ""
|
160 |
|
161 |
#: classes/class-core.php:442
|
162 |
#: classes/class-core.php:453
|
163 |
+
#: classes/class-hooks.php:204
|
164 |
#: classes/class-shortcode.php:260
|
165 |
msgid "Events"
|
166 |
msgstr ""
|
200 |
|
201 |
#: classes/class-core.php:481
|
202 |
#: classes/class-core.php:492
|
203 |
+
#: classes/class-hooks.php:212
|
204 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:116
|
205 |
#: templates/popup/index.php:5
|
206 |
#: media/js/blocks/dist/index.js:1
|
246 |
msgid "No Columns found in Trash"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: classes/class-core.php:585
|
250 |
+
#: classes/class-offer.php:174
|
251 |
+
msgid "Install Plugin"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: classes/class-core.php:586
|
255 |
+
#: classes/class-offer.php:163
|
256 |
+
msgid "Activated"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: classes/class-core.php:587
|
260 |
+
#: classes/class-offer.php:160
|
261 |
+
msgid "Active"
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
#: classes/class-core.php:588
|
265 |
+
#: classes/class-offer.php:165
|
266 |
+
msgid "Inactive"
|
267 |
+
msgstr ""
|
268 |
+
|
269 |
+
#: classes/class-core.php:589
|
270 |
+
msgid "Loading..."
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: classes/class-core.php:590
|
274 |
+
#: classes/class-offer.php:168
|
275 |
+
msgid "Activate"
|
276 |
+
msgstr ""
|
277 |
+
|
278 |
#: classes/class-hooks.php:81
|
279 |
msgid "Timetable Sidebar"
|
280 |
msgstr ""
|
281 |
|
282 |
#: classes/class-hooks.php:83
|
283 |
+
#: classes/class-hooks.php:200
|
284 |
#: classes/class-shortcode.php:371
|
285 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:21
|
286 |
#: media/js/blocks/dist/index.js:1
|
287 |
msgid "Timetable"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: classes/class-hooks.php:191
|
291 |
msgid "Import Timetable events, categories, tags and images."
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: classes/class-hooks.php:208
|
295 |
msgid "Add Event"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: classes/class-hooks.php:216
|
299 |
msgid "Add Column"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: classes/class-hooks.php:220
|
303 |
msgid "Event Categories"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: classes/class-hooks.php:224
|
307 |
msgid "Event Tags"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: classes/class-hooks.php:228
|
311 |
#: classes/modules/class-post.php:41
|
312 |
#: classes/widgets/class-mp-timetable-elementor-widget.php:89
|
313 |
#: media/js/blocks/dist/index.js:1
|
314 |
msgid "Settings"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: classes/class-hooks.php:232
|
318 |
msgid "Export / Import"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: classes/class-hooks.php:236
|
322 |
msgid "Help & Shortcode"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: classes/class-hooks.php:300
|
326 |
msgid "Quick Start Guide"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: classes/class-hooks.php:301
|
330 |
msgid "Help"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: classes/class-hooks.php:302
|
334 |
msgid "Leave a Review"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: classes/class-offer.php:13
|
338 |
+
msgid "Could not activate the plugin."
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: classes/class-offer.php:43
|
342 |
+
#: classes/class-offer.php:106
|
343 |
+
msgid "Could not install the plugin."
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: classes/class-offer.php:47
|
347 |
+
msgid "Sorry, you are not allowed to install plugins on this site."
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: classes/class-offer.php:171
|
351 |
+
msgid "Not Installed"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
#: classes/class-permalinks.php:26
|
355 |
msgid "Timetable Permalinks"
|
356 |
msgstr ""
|
623 |
msgid "Timeslots"
|
624 |
msgstr ""
|
625 |
|
626 |
+
#: classes/models/class-events.php:181
|
627 |
msgid "Tags"
|
628 |
msgstr ""
|
629 |
|
630 |
+
#: classes/models/class-events.php:182
|
631 |
msgid "Categories"
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: classes/models/class-events.php:793
|
635 |
msgid "Duplicate"
|
636 |
msgstr ""
|
637 |
|
638 |
+
#: classes/models/class-events.php:814
|
639 |
msgid "A post type mismatch has been detected."
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: classes/models/class-events.php:814
|
643 |
msgid "Sorry, you are not allowed to edit this item."
|
644 |
msgstr ""
|
645 |
|
646 |
#. translators: New post title of the duplicated post
|
647 |
+
#: classes/models/class-events.php:838
|
648 |
msgid "%s - Copy"
|
649 |
msgstr ""
|
650 |
|
1141 |
msgid "General Settings"
|
1142 |
msgstr ""
|
1143 |
|
1144 |
+
#: templates/settings/general.php:10
|
1145 |
msgid "Template Mode"
|
1146 |
msgstr ""
|
1147 |
|
1148 |
+
#: templates/settings/general.php:14
|
1149 |
msgid "Theme Mode"
|
1150 |
msgstr ""
|
1151 |
|
1152 |
+
#: templates/settings/general.php:15
|
1153 |
msgid "Developer Mode"
|
1154 |
msgstr ""
|
1155 |
|
1156 |
+
#: templates/settings/general.php:17
|
1157 |
msgid "Choose Theme Mode to display the content with the styles of your theme. Choose Developer Mode to control appearance of the content with custom page templates, actions and filters."
|
1158 |
msgstr ""
|
1159 |
|
1160 |
+
#: templates/settings/general.php:17
|
1161 |
msgid "This option can't be changed if your theme is initially integrated with the plugin."
|
1162 |
msgstr ""
|
1163 |
|
1164 |
+
#: templates/settings/general.php:24
|
1165 |
msgid "Permalink Settings"
|
1166 |
msgstr ""
|
1167 |
|
1168 |
+
#: templates/settings/general.php:25
|
1169 |
msgid "Configure permalink settings in <a href=\"%s\">Settings > Permalinks</a>"
|
1170 |
msgstr ""
|
1171 |
|
1172 |
+
#: templates/settings/general.php:30
|
1173 |
msgid "Save"
|
1174 |
msgstr ""
|
1175 |
|
1176 |
#: templates/shortcodes/empty-search-events.php:1
|
1177 |
+
#: templates/theme/widget-upcoming-view.php:57
|
1178 |
+
#: templates/widgets/widget-view.php:97
|
1179 |
msgid "no events found"
|
1180 |
msgstr ""
|
1181 |
|
media/css/admin.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#mp-event_data #add_event_table #event_end,#mp-event_data #add_event_table #event_start{min-width:100px}#mp-event_data .spinner.left{float:none}#mp-event_data .events-list-wrapper{max-height:360px;overflow-y:auto;overflow-x:hidden;margin-bottom:1em}#mp-event_data #events-list .active *{background-color:#F7FCFE}#mp-event_data #events-list .active td:first-child{border-left:4px solid #0091cd}#mp-event_data #events-list .delete-event-button,#mp-event_data #events-list .edit-event-button{margin:0 5px 10px 0;position:relative;width:2em;height:2em}#mp-event_data #events-list .delete-event-button.icon:before,#mp-event_data #events-list .edit-event-button.icon:before{font-family:Dashicons;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}@media screen and (max-width:1200px){#mp-event_data #events-list .event-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}#column-options .mp-date,#column-options .mp-weekday{margin:10px 0 0}div[id^=jBoxID].jBox-Modal .jBox-container{overflow:hidden}div[id^=jBoxID].jBox-Modal .jBox-content{max-width:980px;max-height:800px;padding:0;overflow:hidden}div[id^=jBoxID].jBox-Modal .jBox-content>form{height:100%;overflow:hidden;position:relative}div[id^=jBoxID].jBox-Modal .jBox-content>form .mptt-shortcode-settings-wrapper{height:calc(100% - 60px);overflow-y:scroll;padding:0 15px 0 10px}div[id^=jBoxID].jBox-Modal .jBox-content>form .mptt-shortcode-submit-wrapper{background:#f4f5f6;border-top:1px solid #ddd;padding:15px;position:relative;text-align:left}#add_event_options_table.form-table tr>:first-child,#add_event_table.form-table tr>:first-child{vertical-align:top;text-align:left;padding:20px 10px 20px 0;width:200px;line-height:1.3;font-weight:600}select.mptt-resize-vertical{resize:vertical;min-height:4em}
|
1 |
+
#mp-event_data #add_event_table{padding:1em .5em}#mp-event_data #add_event_table #event_end,#mp-event_data #add_event_table #event_start{min-width:100px}#mp-event_data .spinner.left{float:none}#mp-event_data .events-list-wrapper{max-height:360px;overflow-y:auto;overflow-x:hidden;margin-bottom:1em}#mp-event_data #events-list .active *{background-color:#F7FCFE}#mp-event_data #events-list .active td:first-child{border-left:4px solid #0091cd}#mp-event_data #events-list .delete-event-button,#mp-event_data #events-list .edit-event-button{margin:0 5px 10px 0;position:relative;width:2em;height:2em}#mp-event_data #events-list .delete-event-button.icon:before,#mp-event_data #events-list .edit-event-button.icon:before{font-family:Dashicons;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}@media screen and (max-width:1200px){#mp-event_data #events-list .event-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}#column-options .mp-date,#column-options .mp-weekday{margin:10px 0 0}div[id^=jBoxID].jBox-Modal .jBox-container{overflow:hidden}div[id^=jBoxID].jBox-Modal .jBox-content{max-width:980px;max-height:800px;padding:0;overflow:hidden}div[id^=jBoxID].jBox-Modal .jBox-content>form{height:100%;overflow:hidden;position:relative}div[id^=jBoxID].jBox-Modal .jBox-content>form .mptt-shortcode-settings-wrapper{height:calc(100% - 60px);overflow-y:scroll;padding:0 15px 0 10px}div[id^=jBoxID].jBox-Modal .jBox-content>form .mptt-shortcode-submit-wrapper{background:#f4f5f6;border-top:1px solid #ddd;padding:15px;position:relative;text-align:left}#add_event_options_table.form-table tr>:first-child,#add_event_table.form-table tr>:first-child{vertical-align:top;text-align:left;padding:20px 10px 20px 0;width:200px;line-height:1.3;font-weight:600}select.mptt-resize-vertical{resize:vertical;min-height:4em}.motopress-offer-primary{float:left;width:60%}.motopress-offer-secondary{float:right;width:38%;max-width:500px;margin-left:2%;display:block}.motopress-offer-secondary .plugin-container .plugin-item .actions:after,.motopress-offer-secondary .plugin-container .plugin-item .details:after,.motopress-offer-secondary:after{display:table;clear:both;content:''}.motopress-offer-secondary *{-webkit-box-sizing:border-box;box-sizing:border-box}.motopress-offer-secondary .plugin-container{margin-bottom:20px}.motopress-offer-secondary .plugin-container .plugin-item{background-color:#fff;border:1px solid #ddd;border-radius:3px;margin:0}.motopress-offer-secondary .plugin-container .plugin-item .details{padding:20px}.motopress-offer-secondary .plugin-container .plugin-item .details img{border:1px solid #eee;float:left;max-width:96px;padding:10px}.motopress-offer-secondary .plugin-container .plugin-item .details .plugin-name{margin:0 0 10px 116px;font-size:16px;font-weight:700}.motopress-offer-secondary .plugin-container .plugin-item .details .plugin-description{margin:0 0 0 116px}.motopress-offer-secondary .plugin-container .plugin-item .actions{background-color:#f7f7f7;border-top:1px solid #ddd;padding:20px}.motopress-offer-secondary .plugin-container .plugin-item .actions .status{float:left;padding-top:8px}.motopress-offer-secondary .plugin-container .plugin-item .actions .status .status-label.active{color:green}.motopress-offer-secondary .plugin-container .plugin-item .actions .status .status-label.inactive{color:red}.motopress-offer-secondary .plugin-container .plugin-item .actions .status .status-label.not-installed{color:grey}.motopress-offer-secondary .plugin-container .plugin-item .actions .action-button{float:right}@media screen and (max-width:1200px){.motopress-offer-primary,.motopress-offer-secondary{float:none;width:100%;max-width:none;margin-left:0}}
|
media/js/blocks/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.wp=window.wp||{},window.wp["./media/js/blocks/dist/index.js"]=function(e){var t={};function n(l){if(t[l])return t[l].exports;var o=t[l]={i:l,l:!1,exports:{}};return e[l].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(l,o,function(t){return e[t]}.bind(null,o));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},,,,,function(e,t,n){"use strict";n.r(t);var l=n(1),o=n(0);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=wp.element.Component,f=(wp.blockEditor||wp.editor).InspectorControls,_=wp.components,v=_.SelectControl,d=_.CheckboxControl,h=_.PanelBody,y=_.TextControl,O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(O,e);var t,n,a,s,_=(t=O,function(){var e,n=p(t);if(b()){var l=p(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return c(this,e)});function O(){var e;return r(this,O),(e=_.apply(this,arguments)).setOptions=e.setOptions.bind(u(e)),e}return n=O,(a=[{key:"setOptions",value:function(e){var t=[];return e&&(t=e.map((function(e){return{value:e.id.toString(),label:Object(l.get)(e,["title","raw"])||Object(l.get)(e,["name"])}}))),t}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.col,l=t.events,a=t.event_categ,r=t.increment,i=t.view,c=t.view_sort,u=t.label,b=t.hide_label,p=t.hide_hrs,m=t.hide_empty_rows,s=t.title,_=t.time,O=t.sub_title,j=t.description,g=t.user,w=t.group,C=t.disable_event_url,E=t.text_align,R=t.text_align_vertical,S=t.id,k=t.custom_class,x=t.row_height,T=t.font_size,P=t.responsive,D=t.table_layout,I=e.selectedEvents,N=e.selectedColumns,H=e.selectedEventCategories,z=e.setAttributes;return React.createElement(f,null,React.createElement(h,{title:Object(o.__)("Settings","mp-timetable")},React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Columns","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:n,onChange:function(e){return z({col:e})},options:this.setOptions(N)}),React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Specific events","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:l,onChange:function(e){return z({events:e})},options:this.setOptions(I)}),React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Event categories","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:a,onChange:function(e){return z({event_categ:e})},options:this.setOptions(H)}),React.createElement(d,{label:Object(o.__)("Title","mp-timetable"),checked:"1"==s,onChange:function(e){z({title:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Time","mp-timetable"),checked:"1"==_,onChange:function(e){z({time:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Subtitle","mp-timetable"),checked:"1"==O,onChange:function(e){z({sub_title:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Description","mp-timetable"),checked:"1"==j,onChange:function(e){z({description:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Event Head","mp-timetable"),checked:"1"==g,onChange:function(e){z({user:e?"1":"0"})}}),React.createElement(y,{label:Object(o.__)("Block height in pixels","mp-timetable"),type:"number",value:isNaN(x)?0:parseInt(x),onChange:function(e){z({row_height:e.toString()})},min:1,step:1}),React.createElement(y,{label:Object(o.__)("Base font size","mp-timetable"),help:Object(o.__)("Base font size for the table. Example 12px, 2em, 80%.","mp-timetable"),value:T,onChange:function(e){return z({font_size:e})}}),React.createElement(v,{label:Object(o.__)("Time frame for event","mp-timetable"),value:r,onChange:function(e){return z({increment:e})},options:[{value:"1",label:Object(o.__)("Hour (1h)","mp-timetable")},{value:"0.5",label:Object(o.__)("Half hour (30min)","mp-timetable")},{value:"0.25",label:Object(o.__)("Quarter hour (15min)","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Filter events style","mp-timetable"),value:i,onChange:function(e){return z({view:e})},options:[{value:"dropdown_list",label:Object(o.__)("Dropdown list","mp-timetable")},{value:"tabs",label:Object(o.__)("Tabs","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Order of items in filter","mp-timetable"),value:c,onChange:function(e){return z({view_sort:e})},options:[{value:"",label:Object(o.__)("Default","mp-timetable")},{value:"menu_order",label:Object(o.__)("Menu Order","mp-timetable")},{value:"post_title",label:Object(o.__)("Title","mp-timetable")}]}),React.createElement(y,{label:Object(o.__)("Filter title to display all events","mp-timetable"),value:u,onChange:function(e){return z({label:e})}}),React.createElement(v,{label:Object(o.__)("Hide 'All Events' option","mp-timetable"),value:b,onChange:function(e){return z({hide_label:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Hide column with hours","mp-timetable"),value:p,onChange:function(e){return z({hide_hrs:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Do not display empty rows","mp-timetable"),value:m,onChange:function(e){return z({hide_empty_rows:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Merge cells with common events","mp-timetable"),value:w,onChange:function(e){return z({group:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Disable event link","mp-timetable"),value:C,onChange:function(e){return z({disable_event_url:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Horizontal align","mp-timetable"),value:E,onChange:function(e){return z({text_align:e})},options:[{value:"center",label:Object(o.__)("center","mp-timetable")},{value:"left",label:Object(o.__)("left","mp-timetable")},{value:"right",label:Object(o.__)("right","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Vertical align","mp-timetable"),value:R,onChange:function(e){return z({text_align_vertical:e})},options:[{value:"default",label:Object(o.__)("Default","mp-timetable")},{value:"top",label:Object(o.__)("top","mp-timetable")},{value:"middle",label:Object(o.__)("middle","mp-timetable")},{value:"bottom",label:Object(o.__)("bottom","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Column width","mp-timetable"),value:D,onChange:function(e){return z({table_layout:e})},options:[{value:"",label:Object(o.__)("Default","mp-timetable")},{value:"auto",label:Object(o.__)("Auto","mp-timetable")},{value:"fixed",label:Object(o.__)("Fixed","mp-timetable")}]}),React.createElement(y,{label:Object(o.__)("Unique ID","mp-timetable"),help:Object(o.__)("If you use more than one table on a page specify the unique ID for a timetable. It is usually all lowercase and contains only letters, numbers, and hyphens.","mp-timetable"),value:S,onChange:function(e){return z({id:e})}}),React.createElement(y,{label:Object(o.__)("CSS class","mp-timetable"),value:k,onChange:function(e){return z({custom_class:e})}}),React.createElement(v,{label:Object(o.__)("Mobile behavior","mp-timetable"),value:P,onChange:function(e){return z({responsive:e})},options:[{value:"0",label:Object(o.__)("Table","mp-timetable")},{value:"1",label:Object(o.__)("List","mp-timetable")}]})))}}])&&i(n.prototype,a),s&&i(n,s),O}(s);function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function C(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var k=wp.serverSideRender,x=wp.element,T=x.Component,P=x.Fragment,D=wp.compose.compose,I=wp.components.Disabled,N=wp.data.withSelect,H=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(i,e);var t,n,o,a,r=(t=i,function(){var e,n=R(t);if(E()){var l=R(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return C(this,e)});function i(){return g(this,i),r.apply(this,arguments)}return n=i,(o=[{key:"initTable",value:function(){var e=this.props.clientId,t=jQuery("#block-".concat(e)),n=setInterval((function(){t.find(".mptt-shortcode-wrapper").length&&!t.find(".mptt-shortcode-wrapper").hasClass("table-init")&&(clearInterval(n),window.mptt.tableInit())}),1)}},{key:"componentDidUpdate",value:function(e,t){Object(l.isEqual)(this.props.attributes,e.attributes)||this.initTable()}},{key:"componentDidMount",value:function(){this.initTable()}},{key:"render",value:function(){var e=this.props.attributes;return e.events,e.event_categ,React.createElement(P,null,React.createElement(O,this.props),React.createElement(I,null,React.createElement(k,{block:"mp-timetable/timetable",attributes:this.props.attributes})))}}])&&w(n.prototype,o),a&&w(n,a),i}(T),z=D([N((function(e,t){var n=e("core"),o=n.getEntityRecords,a=(n.getCategories,o("postType","mp-event",{per_page:-1,orderby:"title",order:"asc"})),r=o("postType","mp-column",{per_page:-1}),i=o("taxonomy","mp-event_category",{per_page:-1});return{selectedEvents:a?a.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedColumns:r?r.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedEventCategories:i?i.map((function(e){return Object(l.pick)(e,["id","name"])})):null}}))])(H);(0,wp.blocks.registerBlockType)("mp-timetable/timetable",{title:Object(o.__)("Timetable","mp-timetable"),category:"common",icon:"calendar",supports:{align:["wide","full"]},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t}},edit:z,save:function(){return null}})}]);
|
1 |
+
window.wp=window.wp||{},window.wp["./media/js/blocks/dist/index.js"]=function(e){var t={};function n(l){if(t[l])return t[l].exports;var o=t[l]={i:l,l:!1,exports:{}};return e[l].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(l,o,function(t){return e[t]}.bind(null,o));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},,,,,,function(e,t,n){"use strict";n.r(t);var l=n(1),o=n(0);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=wp.element.Component,f=(wp.blockEditor||wp.editor).InspectorControls,_=wp.components,v=_.SelectControl,d=_.CheckboxControl,h=_.PanelBody,y=_.TextControl,O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(O,e);var t,n,a,s,_=(t=O,function(){var e,n=p(t);if(b()){var l=p(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return c(this,e)});function O(){var e;return r(this,O),(e=_.apply(this,arguments)).setOptions=e.setOptions.bind(u(e)),e}return n=O,(a=[{key:"setOptions",value:function(e){var t=[];return e&&(t=e.map((function(e){return{value:e.id.toString(),label:Object(l.get)(e,["title","raw"])||Object(l.get)(e,["name"])}}))),t}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.col,l=t.events,a=t.event_categ,r=t.increment,i=t.view,c=t.view_sort,u=t.label,b=t.hide_label,p=t.hide_hrs,m=t.hide_empty_rows,s=t.title,_=t.time,O=t.sub_title,j=t.description,g=t.user,w=t.group,C=t.disable_event_url,E=t.text_align,R=t.text_align_vertical,S=t.id,k=t.custom_class,x=t.row_height,T=t.font_size,P=t.responsive,D=t.table_layout,I=e.selectedEvents,N=e.selectedColumns,H=e.selectedEventCategories,z=e.setAttributes;return React.createElement(f,null,React.createElement(h,{title:Object(o.__)("Settings","mp-timetable")},React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Columns","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:n,onChange:function(e){return z({col:e})},options:this.setOptions(N)}),React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Specific events","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:l,onChange:function(e){return z({events:e})},options:this.setOptions(I)}),React.createElement(v,{className:"timetable-wp56-fix",multiple:!0,size:"7",label:Object(o.__)("Event categories","mp-timetable"),help:Object(o.__)("Hold the Ctrl or Command key to select/deselect multiple options.","mp-timetable"),value:a,onChange:function(e){return z({event_categ:e})},options:this.setOptions(H)}),React.createElement(d,{label:Object(o.__)("Title","mp-timetable"),checked:"1"==s,onChange:function(e){z({title:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Time","mp-timetable"),checked:"1"==_,onChange:function(e){z({time:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Subtitle","mp-timetable"),checked:"1"==O,onChange:function(e){z({sub_title:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Description","mp-timetable"),checked:"1"==j,onChange:function(e){z({description:e?"1":"0"})}}),React.createElement(d,{label:Object(o.__)("Event Head","mp-timetable"),checked:"1"==g,onChange:function(e){z({user:e?"1":"0"})}}),React.createElement(y,{label:Object(o.__)("Block height in pixels","mp-timetable"),type:"number",value:isNaN(x)?0:parseInt(x),onChange:function(e){z({row_height:e.toString()})},min:1,step:1}),React.createElement(y,{label:Object(o.__)("Base font size","mp-timetable"),help:Object(o.__)("Base font size for the table. Example 12px, 2em, 80%.","mp-timetable"),value:T,onChange:function(e){return z({font_size:e})}}),React.createElement(v,{label:Object(o.__)("Time frame for event","mp-timetable"),value:r,onChange:function(e){return z({increment:e})},options:[{value:"1",label:Object(o.__)("Hour (1h)","mp-timetable")},{value:"0.5",label:Object(o.__)("Half hour (30min)","mp-timetable")},{value:"0.25",label:Object(o.__)("Quarter hour (15min)","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Filter events style","mp-timetable"),value:i,onChange:function(e){return z({view:e})},options:[{value:"dropdown_list",label:Object(o.__)("Dropdown list","mp-timetable")},{value:"tabs",label:Object(o.__)("Tabs","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Order of items in filter","mp-timetable"),value:c,onChange:function(e){return z({view_sort:e})},options:[{value:"",label:Object(o.__)("Default","mp-timetable")},{value:"menu_order",label:Object(o.__)("Menu Order","mp-timetable")},{value:"post_title",label:Object(o.__)("Title","mp-timetable")}]}),React.createElement(y,{label:Object(o.__)("Filter title to display all events","mp-timetable"),value:u,onChange:function(e){return z({label:e})}}),React.createElement(v,{label:Object(o.__)("Hide 'All Events' option","mp-timetable"),value:b,onChange:function(e){return z({hide_label:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Hide column with hours","mp-timetable"),value:p,onChange:function(e){return z({hide_hrs:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Do not display empty rows","mp-timetable"),value:m,onChange:function(e){return z({hide_empty_rows:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Merge cells with common events","mp-timetable"),value:w,onChange:function(e){return z({group:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Disable event link","mp-timetable"),value:C,onChange:function(e){return z({disable_event_url:e})},options:[{value:"0",label:Object(o.__)("No","mp-timetable")},{value:"1",label:Object(o.__)("Yes","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Horizontal align","mp-timetable"),value:E,onChange:function(e){return z({text_align:e})},options:[{value:"center",label:Object(o.__)("center","mp-timetable")},{value:"left",label:Object(o.__)("left","mp-timetable")},{value:"right",label:Object(o.__)("right","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Vertical align","mp-timetable"),value:R,onChange:function(e){return z({text_align_vertical:e})},options:[{value:"default",label:Object(o.__)("Default","mp-timetable")},{value:"top",label:Object(o.__)("top","mp-timetable")},{value:"middle",label:Object(o.__)("middle","mp-timetable")},{value:"bottom",label:Object(o.__)("bottom","mp-timetable")}]}),React.createElement(v,{label:Object(o.__)("Column width","mp-timetable"),value:D,onChange:function(e){return z({table_layout:e})},options:[{value:"",label:Object(o.__)("Default","mp-timetable")},{value:"auto",label:Object(o.__)("Auto","mp-timetable")},{value:"fixed",label:Object(o.__)("Fixed","mp-timetable")}]}),React.createElement(y,{label:Object(o.__)("Unique ID","mp-timetable"),help:Object(o.__)("If you use more than one table on a page specify the unique ID for a timetable. It is usually all lowercase and contains only letters, numbers, and hyphens.","mp-timetable"),value:S,onChange:function(e){return z({id:e})}}),React.createElement(y,{label:Object(o.__)("CSS class","mp-timetable"),value:k,onChange:function(e){return z({custom_class:e})}}),React.createElement(v,{label:Object(o.__)("Mobile behavior","mp-timetable"),value:P,onChange:function(e){return z({responsive:e})},options:[{value:"0",label:Object(o.__)("Table","mp-timetable")},{value:"1",label:Object(o.__)("List","mp-timetable")}]})))}}])&&i(n.prototype,a),s&&i(n,s),O}(s);function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function C(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var k=wp.serverSideRender,x=wp.element,T=x.Component,P=x.Fragment,D=wp.compose.compose,I=wp.components.Disabled,N=wp.data.withSelect,H=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(i,e);var t,n,o,a,r=(t=i,function(){var e,n=R(t);if(E()){var l=R(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return C(this,e)});function i(){return g(this,i),r.apply(this,arguments)}return n=i,(o=[{key:"initTable",value:function(){var e=this.props.clientId,t=jQuery("#block-".concat(e)),n=setInterval((function(){t.find(".mptt-shortcode-wrapper").length&&!t.find(".mptt-shortcode-wrapper").hasClass("table-init")&&(clearInterval(n),window.mptt.tableInit())}),1)}},{key:"componentDidUpdate",value:function(e,t){Object(l.isEqual)(this.props.attributes,e.attributes)||this.initTable()}},{key:"componentDidMount",value:function(){this.initTable()}},{key:"render",value:function(){var e=this.props.attributes;return e.events,e.event_categ,React.createElement(P,null,React.createElement(O,this.props),React.createElement(I,null,React.createElement(k,{block:"mp-timetable/timetable",attributes:this.props.attributes})))}}])&&w(n.prototype,o),a&&w(n,a),i}(T),z=D([N((function(e,t){var n=e("core"),o=n.getEntityRecords,a=(n.getCategories,o("postType","mp-event",{per_page:-1,orderby:"title",order:"asc"})),r=o("postType","mp-column",{per_page:-1}),i=o("taxonomy","mp-event_category",{per_page:-1});return{selectedEvents:a?a.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedColumns:r?r.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedEventCategories:i?i.map((function(e){return Object(l.pick)(e,["id","name"])})):null}}))])(H);(0,wp.blocks.registerBlockType)("mp-timetable/timetable",{title:Object(o.__)("Timetable","mp-timetable"),category:"common",icon:"calendar",supports:{align:["wide","full"]},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t}},edit:z,save:function(){return null}})}]);
|
media/js/events/event.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.wp=window.wp||{},window.wp["./media/js/events/event.min.js"]=function(t){var e={};function n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}({5:function(t,e){Registry.register("Event",function(t){"use strict";var e;return{getInstance:function(){return e||(e={event_id:"",eventsData:{},init:function(){e.initTimePicker(),e.addEventButton(),e.initDeleteButtons(),e.initEditButtons(),e.initColorPicker(),e.initDatePicker(),e.columnRadioBox()},initTimePicker:function(){var e=Boolean(parseInt(t("#time_format").val()));t("#event_start").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"}),t("#event_end").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"})},initSlider:function(n,i){var a=!_.isUndefined(i)&&Boolean(i),r=n.replace(/^\D+/g,"");t(n).carouFredSel({items:{visible:3},direction:"up",scroll:{items:1,easing:"swing",pauseOnHover:!0,onAfter:function(e){e.items.old.each((function(){t(this).removeClass("visible")})),e.items.visible.each((function(){t(this).addClass("visible")}))}},auto:{play:a,timeoutDuration:3e3},prev:{button:"#mp_prev_button"+r},next:{button:"#mp_next_button"+r}}),t(n).trigger("currentVisible",(function(t){t.addClass("visible")})),e.setColorSettings(n+" .mptt-colorized")},initDeleteButton:function(){var e=t("#events-list");e.find("li.event").find("i.operation-button.dashicons-no.dashicons").off("click").on("click",(function(){e.find("li.event").length>1?t(this).parents("li.event").remove():e.remove()}))},initColorPicker:function(e){_.isUndefined(e)&&(e="");var n=t(e+" input.clr-picker"),i=t(e+" input.regular-text");n.spectrum("destroy"),n.spectrum({preferredFormat:"rgb",showInput:!0,showAlpha:!0,allowEmpty:!0,palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]],showPalette:!0,show:function(e){t(this).val(e)},hide:function(e){t(this).parents(".select-color").find(".regular-text").val(t(this).val())},change:function(e){t(this).parents(".select-color").find('input:not([type="hidden"])').val(t(this).val())}}),i.off("keyup").on("keyup",(function(){var e=t(this).parents(".select-color"),n=e.find(".clr-picker"),i=e.find(".regular-text").val();e.find(".sp-preview-inner").css({"background-color":i}),n.spectrum("set",i)}))},addEventButton:function(){t(document).on("click.admin","#add_mp_event",(function(){t(this).hasClass("edit")?e.updateEventData():e.renderEventItem()}))},initDeleteButtons:function(){t(document).on("click.admin","#events-list .delete-event-button",(function(){var n=t(this).attr("data-id");e.deleteEvent(n)}))},initEditButtons:function(){t(document).on("click.admin","#events-list .edit-event-button",(function(){var n=t(this).attr("data-id"),i=t(this).parent().parent();t(this).parent().find(".spinner").addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"get_event_data",id:n},(function(n){var a=t("#add_mp_event"),r=t("#events-list");r.find(".spinner").removeClass("is-active"),r.find(" tr").removeClass("active"),i.addClass("active"),t("#event_start").val(n.event_start),t("#event_end").val(n.event_end),t("#description").val(n.description),t("#user_id").val(n.user_id),t("#weekday_id").val(n.column_id),a.addClass("edit"),a.val("Update"),e.event_id=n.id}),(function(t){console.warn(t)}))}))},deleteEvent:function(e){Registry._get("adminFunctions").wpAjax({controller:"events",action:"delete",id:e},(function(n){var i=t("#events-list").find('tr[data-id="'+e+'"]');i.length&&i.remove()}),(function(t){console.log(t)}))},updateEventItem:function(){var n=t("#events-list").find('tr[data-id="'+e.event_id+'"]'),i=t("#user_id");n.find("td.event-column").text(t("#weekday_id").find("option:selected").text()),n.find("td.event-start").text(t("#event_start").val()),n.find("td.event-end").text(t("#event_end").val()),n.find("td.event-user-id").text("-1"===i.val()?"":i.find("option:selected").text()),n.find("td.event-description").text(t("#description").val()),e.event_id=null,t("#add_mp_event").removeClass("edit").val("Add New")},updateEventData:function(){var n=t("#add_event_table").find(".spinner");n.addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"update_event_data",data:{id:Registry._get("Event").event_id,event_start:t("#event_start").val(),event_end:t("#event_end").val(),description:t("#description").val(),user_id:t("#user_id").val(),weekday_ids:t("#weekday_id").val()}},(function(){n.removeClass("is-active"),e.updateEventItem(),e.clearTable()}),(function(t){n.removeClass("is-active"),console.log(t)}))},renderEventItem:function(){var n=t("#weekday_id"),i=t("#user_id"),a=n.find("option:selected").val(),r=t("#event_start"),s=t("#event_end"),o=t("#description"),d={tag:"tr",attrs:{},content:[{tag:"td",attrs:{style:"display:none;"},content:[{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][weekday_ids][]",value:a}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_start][]",value:r.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_end][]",value:s.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][description][]",value:o.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][user_id][]",value:i.val()}}]},{tag:"td",attrs:{class:"event-column"},content:[n.find("option:selected").text()]},{tag:"td",attrs:{class:"event-start"},content:[r.val()]},{tag:"td",attrs:{class:"event-end"},content:[s.val()]},{tag:"td",attrs:{class:"event-description"},content:[o.val()]},{tag:"td",attrs:{class:"event-user-id"},content:["-1"===i.val()?"":i.find("option:selected").text()]},{tag:"td",attrs:{},content:[]}]},c=Registry._get("adminFunctions").getHtml(d);t("#events-list").find("tbody").append(c),t(".events-list-wrapper").scrollTop(1e10),e.clearTable()},setEventHeight:function(e){var n=e.parent().outerHeight(),i=t("body"),a=e.height(),r=e.data("min-height"),s=e.find(".mptt-inner-event-content").height();e.css("position","").css("width","").css("min-height",""),i.hasClass("mprm_ie_browser")?(s=e.css("height","").find(".mptt-inner-event-content").height(),e.height(a),s<=r?e.css("max-height",r):(e.css("height",""),e.css("max-height",s))):s<=r?e.css("min-height",r):e.css("min-height",s),n<a&&e.height(a)},recalculate_Height:function(e,n){var i=t(".mptt-event-container",e),a=i.length,r=0,s=0,o=e.height();t("body").hasClass("mprm_ie_browser")?(r=o/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);if(e.height(r),_.isEmpty(e.data("min-height"))){var n=e.height();0===n?e.data("min-height",r):e.data("min-height",n)}e.css("top",s+"px"),e.removeClass("mptt-hidden"),s+=r})):n.height(r)):(r=100/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);e.height(r+"%"),_.isEmpty(e.data("min-height"))&&e.data("min-height",e.height()),e.css("top",s+"%"),e.removeClass("mptt-hidden"),s+=r})):n.height(r+"%"))},setEventsHeight:function(){var n=t(".mptt-shortcode-wrapper").find("table").find("td.event");t.each(n,(function(){var n=t(this);e.recalculate_Height(n)}))},setColorSettings:function(n){_.isUndefined(n)&&(n=".mptt-colorized");var i=t(n);t.each(i,(function(){var n=t(this),i=n.attr("data-bg_hover_color"),a=n.attr("data-hover_color"),r=n.parent();switch(n.attr("data-type")){case"column":case"event":n.hover((function(){_.isEmpty(i)||n.css("background-color",i),_.isEmpty(a)||n.css("color",a),e.setEventHeight(n)}),(function(){n.css("max-height","").css("min-height",""),e.recalculate_Height(r,n),n.css("background-color",n.attr("data-bg_color")),n.css("color",n.attr("data-color"))}));break;case"widget":n.hover((function(){n.css("background-color",n.attr("data-background-hover-color")),n.css("color",t(this).attr("data-hover-color")),n.css("border-left-color",n.attr("data-hover-border-color"))}),(function(){n.css("background-color",n.attr("data-background-color")),n.css("color",n.attr("data-color")),n.css("border-left-color",n.attr("data-border-color"))}))}}))},clearTable:function(){var e=t("#weekday_id");t("#add_event_table input:not(.button),#add_event_table textarea").val(""),e.val(e.find("option:first").attr("value"))},getRowSpan:function(e,n){for(var i=[],a=[],r=n.attr("data-column-id"),s=n.closest("tr").next("tr"),o=s.find('td[data-column-id="'+r+'"]'),d=s.length>0&&o.length>0&&o.children().length>0;!d;){if(0==s.next("tr").length){d=!0,s=!1;break}d=(o=(s=s.next("tr")).find('td[data-column-id="'+r+'"]')).children().length>0}var c=!1;s&&(c=s.data("index")),t.each(e,(function(e){var n=t(this).attr("data-start"),r=t(this).attr("data-end");a[e]=n,i[e]=r}));var l=Math.min.apply(Math,a),v=Math.max.apply(Math,i);c&&v>c&&(v=c);var f=v-l;return f<1?1:f},responsiveFilter:function(e){var n="all",i=e.parents(".mptt-shortcode-wrapper");n=e.is("select")?e.val():e.attr("href").replace("#","");var a=i.find(".mptt-list-event");"all"!==n?(a.hide(),i.find('.mptt-list-event[data-event-id="'+n+'"]').show()):a.show(),t.each(i.find(".mptt-column"),(function(){t(this).show(),t(this).find(".mptt-list-event:visible").length<1&&t(this).hide()}))},filterStatic:function(t,n){var i=t.parents(".mptt-shortcode-wrapper"),a="#all",r=_.isEmpty(i.attr("id"))?"not-set":i.attr("id");a=t.is("select")?t.val():t.attr("href").replace("#",""),0==n||void 0===n.originalEvent||(window.location.hash=r+":"+a),i.find("table").hide(),i.find('table[id="#'+a+'"]').fadeIn(),e.setEventsHeight()},setClassTd:function(){t.each(t(".mptt-event-container"),(function(){t(this).parents("td").addClass("event")}))},initTableData:function(){e.setClassTd(),e.setRowSpanTd();var n="."+MPTT.table_class;t(n).data("hide_empty_row")&&e.hideEmptyRows()},filterShortcodeEvents:function(){var n=t(".mptt-menu");n.length&&(n.off("change").on("change",(function(n){e.filterStatic(t(this),n),e.responsiveFilter(t(this))})),t(".mptt-navigation-tabs.mptt-menu a").off("click").on("click",(function(n){var i=t(this);i.parents(".mptt-navigation-tabs.mptt-menu").find("li").removeClass("active"),i.parents("li").addClass("active"),e.filterStatic(i,n),e.responsiveFilter(i)})))},showCurrentEvent:function(t,e){t.find(".mptt-menu").hasClass("mptt-navigation-tabs")?t.find(".mptt-navigation-tabs").find('a[href="#'+e+'"]').click():t.find(".mptt-menu").hasClass("mptt-navigation-select")&&t.find('.mptt-navigation-select option[value="'+e+'"]')?t.find(".mptt-navigation-select").val(e).change():t.find('table[id="#all"]').fadeIn()},getFilterByHash:function(){var n=window.location.hash;if(!_.isUndefined(n)){var i=n.split(":"),a=i[0],r=i[1],s=t(".mptt-shortcode-wrapper");r=_.isUndefined(r)?"all":r,1===s.length?e.showCurrentEvent(s,r):t.each(s,(function(n,i){var s=t(i);"#"+s.attr("id")===a?e.showCurrentEvent(s,r):e.showCurrentEvent(s,"all")}))}e.setEventsHeight()},removeCellsAfterChangeColSpan:function(t,e,n,i){for(;t<e;t++){var a=n.find('th[data-index="'+t+'"]').data("column-id");i.find('td:not(.event)[data-column-id="'+a+'"]').remove()}},removeCellsAfterChangeRowSpan:function(t,n,i,a){for(var r=t.parents("tr").attr("data-index"),s=n+parseInt(r)-1,o=t.attr("colspan"),d=i.find('th[data-column-id="'+a+'"]').data("index"),c=parseInt(d)+parseInt(o);r<s;r++){var l=i.find("tr.mptt-shortcode-row-"+(parseInt(r)+1));if(l.length){if(l.find('td.event[data-column-id="'+a+'"]').length&&(n-=s-r)<2){n=1;break}o>1&&e.removeCellsAfterChangeColSpan(d,c,i,l),l.find('td:not(.event)[data-column-id="'+a+'"]').remove()}}return n},setRowSpanTd:function(){var n="."+MPTT.table_class;t.each(t(n),(function(){var n=t(this);t.each(n.find("td.event"),(function(){var i=t(this),a=i.find(".mptt-event-container"),r=i.attr("data-column-id"),s=i.attr("data-row_height"),o=e.getRowSpan(a,i);!_.isUndefined(o)&&o>1&&(o=e.removeCellsAfterChangeRowSpan(i,o,n,r),isNaN(s)||i.css("height",o*s)),i.attr("rowspan",o)}))}))},hideEmptyRows:function(){var e="."+MPTT.table_class,n=t(e+" tbody tr"),i=t(e).first().find("th").length;t.each(n,(function(e,n){0===t(n).find("td.event").length&&t(n).find("td").length===i&&t(n).remove()}))},displaySettings:function(){var e=t(".view_settings");e.length&&e.change((function(){"all"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(".next-days").css("display","block")):t(this).parents(".mptt-container").find(".next-days").css("display","none")}))},timeMode:function(e){if(e){var n="."+t(this).attr("id");t("#"+e).change((function(){"server"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(n).css("display","block")):t(this).parents(".mptt-container").find(n).css("display","none")}))}},initDatePicker:function(){var e=t("#datepicker");e.length&&e.datepicker({dateFormat:"d/m/yy",setDate:Date.parse(e.val())})},columnRadioBox:function(){var e=t("#datepicker"),n=t('input.option-input[name="column[column_option]"]'),i=t("select.mp-weekday");n.length&&n.on("change",(function(){switch(t(this).val()){case"simple":i.prop("disabled",!0),e.prop("disabled",!0);break;case"weekday":i.prop("disabled",!1),e.val("").prop("disabled",!0);break;case"date":i.prop("disabled",!0),e.prop("disabled",!1)}}))}}),e}}}(jQuery))}});
|
1 |
+
window.wp=window.wp||{},window.wp["./media/js/events/event.min.js"]=function(t){var e={};function n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}({6:function(t,e){Registry.register("Event",function(t){"use strict";var e;return{getInstance:function(){return e||(e={event_id:"",eventsData:{},init:function(){e.initTimePicker(),e.addEventButton(),e.initDeleteButtons(),e.initEditButtons(),e.initColorPicker(),e.initDatePicker(),e.columnRadioBox()},initTimePicker:function(){var e=Boolean(parseInt(t("#time_format").val()));t("#event_start").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"}),t("#event_end").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"})},initSlider:function(n,i){var a=!_.isUndefined(i)&&Boolean(i),r=n.replace(/^\D+/g,"");t(n).carouFredSel({items:{visible:3},direction:"up",scroll:{items:1,easing:"swing",pauseOnHover:!0,onAfter:function(e){e.items.old.each((function(){t(this).removeClass("visible")})),e.items.visible.each((function(){t(this).addClass("visible")}))}},auto:{play:a,timeoutDuration:3e3},prev:{button:"#mp_prev_button"+r},next:{button:"#mp_next_button"+r}}),t(n).trigger("currentVisible",(function(t){t.addClass("visible")})),e.setColorSettings(n+" .mptt-colorized")},initDeleteButton:function(){var e=t("#events-list");e.find("li.event").find("i.operation-button.dashicons-no.dashicons").off("click").on("click",(function(){e.find("li.event").length>1?t(this).parents("li.event").remove():e.remove()}))},initColorPicker:function(e){_.isUndefined(e)&&(e="");var n=t(e+" input.clr-picker"),i=t(e+" input.regular-text");n.spectrum("destroy"),n.spectrum({preferredFormat:"rgb",showInput:!0,showAlpha:!0,allowEmpty:!0,palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]],showPalette:!0,show:function(e){t(this).val(e)},hide:function(e){t(this).parents(".select-color").find(".regular-text").val(t(this).val())},change:function(e){t(this).parents(".select-color").find('input:not([type="hidden"])').val(t(this).val())}}),i.off("keyup").on("keyup",(function(){var e=t(this).parents(".select-color"),n=e.find(".clr-picker"),i=e.find(".regular-text").val();e.find(".sp-preview-inner").css({"background-color":i}),n.spectrum("set",i)}))},addEventButton:function(){t(document).on("click.admin","#add_mp_event",(function(){t(this).hasClass("edit")?e.updateEventData():e.renderEventItem()}))},initDeleteButtons:function(){t(document).on("click.admin","#events-list .delete-event-button",(function(){var n=t(this).attr("data-id");e.deleteEvent(n)}))},initEditButtons:function(){t(document).on("click.admin","#events-list .edit-event-button",(function(){var n=t(this).attr("data-id"),i=t(this).parent().parent();t(this).parent().find(".spinner").addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"get_event_data",id:n},(function(n){var a=t("#add_mp_event"),r=t("#events-list");r.find(".spinner").removeClass("is-active"),r.find(" tr").removeClass("active"),i.addClass("active"),t("#event_start").val(n.event_start),t("#event_end").val(n.event_end),t("#description").val(n.description),t("#user_id").val(n.user_id),t("#weekday_id").val(n.column_id),a.addClass("edit"),a.val("Update"),e.event_id=n.id}),(function(t){console.warn(t)}))}))},deleteEvent:function(e){Registry._get("adminFunctions").wpAjax({controller:"events",action:"delete",id:e},(function(n){var i=t("#events-list").find('tr[data-id="'+e+'"]');i.length&&i.remove()}),(function(t){console.log(t)}))},updateEventItem:function(){var n=t("#events-list").find('tr[data-id="'+e.event_id+'"]'),i=t("#user_id");n.find("td.event-column").text(t("#weekday_id").find("option:selected").text()),n.find("td.event-start").text(t("#event_start").val()),n.find("td.event-end").text(t("#event_end").val()),n.find("td.event-user-id").text("-1"===i.val()?"":i.find("option:selected").text()),n.find("td.event-description").text(t("#description").val()),e.event_id=null,t("#add_mp_event").removeClass("edit").val("Add New")},updateEventData:function(){var n=t("#add_event_table").find(".spinner");n.addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"update_event_data",data:{id:Registry._get("Event").event_id,event_start:t("#event_start").val(),event_end:t("#event_end").val(),description:t("#description").val(),user_id:t("#user_id").val(),weekday_ids:t("#weekday_id").val()}},(function(){n.removeClass("is-active"),e.updateEventItem(),e.clearTable()}),(function(t){n.removeClass("is-active"),console.log(t)}))},renderEventItem:function(){var n=t("#weekday_id"),i=t("#user_id"),a=n.find("option:selected").val(),r=t("#event_start"),s=t("#event_end"),o=t("#description"),d={tag:"tr",attrs:{},content:[{tag:"td",attrs:{style:"display:none;"},content:[{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][weekday_ids][]",value:a}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_start][]",value:r.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_end][]",value:s.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][description][]",value:o.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][user_id][]",value:i.val()}}]},{tag:"td",attrs:{class:"event-column"},content:[n.find("option:selected").text()]},{tag:"td",attrs:{class:"event-start"},content:[r.val()]},{tag:"td",attrs:{class:"event-end"},content:[s.val()]},{tag:"td",attrs:{class:"event-description"},content:[o.val()]},{tag:"td",attrs:{class:"event-user-id"},content:["-1"===i.val()?"":i.find("option:selected").text()]},{tag:"td",attrs:{},content:[]}]},c=Registry._get("adminFunctions").getHtml(d);t("#events-list").find("tbody").append(c),t(".events-list-wrapper").scrollTop(1e10),e.clearTable()},setEventHeight:function(e){var n=e.parent().outerHeight(),i=t("body"),a=e.height(),r=e.data("min-height"),s=e.find(".mptt-inner-event-content").height();e.css("position","").css("width","").css("min-height",""),i.hasClass("mprm_ie_browser")?(s=e.css("height","").find(".mptt-inner-event-content").height(),e.height(a),s<=r?e.css("max-height",r):(e.css("height",""),e.css("max-height",s))):s<=r?e.css("min-height",r):e.css("min-height",s),n<a&&e.height(a)},recalculate_Height:function(e,n){var i=t(".mptt-event-container",e),a=i.length,r=0,s=0,o=e.height();t("body").hasClass("mprm_ie_browser")?(r=o/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);if(e.height(r),_.isEmpty(e.data("min-height"))){var n=e.height();0===n?e.data("min-height",r):e.data("min-height",n)}e.css("top",s+"px"),e.removeClass("mptt-hidden"),s+=r})):n.height(r)):(r=100/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);e.height(r+"%"),_.isEmpty(e.data("min-height"))&&e.data("min-height",e.height()),e.css("top",s+"%"),e.removeClass("mptt-hidden"),s+=r})):n.height(r+"%"))},setEventsHeight:function(){var n=t(".mptt-shortcode-wrapper").find("table").find("td.event");t.each(n,(function(){var n=t(this);e.recalculate_Height(n)}))},setColorSettings:function(n){_.isUndefined(n)&&(n=".mptt-colorized");var i=t(n);t.each(i,(function(){var n=t(this),i=n.attr("data-bg_hover_color"),a=n.attr("data-hover_color"),r=n.parent();switch(n.attr("data-type")){case"column":case"event":n.hover((function(){_.isEmpty(i)||n.css("background-color",i),_.isEmpty(a)||n.css("color",a),e.setEventHeight(n)}),(function(){n.css("max-height","").css("min-height",""),e.recalculate_Height(r,n),n.css("background-color",n.attr("data-bg_color")),n.css("color",n.attr("data-color"))}));break;case"widget":n.hover((function(){n.css("background-color",n.attr("data-background-hover-color")),n.css("color",t(this).attr("data-hover-color")),n.css("border-left-color",n.attr("data-hover-border-color"))}),(function(){n.css("background-color",n.attr("data-background-color")),n.css("color",n.attr("data-color")),n.css("border-left-color",n.attr("data-border-color"))}))}}))},clearTable:function(){var e=t("#weekday_id");t("#add_event_table input:not(.button),#add_event_table textarea").val(""),e.val(e.find("option:first").attr("value"))},getRowSpan:function(e,n){for(var i=[],a=[],r=n.attr("data-column-id"),s=n.closest("tr").next("tr"),o=s.find('td[data-column-id="'+r+'"]'),d=s.length>0&&o.length>0&&o.children().length>0;!d;){if(0==s.next("tr").length){d=!0,s=!1;break}d=(o=(s=s.next("tr")).find('td[data-column-id="'+r+'"]')).children().length>0}var c=!1;s&&(c=s.data("index")),t.each(e,(function(e){var n=t(this).attr("data-start"),r=t(this).attr("data-end");a[e]=n,i[e]=r}));var l=Math.min.apply(Math,a),v=Math.max.apply(Math,i);c&&v>c&&(v=c);var f=v-l;return f<1?1:f},responsiveFilter:function(e){var n="all",i=e.parents(".mptt-shortcode-wrapper");n=e.is("select")?e.val():e.attr("href").replace("#","");var a=i.find(".mptt-list-event");"all"!==n?(a.hide(),i.find('.mptt-list-event[data-event-id="'+n+'"]').show()):a.show(),t.each(i.find(".mptt-column"),(function(){t(this).show(),t(this).find(".mptt-list-event:visible").length<1&&t(this).hide()}))},filterStatic:function(t,n){var i=t.parents(".mptt-shortcode-wrapper"),a="#all",r=_.isEmpty(i.attr("id"))?"not-set":i.attr("id");a=t.is("select")?t.val():t.attr("href").replace("#",""),0==n||void 0===n.originalEvent||(window.location.hash=r+":"+a),i.find("table").hide(),i.find('table[id="#'+a+'"]').fadeIn(),e.setEventsHeight()},setClassTd:function(){t.each(t(".mptt-event-container"),(function(){t(this).parents("td").addClass("event")}))},initTableData:function(){e.setClassTd(),e.setRowSpanTd();var n="."+MPTT.table_class;t(n).data("hide_empty_row")&&e.hideEmptyRows()},filterShortcodeEvents:function(){var n=t(".mptt-menu");n.length&&(n.off("change").on("change",(function(n){e.filterStatic(t(this),n),e.responsiveFilter(t(this))})),t(".mptt-navigation-tabs.mptt-menu a").off("click").on("click",(function(n){var i=t(this);i.parents(".mptt-navigation-tabs.mptt-menu").find("li").removeClass("active"),i.parents("li").addClass("active"),e.filterStatic(i,n),e.responsiveFilter(i)})))},showCurrentEvent:function(t,e){t.find(".mptt-menu").hasClass("mptt-navigation-tabs")?t.find(".mptt-navigation-tabs").find('a[href="#'+e+'"]').click():t.find(".mptt-menu").hasClass("mptt-navigation-select")&&t.find('.mptt-navigation-select option[value="'+e+'"]')?t.find(".mptt-navigation-select").val(e).change():t.find('table[id="#all"]').fadeIn()},getFilterByHash:function(){var n=window.location.hash;if(!_.isUndefined(n)){var i=n.split(":"),a=i[0],r=i[1],s=t(".mptt-shortcode-wrapper");r=_.isUndefined(r)?"all":r,1===s.length?e.showCurrentEvent(s,r):t.each(s,(function(n,i){var s=t(i);"#"+s.attr("id")===a?e.showCurrentEvent(s,r):e.showCurrentEvent(s,"all")}))}e.setEventsHeight()},removeCellsAfterChangeColSpan:function(t,e,n,i){for(;t<e;t++){var a=n.find('th[data-index="'+t+'"]').data("column-id");i.find('td:not(.event)[data-column-id="'+a+'"]').remove()}},removeCellsAfterChangeRowSpan:function(t,n,i,a){for(var r=t.parents("tr").attr("data-index"),s=n+parseInt(r)-1,o=t.attr("colspan"),d=i.find('th[data-column-id="'+a+'"]').data("index"),c=parseInt(d)+parseInt(o);r<s;r++){var l=i.find("tr.mptt-shortcode-row-"+(parseInt(r)+1));if(l.length){if(l.find('td.event[data-column-id="'+a+'"]').length&&(n-=s-r)<2){n=1;break}o>1&&e.removeCellsAfterChangeColSpan(d,c,i,l),l.find('td:not(.event)[data-column-id="'+a+'"]').remove()}}return n},setRowSpanTd:function(){var n="."+MPTT.table_class;t.each(t(n),(function(){var n=t(this);t.each(n.find("td.event"),(function(){var i=t(this),a=i.find(".mptt-event-container"),r=i.attr("data-column-id"),s=i.attr("data-row_height"),o=e.getRowSpan(a,i);!_.isUndefined(o)&&o>1&&(o=e.removeCellsAfterChangeRowSpan(i,o,n,r),isNaN(s)||i.css("height",o*s)),i.attr("rowspan",o)}))}))},hideEmptyRows:function(){var e="."+MPTT.table_class,n=t(e+" tbody tr"),i=t(e).first().find("th").length;t.each(n,(function(e,n){0===t(n).find("td.event").length&&t(n).find("td").length===i&&t(n).remove()}))},displaySettings:function(){var e=t(".view_settings");e.length&&e.change((function(){"all"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(".next-days").css("display","block")):t(this).parents(".mptt-container").find(".next-days").css("display","none")}))},timeMode:function(e){if(e){var n="."+t(this).attr("id");t("#"+e).change((function(){"server"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(n).css("display","block")):t(this).parents(".mptt-container").find(n).css("display","none")}))}},initDatePicker:function(){var e=t("#datepicker");e.length&&e.datepicker({dateFormat:"d/m/yy",setDate:Date.parse(e.val())})},columnRadioBox:function(){var e=t("#datepicker"),n=t('input.option-input[name="column[column_option]"]'),i=t("select.mp-weekday");n.length&&n.on("change",(function(){switch(t(this).val()){case"simple":i.prop("disabled",!0),e.prop("disabled",!0);break;case"weekday":i.prop("disabled",!1),e.val("").prop("disabled",!0);break;case"date":i.prop("disabled",!0),e.prop("disabled",!1)}}))}}),e}}}(jQuery))}});
|
media/js/mptt-option-ajax.js
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
;( function( $ ) {
|
2 |
+
|
3 |
+
'use strict';
|
4 |
+
|
5 |
+
$( document ).ready( function() {
|
6 |
+
|
7 |
+
let status;
|
8 |
+
|
9 |
+
$( document ).on( 'click', '.motopress-offer-secondary .plugin-item .action-button .button', function( e ) {
|
10 |
+
|
11 |
+
e.preventDefault();
|
12 |
+
|
13 |
+
const currentStatus = $( this ).closest( '.actions' ).find( '.status-label' ),
|
14 |
+
plugin = $( this ).data( 'path' );
|
15 |
+
|
16 |
+
if ( currentStatus.hasClass( 'inactive' ) ) {
|
17 |
+
status = 'activate';
|
18 |
+
} else if ( currentStatus.hasClass( 'not-installed' ) ) {
|
19 |
+
status = 'install';
|
20 |
+
} else {
|
21 |
+
return;
|
22 |
+
}
|
23 |
+
|
24 |
+
$.post( {
|
25 |
+
url: MPTT.ajax_url,
|
26 |
+
data: {
|
27 |
+
nonce: MPTT.nonce,
|
28 |
+
action: 'install_plugin_ajax',
|
29 |
+
status: status,
|
30 |
+
plugin: plugin
|
31 |
+
},
|
32 |
+
beforeSend: () => {
|
33 |
+
$( this ).html( `${ MPTT.status_loading }` );
|
34 |
+
},
|
35 |
+
success: res => {
|
36 |
+
if ( res.success ) {
|
37 |
+
if ( ! res.data.is_activated ) {
|
38 |
+
currentStatus
|
39 |
+
.removeClass( 'not-installed' )
|
40 |
+
.addClass( 'inactive' )
|
41 |
+
.html( `${ MPTT.status_inactive }` );
|
42 |
+
|
43 |
+
$( this )
|
44 |
+
.removeClass( 'button button-primary' )
|
45 |
+
.addClass( 'button button-secondary' )
|
46 |
+
.html( `${ MPTT.status_activate }` );
|
47 |
+
} else {
|
48 |
+
currentStatus
|
49 |
+
.removeClass( 'inactive' )
|
50 |
+
.addClass( 'active' )
|
51 |
+
.html( `${ MPTT.status_active }` );
|
52 |
+
|
53 |
+
$( this )
|
54 |
+
.addClass( 'disabled' )
|
55 |
+
.html( `${ MPTT.status_activated }` );
|
56 |
+
}
|
57 |
+
} else {
|
58 |
+
if ( $( '.wp-heading-inline' )[ 0 ] ) {
|
59 |
+
$( '.wp-heading-inline' ).after( '<div class="error notice is-dismissible"><p>' + res.data + '</p><button id="my-dismiss-admin-message" class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button></div>' );
|
60 |
+
}
|
61 |
+
|
62 |
+
$( this ).html( `${ MPTT.status_download }` );
|
63 |
+
}
|
64 |
+
}
|
65 |
+
} ).fail( function( xhr ) {
|
66 |
+
console.log( xhr.responseText );
|
67 |
+
} );
|
68 |
+
} );
|
69 |
+
} );
|
70 |
+
} )( window.jQuery );
|
media/js/mptt-option-ajax.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.wp=window.wp||{},window.wp["./media/js/mptt-option-ajax.min.js"]=function(t){var e={};function n(a){if(e[a])return e[a].exports;var s=e[a]={i:a,l:!1,exports:{}};return t[a].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(a,s,function(e){return t[e]}.bind(null,s));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}({5:function(t,e){!function(t){"use strict";t(document).ready((function(){var e;t(document).on("click",".motopress-offer-secondary .plugin-item .action-button .button",(function(n){var a=this;n.preventDefault();var s=t(this).closest(".actions").find(".status-label"),i=t(this).data("path");if(s.hasClass("inactive"))e="activate";else{if(!s.hasClass("not-installed"))return;e="install"}t.post({url:MPTT.ajax_url,data:{nonce:MPTT.nonce,action:"install_plugin_ajax",status:e,plugin:i},beforeSend:function(){t(a).html("".concat(MPTT.status_loading))},success:function(e){e.success?e.data.is_activated?(s.removeClass("inactive").addClass("active").html("".concat(MPTT.status_active)),t(a).addClass("disabled").html("".concat(MPTT.status_activated))):(s.removeClass("not-installed").addClass("inactive").html("".concat(MPTT.status_inactive)),t(a).removeClass("button button-primary").addClass("button button-secondary").html("".concat(MPTT.status_activate))):(t(".wp-heading-inline")[0]&&t(".wp-heading-inline").after('<div class="error notice is-dismissible"><p>'+e.data+'</p><button id="my-dismiss-admin-message" class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'),t(a).html("".concat(MPTT.status_download)))}}).fail((function(t){console.log(t.responseText)}))}))}))}(window.jQuery)}});
|
media/less/admin.less
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
#mp-event_data {
|
2 |
#add_event_table {
|
|
|
3 |
#event_start, #event_end {
|
4 |
min-width: 100px;
|
5 |
}
|
@@ -117,4 +118,101 @@ div[id^="jBoxID"] {
|
|
117 |
select.mptt-resize-vertical {
|
118 |
resize: vertical;
|
119 |
min-height: 4em;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
1 |
#mp-event_data {
|
2 |
#add_event_table {
|
3 |
+
padding: 1em 0.5em;
|
4 |
#event_start, #event_end {
|
5 |
min-width: 100px;
|
6 |
}
|
118 |
select.mptt-resize-vertical {
|
119 |
resize: vertical;
|
120 |
min-height: 4em;
|
121 |
+
}
|
122 |
+
|
123 |
+
.motopress-offer-primary {
|
124 |
+
float: left;
|
125 |
+
width: 60%;
|
126 |
+
}
|
127 |
+
.motopress-offer-secondary {
|
128 |
+
float: right;
|
129 |
+
width: 38%;
|
130 |
+
max-width: 500px;
|
131 |
+
margin-left: 2%;
|
132 |
+
display: block;
|
133 |
+
|
134 |
+
* {
|
135 |
+
box-sizing: border-box;
|
136 |
+
}
|
137 |
+
|
138 |
+
.plugin-container {
|
139 |
+
margin-bottom: 20px;
|
140 |
+
|
141 |
+
.plugin-item {
|
142 |
+
background-color: #fff;
|
143 |
+
border: 1px solid #ddd;
|
144 |
+
border-radius: 3px;
|
145 |
+
margin: 0;
|
146 |
+
|
147 |
+
.details {
|
148 |
+
padding: 20px;
|
149 |
+
img {
|
150 |
+
border: 1px solid #eee;
|
151 |
+
float: left;
|
152 |
+
max-width: 96px;
|
153 |
+
padding: 10px;
|
154 |
+
}
|
155 |
+
.plugin-name {
|
156 |
+
margin: 0 0 10px 116px;
|
157 |
+
font-size: 16px;
|
158 |
+
font-weight: 700;
|
159 |
+
}
|
160 |
+
.plugin-description {
|
161 |
+
margin: 0 0 0 116px;
|
162 |
+
}
|
163 |
+
&:after {
|
164 |
+
display: table;
|
165 |
+
clear: both;
|
166 |
+
content: '';
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
.actions {
|
171 |
+
background-color: #f7f7f7;
|
172 |
+
border-top: 1px solid #ddd;
|
173 |
+
padding: 20px;
|
174 |
+
.status {
|
175 |
+
float: left;
|
176 |
+
padding-top: 8px;
|
177 |
+
|
178 |
+
.status-label {
|
179 |
+
&.active {
|
180 |
+
color: green;
|
181 |
+
}
|
182 |
+
&.inactive {
|
183 |
+
color: red;
|
184 |
+
}
|
185 |
+
&.not-installed {
|
186 |
+
color: grey;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
}
|
191 |
+
.action-button {
|
192 |
+
float: right;
|
193 |
+
}
|
194 |
+
&:after {
|
195 |
+
display: table;
|
196 |
+
clear: both;
|
197 |
+
content: '';
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
&:after {
|
204 |
+
display: table;
|
205 |
+
clear: both;
|
206 |
+
content: '';
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
@media screen and (max-width: 1200px) {
|
211 |
+
.motopress-offer-primary,
|
212 |
+
.motopress-offer-secondary {
|
213 |
+
float: none;
|
214 |
+
width: 100%;
|
215 |
+
max-width: none;
|
216 |
+
margin-left: 0;
|
217 |
+
}
|
218 |
}
|
mp-timetable.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Timetable and Event Schedule
|
5 |
* Plugin URI: https://motopress.com/products/timetable-event-schedule/
|
6 |
* Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
|
7 |
-
* Version: 2.
|
8 |
* Author: MotoPress
|
9 |
* Author URI: https://motopress.com
|
10 |
* License: GPLv2 or later
|
4 |
* Plugin Name: Timetable and Event Schedule
|
5 |
* Plugin URI: https://motopress.com/products/timetable-event-schedule/
|
6 |
* Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
|
7 |
+
* Version: 2.4.0
|
8 |
* Author: MotoPress
|
9 |
* Author URI: https://motopress.com
|
10 |
* License: GPLv2 or later
|
readme.txt
CHANGED
@@ -93,6 +93,9 @@ Plugin bundles the following third-party resources:
|
|
93 |
|
94 |
== Changelog ==
|
95 |
|
|
|
|
|
|
|
96 |
= 2.3.19, Jul 27 2021 =
|
97 |
* Improved compatibility with WordPress 5.8.
|
98 |
* Security - Fixed unescaped meta data. Reported by Trustwave.
|
93 |
|
94 |
== Changelog ==
|
95 |
|
96 |
+
= 2.4.0, Aug 11 2021 =
|
97 |
+
* Security - Fixed security issues. Reported by wpscan.com.
|
98 |
+
|
99 |
= 2.3.19, Jul 27 2021 =
|
100 |
* Improved compatibility with WordPress 5.8.
|
101 |
* Security - Fixed unescaped meta data. Reported by Trustwave.
|
templates/settings/general.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<div class="wrap">
|
2 |
<h1 class="wp-heading-inline"><?php _e('General Settings', 'mp-timetable'); ?></h1>
|
|
|
3 |
|
4 |
<?php settings_errors('mpTimetableSettings', false); ?>
|
5 |
|
@@ -30,16 +31,27 @@
|
|
30 |
<input type="hidden" name="mp-timetable-save-settings" value="<?php echo wp_create_nonce('mp_timetable_nonce_settings') ?>">
|
31 |
</p>
|
32 |
</form>
|
33 |
-
|
34 |
-
<p><?php
|
35 |
|
36 |
-
|
37 |
-
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="wrap">
|
2 |
<h1 class="wp-heading-inline"><?php _e('General Settings', 'mp-timetable'); ?></h1>
|
3 |
+
<div class="motopress-offer-primary">
|
4 |
|
5 |
<?php settings_errors('mpTimetableSettings', false); ?>
|
6 |
|
31 |
<input type="hidden" name="mp-timetable-save-settings" value="<?php echo wp_create_nonce('mp_timetable_nonce_settings') ?>">
|
32 |
</p>
|
33 |
</form>
|
34 |
+
<p><?php
|
|
|
35 |
|
36 |
+
$pluginObject = get_plugin_data( MP_TT_PLUGIN_FILE );
|
37 |
+
$name = $pluginObject[ 'Name' ];
|
38 |
|
39 |
+
echo sprintf(
|
40 |
+
/* translators: 1: Timetable and Event Schedule 2:: five stars rating */
|
41 |
+
__( 'If you like %1$s please leave us a %2$s rating.', 'mp-timetable' ),
|
42 |
+
sprintf( '<strong>%s</strong>', esc_html( $name ) ),
|
43 |
+
'<a href="https://wordpress.org/support/plugin/mp-timetable/reviews?rate=5#new-post" target="_blank">★★★★★</a>'
|
44 |
+
);
|
45 |
+
?></p>
|
46 |
+
</div>
|
47 |
+
<?php
|
48 |
+
/*
|
49 |
+
* Offer free plugins
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
require_once Mp_Time_Table::get_plugin_path() . 'classes/class-offer.php';
|
53 |
+
$plugins_offer = new \mp_timetable\plugin_core\classes\Plugins_Offer();
|
54 |
+
$plugins_offer->render();
|
55 |
+
?>
|
56 |
+
|
57 |
+
</div>
|