Timetable and Event Schedule by MotoPress - Version 2.4.4

Version Description

Download this release

Release Info

Developer jetmonsters
Plugin Icon 128x128 Timetable and Event Schedule by MotoPress
Version 2.4.4
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.4

classes/class-core.php CHANGED
@@ -309,8 +309,8 @@ class Core {
309
  */
310
  public function wp_ajax_route_url() {
311
 
312
- $controller = isset( $_REQUEST[ "controller" ] ) ? $_REQUEST[ "controller" ] : null;
313
- $action = isset( $_REQUEST[ "mptt_action" ] ) ? $_REQUEST[ "mptt_action" ] : null;
314
 
315
  if ( ! empty( $action ) && current_user_can('edit_posts') ) {
316
  // call controller
@@ -560,7 +560,11 @@ class Core {
560
  wp_localize_script(
561
  'mptt-event-object',
562
  'MPTT',
563
- array( 'table_class' => apply_filters( 'mptt_shortcode_static_table_class', 'mptt-shortcode-table' ) )
 
 
 
 
564
  );
565
 
566
  wp_enqueue_script( 'underscore' );
@@ -570,7 +574,7 @@ class Core {
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' :
@@ -648,7 +652,7 @@ class Core {
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
 
309
  */
310
  public function wp_ajax_route_url() {
311
 
312
+ $controller = isset( $_REQUEST[ "controller" ] ) ? sanitize_text_field( $_REQUEST[ "controller" ] ) : null;
313
+ $action = isset( $_REQUEST[ "mptt_action" ] ) ? sanitize_text_field( $_REQUEST[ "mptt_action" ] ) : null;
314
 
315
  if ( ! empty( $action ) && current_user_can('edit_posts') ) {
316
  // call controller
560
  wp_localize_script(
561
  'mptt-event-object',
562
  'MPTT',
563
+ array(
564
+ 'table_class' => apply_filters( 'mptt_shortcode_static_table_class', 'mptt-shortcode-table' ),
565
+ 'timeslot_delete_nonce' => wp_create_nonce( 'timeslot_delete_nonce' ),
566
+ 'timeslot_update_nonce' => wp_create_nonce( 'timeslot_update_nonce' ),
567
+ )
568
  );
569
 
570
  wp_enqueue_script( 'underscore' );
574
  wp_enqueue_script( 'mptt-functions', Mp_Time_Table::get_plugin_url( 'media/js/mptt-functions' . $this->get_prefix() . '.js' ), array(), $this->version );
575
 
576
  if ( ! empty( $_GET[ 'page' ] ) ) {
577
+ switch ( sanitize_key( $_GET[ 'page' ] ) ) {
578
  case 'mptt-settings' :
579
  case 'mptt-import' :
580
  case 'mptt-help' :
652
 
653
  public function wp_ajax_install_plugin_ajax() {
654
 
655
+ $action = isset( $_REQUEST[ "action" ] ) ? sanitize_text_field( $_REQUEST[ "action" ] ) : null;
656
 
657
  if ( $action && $action === 'install_plugin_ajax' ) {
658
 
classes/class-offer.php CHANGED
@@ -19,7 +19,8 @@ class Plugins_Offer {
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(
@@ -37,7 +38,8 @@ class Plugins_Offer {
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' ) );
19
 
20
  if ( isset( $_POST[ 'plugin' ] ) ) {
21
 
22
+ $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
23
+ $activate = activate_plugins( $plugin );
24
 
25
  if ( ! is_wp_error( $activate ) ) {
26
  wp_send_json_success(
38
 
39
  check_ajax_referer( 'mptt-install-plugins', 'nonce' );
40
 
41
+ $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
42
+ $slug = strtok( $plugin, '/' );
43
 
44
  if ( empty( $_POST[ 'plugin' ] ) ) {
45
  wp_send_json_error( esc_html__( 'Could not install the plugin.', 'mp-timetable' ) );
classes/class-permalinks.php CHANGED
@@ -115,7 +115,7 @@ class Permalinks {
115
  $_POST['timetable_event_slug'],
116
  $_POST['timetable_event_category_slug'],
117
  $_POST['timetable_event_tag_slug']
118
- ) && wp_verify_nonce( wp_unslash( $_POST['timetable-permalinks-nonce'] ), 'timetable-permalinks' )
119
  ) { // WPCS: input var ok, sanitization ok.
120
 
121
  $permalinks = (array) get_option( 'mp_timetable_permalinks', array() );
115
  $_POST['timetable_event_slug'],
116
  $_POST['timetable_event_category_slug'],
117
  $_POST['timetable_event_tag_slug']
118
+ ) && wp_verify_nonce( sanitize_key( $_POST['timetable-permalinks-nonce'] ), 'timetable-permalinks' )
119
  ) { // WPCS: input var ok, sanitization ok.
120
 
121
  $permalinks = (array) get_option( 'mp_timetable_permalinks', array() );
classes/controllers/class-controller-column.php CHANGED
@@ -16,21 +16,13 @@ class Controller_Column extends Controller {
16
  private $data;
17
 
18
  public static function get_instance() {
 
19
  if (null === self::$instance) {
20
  self::$instance = new self();
21
  }
22
  return self::$instance;
23
  }
24
 
25
- /**
26
- * Action template
27
- */
28
- public function action_template() {
29
-
30
- $this->data = $_REQUEST;
31
- $this->get_view()->render_html("events/index", $this->data);
32
- }
33
-
34
  /**
35
  * @param $post
36
  */
16
  private $data;
17
 
18
  public static function get_instance() {
19
+
20
  if (null === self::$instance) {
21
  self::$instance = new self();
22
  }
23
  return self::$instance;
24
  }
25
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * @param $post
28
  */
classes/controllers/class-controller-events.php CHANGED
@@ -26,20 +26,13 @@ class Controller_Events extends Controller {
26
  return self::$instance;
27
  }
28
 
29
- /**
30
- * Action template
31
- */
32
- public function action_template() {
33
-
34
- $this->data = $_REQUEST;
35
- $this->get_view()->render_html("events/index", $this->data);
36
- }
37
-
38
  /**
39
  * Delete event data by ID
40
  */
41
  public function action_delete() {
42
 
 
 
43
  $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
44
 
45
  $event_id = 0;
@@ -104,7 +97,9 @@ class Controller_Events extends Controller {
104
  */
105
  public function action_update_event_data() {
106
 
107
- $data = $_REQUEST[ 'data' ];
 
 
108
 
109
  $event_id = 0;
110
  $id = (int) $data[ 'id' ];
26
  return self::$instance;
27
  }
28
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Delete event data by ID
31
  */
32
  public function action_delete() {
33
 
34
+ check_ajax_referer( 'timeslot_delete_nonce', 'nonce' );
35
+
36
  $id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
37
 
38
  $event_id = 0;
97
  */
98
  public function action_update_event_data() {
99
 
100
+ check_ajax_referer( 'timeslot_update_nonce', 'nonce' );
101
+
102
+ $data = $_REQUEST[ 'data' ]; // WPCS: input var ok, CSRF ok, sanitization ok.
103
 
104
  $event_id = 0;
105
  $id = (int) $data[ 'id' ];
classes/controllers/class-controller-settings.php CHANGED
@@ -47,14 +47,14 @@ class Controller_Settings extends Controller {
47
  public function action_save() {
48
 
49
  if ( isset( $_POST['mp-timetable-save-settings'] ) &&
50
- wp_verify_nonce( $_POST['mp-timetable-save-settings'], 'mp_timetable_nonce_settings') ) {
51
 
52
  $redirect = Settings::get_instance()->save_settings();
53
 
54
  wp_safe_redirect(
55
  add_query_arg(
56
  array(
57
- 'page' => $_GET['page'],
58
  'settings-updated' => 'true'
59
  ),
60
  admin_url( 'edit.php?post_type=mp-event')
@@ -66,8 +66,8 @@ class Controller_Settings extends Controller {
66
  /**
67
  * Show success message
68
  */
69
- if ( isset( $_GET['settings-updated'] ) && ( $_GET['settings-updated'] == TRUE ) ) {
70
  add_settings_error('mpTimetableSettings', esc_attr('settings_updated'), __('Settings saved.', 'mp-timetable'), 'updated');
71
  }
72
  }
73
- }
47
  public function action_save() {
48
 
49
  if ( isset( $_POST['mp-timetable-save-settings'] ) &&
50
+ wp_verify_nonce( sanitize_key( $_POST['mp-timetable-save-settings'] ), 'mp_timetable_nonce_settings') ) {
51
 
52
  $redirect = Settings::get_instance()->save_settings();
53
 
54
  wp_safe_redirect(
55
  add_query_arg(
56
  array(
57
+ 'page' => sanitize_key( $_GET['page'] ),
58
  'settings-updated' => 'true'
59
  ),
60
  admin_url( 'edit.php?post_type=mp-event')
66
  /**
67
  * Show success message
68
  */
69
+ if ( isset( $_GET['settings-updated'] ) && ( filter_var( $_GET['settings-updated'], FILTER_VALIDATE_BOOLEAN) == TRUE ) ) {
70
  add_settings_error('mpTimetableSettings', esc_attr('settings_updated'), __('Settings saved.', 'mp-timetable'), 'updated');
71
  }
72
  }
73
+ }
classes/libs/parsers.php CHANGED
@@ -35,10 +35,10 @@ class WXR_Parser {
35
  echo '<pre>';
36
  if ('SimpleXML_parse_error' == $result->get_error_code()) {
37
  foreach ($result->get_error_data() as $error)
38
- echo $error->line . ':' . $error->column . ' ' . esc_html($error->message) . "\n";
39
  } else if ('XML_parse_error' == $result->get_error_code()) {
40
  $error = $result->get_error_data();
41
- echo $error[0] . ':' . $error[1] . ' ' . esc_html($error[2]);
42
  }
43
  echo '</pre>';
44
  echo '<p><strong>' . __('There was an error when reading this WXR file', 'mp-timetable') . '</strong><br />';
35
  echo '<pre>';
36
  if ('SimpleXML_parse_error' == $result->get_error_code()) {
37
  foreach ($result->get_error_data() as $error)
38
+ echo esc_html($error->line) . ':' . esc_html($error->column) . ' ' . esc_html($error->message) . "\n";
39
  } else if ('XML_parse_error' == $result->get_error_code()) {
40
  $error = $result->get_error_data();
41
+ echo esc_html($error[0]) . ':' . esc_html($error[1]) . ' ' . esc_html($error[2]);
42
  }
43
  echo '</pre>';
44
  echo '<p><strong>' . __('There was an error when reading this WXR file', 'mp-timetable') . '</strong><br />';
classes/models/class-column.php CHANGED
@@ -56,7 +56,7 @@ class Column extends Model {
56
  switch ($column) {
57
  case 'mp-column_timeslots_number':
58
  $metaData = $this->count_events($post);
59
- echo empty($metaData) ? "—" : $metaData;
60
  break;
61
  }
62
  }
@@ -192,9 +192,12 @@ class Column extends Model {
192
  * @param array $params
193
  */
194
  public function save_column_data(array $params) {
195
- if (!empty($params['data'])) {
 
 
196
  foreach ($params['data'] as $meta_key => $meta) {
197
- if (!empty($meta)) {
 
198
  update_post_meta($params['post']->ID, $meta_key, sanitize_text_field( $meta ) );
199
  } else {
200
  delete_post_meta($params['post']->ID, $meta_key, $meta);
56
  switch ($column) {
57
  case 'mp-column_timeslots_number':
58
  $metaData = $this->count_events($post);
59
+ echo empty($metaData) ? "—" : esc_html( $metaData ); // int
60
  break;
61
  }
62
  }
192
  * @param array $params
193
  */
194
  public function save_column_data(array $params) {
195
+
196
+ if ( !empty($params['data']) ) {
197
+
198
  foreach ($params['data'] as $meta_key => $meta) {
199
+
200
+ if ( !empty($meta) ) {
201
  update_post_meta($params['post']->ID, $meta_key, sanitize_text_field( $meta ) );
202
  } else {
203
  delete_post_meta($params['post']->ID, $meta_key, $meta);
classes/models/class-events.php CHANGED
@@ -336,11 +336,11 @@ class Events extends Model {
336
 
337
  for ( $i = 0; $i < count( $event[ 'event_start' ] ); $i ++ ) {
338
  $rows_affected[] = $this->wpdb->insert( $this->table_name, array(
339
- 'column_id' => $key,
340
- 'event_id' => $params[ 'post' ]->ID,
341
- 'event_start' => date( 'H:i', strtotime( $event[ 'event_start' ][ $i ] ) ),
342
- 'event_end' => date( 'H:i', strtotime( $event[ 'event_end' ][ $i ] ) ),
343
- 'user_id' => $event[ 'user_id' ][ $i ],
344
  'description' => wp_kses_post( $event[ 'description' ][ $i ] )
345
  )
346
  );
@@ -348,6 +348,7 @@ class Events extends Model {
348
  }
349
  }
350
  }
 
351
  if ( ! empty( $params[ 'event_meta' ] ) ) {
352
  foreach ( $params[ 'event_meta' ] as $meta_key => $meta ) {
353
  switch ( $meta_key ) {
@@ -814,7 +815,7 @@ class Events extends Model {
814
  wp_die( __( 'A post type mismatch has been detected.', 'mp-timetable' ), __( 'Sorry, you are not allowed to edit this item.', 'mp-timetable' ), 400 );
815
  }
816
 
817
- $nonce = $_REQUEST['_wpnonce'];
818
 
819
  if ( wp_verify_nonce( $nonce, 'mptt_duplicate_event' ) && current_user_can('edit_posts') ) {
820
 
336
 
337
  for ( $i = 0; $i < count( $event[ 'event_start' ] ); $i ++ ) {
338
  $rows_affected[] = $this->wpdb->insert( $this->table_name, array(
339
+ 'column_id' => absint( $key ),
340
+ 'event_id' => absint( $params[ 'post' ]->ID ),
341
+ 'event_start' => date( 'H:i', strtotime( sanitize_text_field( $event[ 'event_start' ][ $i ] ) ) ),
342
+ 'event_end' => date( 'H:i', strtotime( sanitize_text_field( $event[ 'event_end' ][ $i ] ) ) ),
343
+ 'user_id' => absint( $event[ 'user_id' ][ $i ] ),
344
  'description' => wp_kses_post( $event[ 'description' ][ $i ] )
345
  )
346
  );
348
  }
349
  }
350
  }
351
+
352
  if ( ! empty( $params[ 'event_meta' ] ) ) {
353
  foreach ( $params[ 'event_meta' ] as $meta_key => $meta ) {
354
  switch ( $meta_key ) {
815
  wp_die( __( 'A post type mismatch has been detected.', 'mp-timetable' ), __( 'Sorry, you are not allowed to edit this item.', 'mp-timetable' ), 400 );
816
  }
817
 
818
+ $nonce = sanitize_key( $_REQUEST['_wpnonce'] );
819
 
820
  if ( wp_verify_nonce( $nonce, 'mptt_duplicate_event' ) && current_user_can('edit_posts') ) {
821
 
classes/models/class-import.php CHANGED
@@ -119,7 +119,7 @@ class Import extends Model {
119
  ?>
120
  <form action="<?php echo admin_url('admin.php?import=mptt-importer&amp;step=2'); ?>" method="post">
121
  <?php wp_nonce_field('mptt-importer'); ?>
122
- <input type="hidden" name="import_id" value="<?php echo $this->id; ?>"/>
123
 
124
  <?php if (!empty($this->authors)) : ?>
125
  <h3><?php _e('Assign Authors', 'mp-timetable'); ?></h3>
@@ -156,7 +156,7 @@ class Import extends Model {
156
  */
157
  function author_select($n, $author) {
158
  _e('Import author:', 'mp-timetable');
159
- echo ' <strong>' . esc_html($author['author_display_name']);
160
  if ($this->version != '1.0') echo ' (' . esc_html($author['author_login']) . ')';
161
  echo '</strong><br />';
162
 
@@ -173,7 +173,7 @@ class Import extends Model {
173
  $value = esc_attr(sanitize_user($author['author_login'], true));
174
  }
175
 
176
- echo ' <input type="text" name="user_new[' . $n . ']" value="' . $value . '" /><br />';
177
  }
178
 
179
  if (!$create_users && $this->version == '1.0')
@@ -181,7 +181,7 @@ class Import extends Model {
181
  else
182
  _e('or assign posts to an existing user:', 'mp-timetable');
183
  wp_dropdown_users(array('name' => "user_map[$n]", 'multi' => true, 'show_option_all' => __('- Select -', 'mp-timetable')));
184
- echo '<input type="hidden" name="imported_authors[' . $n . ']" value="' . esc_attr($author['author_login']) . '" />';
185
 
186
  if ($this->version != '1.0')
187
  echo '</div>';
119
  ?>
120
  <form action="<?php echo admin_url('admin.php?import=mptt-importer&amp;step=2'); ?>" method="post">
121
  <?php wp_nonce_field('mptt-importer'); ?>
122
+ <input type="hidden" name="import_id" value="<?php echo esc_attr( $this->id ); ?>"/>
123
 
124
  <?php if (!empty($this->authors)) : ?>
125
  <h3><?php _e('Assign Authors', 'mp-timetable'); ?></h3>
156
  */
157
  function author_select($n, $author) {
158
  _e('Import author:', 'mp-timetable');
159
+ echo ' <strong>' . esc_html( $author['author_display_name'] );
160
  if ($this->version != '1.0') echo ' (' . esc_html($author['author_login']) . ')';
161
  echo '</strong><br />';
162
 
173
  $value = esc_attr(sanitize_user($author['author_login'], true));
174
  }
175
 
176
+ echo ' <input type="text" name="user_new[' . esc_attr( $n ) . ']" value="' . esc_attr( $value ) . '" /><br />';
177
  }
178
 
179
  if (!$create_users && $this->version == '1.0')
181
  else
182
  _e('or assign posts to an existing user:', 'mp-timetable');
183
  wp_dropdown_users(array('name' => "user_map[$n]", 'multi' => true, 'show_option_all' => __('- Select -', 'mp-timetable')));
184
+ echo '<input type="hidden" name="imported_authors[' . esc_attr( $n ) . ']" value="' . esc_attr($author['author_login']) . '" />';
185
 
186
  if ($this->version != '1.0')
187
  echo '</div>';
classes/models/class-settings.php CHANGED
@@ -78,7 +78,7 @@ class Settings extends Model {
78
  if ( current_user_can('manage_options') && !empty( $_POST['theme_mode'] ) ) {
79
 
80
  $options = array();
81
- $options['theme_mode'] = $_POST['theme_mode'];
82
 
83
  update_option('mp_timetable_general', $options);
84
  }
78
  if ( current_user_can('manage_options') && !empty( $_POST['theme_mode'] ) ) {
79
 
80
  $options = array();
81
+ $options['theme_mode'] = sanitize_key( $_POST['theme_mode'] );
82
 
83
  update_option('mp_timetable_general', $options);
84
  }
classes/modules/class-post.php CHANGED
@@ -50,13 +50,17 @@ class Post extends Module {
50
  */
51
  public function save_custom_post($post_id, $post) {
52
 
53
- $request = $_REQUEST;
54
 
55
  if ( !empty( $request[Mp_Time_Table::get_plugin_name() . '_noncename'] ) ) {
56
 
57
- $post_type = $request['post_type'];
58
 
59
- if ( !wp_verify_nonce($request[Mp_Time_Table::get_plugin_name() . '_noncename'], Mp_Time_Table::get_plugin_path())) {
 
 
 
 
60
  return $post->ID;
61
  }
62
 
@@ -73,8 +77,8 @@ class Post extends Module {
73
  switch ($post_type) {
74
  case 'mp-event':
75
  $this->get('events')->save_event_data(array('post' => $post,
76
- 'event_data' => (!empty($request['event_data'])) ? $request['event_data'] : null,
77
- 'event_meta' => (!empty($request['event_meta'])) ? $request['event_meta'] : null));
78
  break;
79
  case 'mp-column':
80
  $this->get('column')->save_column_data(array('post' => $post, 'data' => $request['column']));
50
  */
51
  public function save_custom_post($post_id, $post) {
52
 
53
+ $request = $_REQUEST; // WPCS: input var ok, CSRF ok, sanitization ok.
54
 
55
  if ( !empty( $request[Mp_Time_Table::get_plugin_name() . '_noncename'] ) ) {
56
 
57
+ $post_type = sanitize_text_field( $request['post_type'] );
58
 
59
+ if ( !wp_verify_nonce(
60
+ sanitize_key( $request[Mp_Time_Table::get_plugin_name() . '_noncename'] ),
61
+ Mp_Time_Table::get_plugin_path()
62
+ )
63
+ ) {
64
  return $post->ID;
65
  }
66
 
77
  switch ($post_type) {
78
  case 'mp-event':
79
  $this->get('events')->save_event_data(array('post' => $post,
80
+ 'event_data' => (!empty($request['event_data'])) ? $request['event_data'] : null, // WPCS: input var ok, CSRF ok, sanitization ok.
81
+ 'event_meta' => (!empty($request['event_meta'])) ? $request['event_meta'] : null)); // WPCS: input var ok, CSRF ok, sanitization ok.
82
  break;
83
  case 'mp-column':
84
  $this->get('column')->save_column_data(array('post' => $post, 'data' => $request['column']));
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.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"
@@ -57,7 +57,7 @@ msgstr ""
57
  msgid "Import"
58
  msgstr ""
59
 
60
- #: classes/blocks/class-timetable-block.php:92
61
  #: classes/class-core.php:448
62
  #: classes/class-shortcode.php:70
63
  #: classes/class-shortcode.php:286
@@ -246,31 +246,31 @@ msgstr ""
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 ""
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.1\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-19T15:15:13+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"
57
  msgid "Import"
58
  msgstr ""
59
 
60
+ #: classes/blocks/class-timetable-block.php:102
61
  #: classes/class-core.php:448
62
  #: classes/class-shortcode.php:70
63
  #: classes/class-shortcode.php:286
246
  msgid "No Columns found in Trash"
247
  msgstr ""
248
 
249
+ #: classes/class-core.php:590
250
  #: classes/class-offer.php:174
251
  msgid "Install Plugin"
252
  msgstr ""
253
 
254
+ #: classes/class-core.php:591
255
  #: classes/class-offer.php:163
256
  msgid "Activated"
257
  msgstr ""
258
 
259
+ #: classes/class-core.php:592
260
  #: classes/class-offer.php:160
261
  msgid "Active"
262
  msgstr ""
263
 
264
+ #: classes/class-core.php:593
265
  #: classes/class-offer.php:165
266
  msgid "Inactive"
267
  msgstr ""
268
 
269
+ #: classes/class-core.php:594
270
  msgid "Loading..."
271
  msgstr ""
272
 
273
+ #: classes/class-core.php:595
274
  #: classes/class-offer.php:168
275
  msgid "Activate"
276
  msgstr ""
media/js/events/event.js CHANGED
@@ -221,7 +221,8 @@ Registry.register("Event",
221
  {
222
  controller: "events",
223
  action: "delete",
224
- id: id
 
225
  },
226
  function(data) {
227
  var $deleteEvent = $('#events-list').find('tr[data-id="' + id + '"]');
@@ -262,6 +263,7 @@ Registry.register("Event",
262
  Registry._get("adminFunctions").wpAjax({
263
  controller: "events",
264
  action: "update_event_data",
 
265
  data: {
266
  id: Registry._get("Event").event_id,
267
  event_start: $('#event_start').val(),
221
  {
222
  controller: "events",
223
  action: "delete",
224
+ id: id,
225
+ nonce: MPTT.timeslot_delete_nonce
226
  },
227
  function(data) {
228
  var $deleteEvent = $('#events-list').find('tr[data-id="' + id + '"]');
263
  Registry._get("adminFunctions").wpAjax({
264
  controller: "events",
265
  action: "update_event_data",
266
+ nonce: MPTT.timeslot_update_nonce,
267
  data: {
268
  id: Registry._get("Event").event_id,
269
  event_start: $('#event_start').val(),
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=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))}});
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,nonce:MPTT.timeslot_delete_nonce},(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",nonce:MPTT.timeslot_update_nonce,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"),o=t("#event_end"),s=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:o.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][description][]",value:s.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:[o.val()]},{tag:"td",attrs:{class:"event-description"},content:[s.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"),o=e.find(".mptt-inner-event-content").height();e.css("position","").css("width","").css("min-height",""),i.hasClass("mprm_ie_browser")?(o=e.css("height","").find(".mptt-inner-event-content").height(),e.height(a),o<=r?e.css("max-height",r):(e.css("height",""),e.css("max-height",o))):o<=r?e.css("min-height",r):e.css("min-height",o),n<a&&e.height(a)},recalculate_Height:function(e,n){var i=t(".mptt-event-container",e),a=i.length,r=0,o=0,s=e.height();t("body").hasClass("mprm_ie_browser")?(r=s/(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",o+"px"),e.removeClass("mptt-hidden"),o+=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",o+"%"),e.removeClass("mptt-hidden"),o+=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"),o=n.closest("tr").next("tr"),s=o.find('td[data-column-id="'+r+'"]'),d=o.length>0&&s.length>0&&s.children().length>0;!d;){if(0==o.next("tr").length){d=!0,o=!1;break}d=(s=(o=o.next("tr")).find('td[data-column-id="'+r+'"]')).children().length>0}var c=!1;o&&(c=o.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],o=t(".mptt-shortcode-wrapper");r=_.isUndefined(r)?"all":r,1===o.length?e.showCurrentEvent(o,r):t.each(o,(function(n,i){var o=t(i);"#"+o.attr("id")===a?e.showCurrentEvent(o,r):e.showCurrentEvent(o,"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"),o=n+parseInt(r)-1,s=t.attr("colspan"),d=i.find('th[data-column-id="'+a+'"]').data("index"),c=parseInt(d)+parseInt(s);r<o;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-=o-r)<2){n=1;break}s>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"),o=i.attr("data-row_height"),s=e.getRowSpan(a,i);!_.isUndefined(s)&&s>1&&(s=e.removeCellsAfterChangeRowSpan(i,s,n,r),isNaN(o)||i.css("height",s*o)),i.attr("rowspan",s)}))}))},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))}});
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.4.1
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.4
8
  * Author: MotoPress
9
  * Author URI: https://motopress.com
10
  * License: GPLv2 or later
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://motopress.com/
4
  Tags: schedule, timetable, calendar, event, events calendar, dates, event organizer, booking, appointment, upcoming events
5
  Requires at least: 4.6
6
  Tested up to: 5.8
7
- Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -15,7 +15,8 @@ Smart event organizer and time-management tool with a clean minimalist design fo
15
  MotoPress Timetable and Event Schedule is an all-around organizer plugin developed to help you create and manage online schedules for a single or multiple events, customize the appearance of each event, add date, time, description and display all the needed items in a carefully-crafted timetable. It also comes with Upcoming events widget that will help you keep the sidebar clutter-free.
16
 
17
  * [Plugin Demo](https://mpttdemo.getmotopress.com/)
18
- * [Step-by-step instructions](https://motopress.com/files/motopress-timetable-plugin-documentation.pdf) of working with the plugin
 
19
 
20
  The plugin can be used for timetabling different types of events like various lessons, gym classes, festivals, conferences, ceremonies, case-studies, formal parties, concerts, and much more. It's handy in terms of backend management and maximum easy for your audience to use.
21
 
@@ -93,6 +94,15 @@ Plugin bundles the following third-party resources:
93
 
94
  == Changelog ==
95
 
 
 
 
 
 
 
 
 
 
96
  = 2.4.1, Aug 18 2021 =
97
  * Bug fix: fixed a PHP notice in Widget Areas in WordPress 5.8.
98
 
4
  Tags: schedule, timetable, calendar, event, events calendar, dates, event organizer, booking, appointment, upcoming events
5
  Requires at least: 4.6
6
  Tested up to: 5.8
7
+ Stable tag: 2.4.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
15
  MotoPress Timetable and Event Schedule is an all-around organizer plugin developed to help you create and manage online schedules for a single or multiple events, customize the appearance of each event, add date, time, description and display all the needed items in a carefully-crafted timetable. It also comes with Upcoming events widget that will help you keep the sidebar clutter-free.
16
 
17
  * [Plugin Demo](https://mpttdemo.getmotopress.com/)
18
+ * [Documentation](https://motopress.com/documentation/wordpress/plugins/timetable/)
19
+ * [Free Theme](https://gutenix.com/products/school/)
20
 
21
  The plugin can be used for timetabling different types of events like various lessons, gym classes, festivals, conferences, ceremonies, case-studies, formal parties, concerts, and much more. It's handy in terms of backend management and maximum easy for your audience to use.
22
 
94
 
95
  == Changelog ==
96
 
97
+ = 2.4.4, Oct 27 2021 =
98
+ * Security - sanitization and escaping.
99
+
100
+ = 2.4.3, Sep 27 2021 =
101
+ * Security - Fixed unescaped shortcode attributes.
102
+
103
+ = 2.4.2, Aug 20 2021 =
104
+ * Security - added nonces to prevent CSRF.
105
+
106
  = 2.4.1, Aug 18 2021 =
107
  * Bug fix: fixed a PHP notice in Widget Areas in WordPress 5.8.
108
 
templates-functions/action-mp-column-functions.php CHANGED
@@ -12,10 +12,11 @@ function mptt_column_template_content_post_content() { ?>
12
  <?php }
13
 
14
  function mptt_column_template_content_events_list() {
 
15
  $events = mptt_get_column_events();
16
  do_action('mptt-before-column-events', $events);
17
  ?>
18
- <ul class="mptt-column <?php echo apply_filters('mptt_events_list_class', 'events-list') ?>">
19
  <?php foreach ($events as $event): ?>
20
  <li class="event" id="event_columns_<?php echo esc_attr( $event->event_id ); ?>">
21
 
@@ -31,7 +32,7 @@ function mptt_column_template_content_events_list() {
31
  } else { ?>
32
  <img class="event-thumbnail event-thumbnail-default"
33
  src="<?php echo Mp_Time_Table::get_plugin_url() . 'media/css/images/column_icon.png' ?>"
34
- alt="<?php echo get_the_title($event->event_id); ?>">
35
  <?php } ?>
36
 
37
  <h4 class="event-title">
@@ -41,16 +42,16 @@ function mptt_column_template_content_events_list() {
41
  esc_url( $event->post->timetable_custom_url ) :
42
  get_permalink($event->event_id)
43
  ) ?>" class="event-link">
44
- <?php echo get_the_title($event->event_id); ?>
45
  </a>
46
  </h4>
47
 
48
  <p class="timeslot">
49
  <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
50
- echo date(get_option('time_format'), strtotime($event->event_start)); ?></time>
51
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
52
  <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
53
- echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
54
  </p>
55
 
56
  <?php if (!empty($event->post->sub_title)) { ?>
@@ -65,7 +66,7 @@ function mptt_column_template_content_events_list() {
65
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>"
66
  title="<?php the_title_attribute(array('post' => $event->event_id)); ?>"><?php
67
  echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name); ?>
68
- <?php echo $event->user->display_name ?></a></p>
69
  <?php } ?>
70
  <div class="mptt-clearfix"></div>
71
  </li>
@@ -81,7 +82,8 @@ function mptt_column_template_content_events_list() {
81
  * @return array
82
  */
83
  function mptt_get_column_events() {
 
84
  global $post;
85
  $data = Controller_Column::get_instance()->action_page_view($post);
86
  return !empty($data) ? $data : array();
87
- }
12
  <?php }
13
 
14
  function mptt_column_template_content_events_list() {
15
+
16
  $events = mptt_get_column_events();
17
  do_action('mptt-before-column-events', $events);
18
  ?>
19
+ <ul class="mptt-column <?php echo esc_attr( apply_filters('mptt_events_list_class', 'events-list') );?>">
20
  <?php foreach ($events as $event): ?>
21
  <li class="event" id="event_columns_<?php echo esc_attr( $event->event_id ); ?>">
22
 
32
  } else { ?>
33
  <img class="event-thumbnail event-thumbnail-default"
34
  src="<?php echo Mp_Time_Table::get_plugin_url() . 'media/css/images/column_icon.png' ?>"
35
+ alt="<?php echo esc_attr( get_the_title($event->event_id) );?>">
36
  <?php } ?>
37
 
38
  <h4 class="event-title">
42
  esc_url( $event->post->timetable_custom_url ) :
43
  get_permalink($event->event_id)
44
  ) ?>" class="event-link">
45
+ <?php echo esc_html( get_the_title($event->event_id) ); ?>
46
  </a>
47
  </h4>
48
 
49
  <p class="timeslot">
50
  <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
51
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_start)) ); ?></time>
52
  <?php echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
53
  <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
54
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_end)) ); ?></time>
55
  </p>
56
 
57
  <?php if (!empty($event->post->sub_title)) { ?>
66
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>"
67
  title="<?php the_title_attribute(array('post' => $event->event_id)); ?>"><?php
68
  echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name); ?>
69
+ <?php echo esc_html( $event->user->display_name );?></a></p>
70
  <?php } ?>
71
  <div class="mptt-clearfix"></div>
72
  </li>
82
  * @return array
83
  */
84
  function mptt_get_column_events() {
85
+
86
  global $post;
87
  $data = Controller_Column::get_instance()->action_page_view($post);
88
  return !empty($data) ? $data : array();
89
+ }
templates-functions/action-shortcode-functions.php CHANGED
@@ -10,10 +10,13 @@ function mptt_shortcode_template_before_content() {
10
  global $mptt_shortcode_data;
11
 
12
  $wrapper_class = mptt_popular_theme_class();
13
- $id = empty( $mptt_shortcode_data[ 'params' ][ 'id' ] ) ? '' : $mptt_shortcode_data[ 'params' ][ 'id' ];
14
-
 
 
 
15
  ?>
16
- <div <?php if ( !empty($id) ) echo 'id="' . $id . '" '; ?>class="<?php echo apply_filters( 'mptt_shortcode_wrapper_class', 'mptt-shortcode-wrapper' . $wrapper_class . ( $mptt_shortcode_data[ 'params' ][ 'responsive' ] == '0' ? ' mptt-table-fixed' : ' mptt-table-responsive' ) ) ?>">
17
  <?php
18
  }
19
 
@@ -54,10 +57,10 @@ function mptt_shortcode_template_content_filter() {
54
  $display_label = $params[ 'hide_label' ] ? 'display: none' : '';
55
 
56
  if ( $params[ 'view' ] == 'dropdown_list' ) { ?>
57
- <select class="<?php echo apply_filters( 'mptt_shortcode_navigation_select_class', 'mptt-menu mptt-navigation-select' ) ?>"<?php echo $style ?>>
58
  <?php if ( ! $params[ 'hide_label' ] ) { ?>
59
  <option value="all"><?php echo ( strlen( trim( $params[ 'label' ] ) ) ) ?
60
- trim( $params[ 'label' ] ) : __( 'All Events', 'mp-timetable' ) ?></option>
61
  <?php } else { ?>
62
  <option value="all"></option>
63
  <?php }
@@ -68,11 +71,11 @@ function mptt_shortcode_template_content_filter() {
68
  endif; ?>
69
  </select>
70
  <?php } elseif ( $params[ 'view' ] == 'tabs' ) { ?>
71
- <ul class="<?php echo apply_filters( 'mptt_shortcode_navigation_tabs_class', 'mptt-menu mptt-navigation-tabs' ) ?>" <?php echo $style ?>>
72
- <li style="<?php echo $display_label ?>">
73
  <a title="<?php echo ( strlen( trim( $params[ 'label' ] ) ) ) ?
74
- trim( $params[ 'label' ] ) : __( 'All Events', 'mp-timetable' ) ?>" href="#all" onclick="event.preventDefault();"><?php
75
- echo ( strlen( trim( $params[ 'label' ] ) ) ) ? trim( $params[ 'label' ] ) : __( 'All Events', 'mp-timetable' ) ?>
76
  </a>
77
  </li>
78
  <?php if ( ! empty( $unique_events ) ): ?>
@@ -130,7 +133,7 @@ function mptt_shortcode_template_event( $mptt_shortcode_data, $post = 'all' ) {
130
  $data_grouped_by_row = mptt_make_data_shortcode( $bounds, $mptt_shortcode_data, $column_events );
131
 
132
  ?>
133
- <table class="<?php echo ! empty( $table_class ) ? $table_class : ''; ?>" id="#<?php echo is_object( $post ) ? $post->post_name : $post; ?>" style="display:none; <?php echo $font_size; ?>" data-hide_empty_row="<?php echo $hide_empty_rows; ?>">
134
  <?php echo View::get_instance()->get_template_html( 'shortcodes/table-header', array( 'header_items' => $data_grouped_by_row[ 'table_header' ], 'params' => $params ) ); ?>
135
  <tbody>
136
  <?php if ( isset( $data_grouped_by_row[ 'rows' ] ) && is_array( $data_grouped_by_row[ 'rows' ] ) ) {
@@ -139,18 +142,18 @@ function mptt_shortcode_template_event( $mptt_shortcode_data, $post = 'all' ) {
139
  if ( ! $row[ 'show' ] && $params[ 'hide_empty_rows' ] ) {
140
  continue;
141
  } ?>
142
- <tr class="mptt-shortcode-row-<?php echo $row_key ?>" data-index="<?php echo $row_key ?>">
143
  <?php $cells = $data_grouped_by_row[ 'rows' ][ $row_key ][ 'cells' ];
144
 
145
  foreach ( $cells as $key_event => $cell ) {
146
 
147
  if ( isset( $cell[ 'time_cell' ] ) && filter_var( $cell[ 'time_cell' ], FILTER_VALIDATE_BOOLEAN, array( 'options' => array( 'default' => false ) ) ) ) { ?>
148
- <td class="mptt-shortcode-hours" style="<?php echo 'height:' . $row_height . 'px;'; ?>"><?php echo $cell[ 'title' ] ?></td>
149
  <?php continue;
150
  }
151
 
152
  if ( ! $cell[ 'hide' ] ) { ?>
153
- <td class="mptt-shortcode-event <?php echo mptt_is_grouped_event_class( $cell ) ?> mptt-event-vertical-<?php echo $params[ 'text_align_vertical' ] ?>" data-column-id="<?php echo $cell[ 'column_id' ] ?>" colspan="<?php echo ! isset( $cell[ 'count' ] ) ? '' : $cell[ 'count' ] ?>" data-row_height="<?php echo $row_height; ?>" style="<?php echo 'height:' . $row_height . 'px;'; ?>">
154
  <?php
155
  $height = 100 / count( $cell[ 'events' ] );
156
  $top = 0;
@@ -237,7 +240,7 @@ function mptt_shortcode_get_table_cell_bounds( $column_events, $params ) {
237
  function mptt_shortcode_template_content_responsive_table() {
238
  global $mptt_shortcode_data;
239
  if ( $mptt_shortcode_data[ 'params' ][ 'responsive' ] ) { ?>
240
- <div class="<?php echo apply_filters( 'mptt_shortcode_list_view_class', 'mptt-shortcode-list' ) . ' ' . $mptt_shortcode_data[ 'params' ][ 'custom_class' ] ?>">
241
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ] ) ):
242
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column' ] as $column ): ?>
243
  <div class="mptt-column">
@@ -247,7 +250,7 @@ function mptt_shortcode_template_content_responsive_table() {
247
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] as $event ) : ?>
248
  <li class="mptt-list-event" data-event-id="<?php echo esc_attr( $event->post->post_name ); ?>"
249
  <?php if ( ! empty( $event->post->color ) ) {
250
- echo 'style="border-left-color:' . $event->post->color . ';"';
251
  } ?>>
252
  <?php if ( $mptt_shortcode_data[ 'params' ][ 'title' ] ):
253
  $disable_url = (bool) $event->post->timetable_disable_url || (bool) $mptt_shortcode_data[ 'params' ][ 'disable_event_url' ];
10
  global $mptt_shortcode_data;
11
 
12
  $wrapper_class = mptt_popular_theme_class();
13
+ $id = empty( $mptt_shortcode_data[ 'params' ][ 'id' ] ) ? '' : $mptt_shortcode_data[ 'params' ][ 'id' ];
14
+ $mptt_shortcode_wrapper_class = apply_filters(
15
+ 'mptt_shortcode_wrapper_class',
16
+ 'mptt-shortcode-wrapper' . $wrapper_class . ( $mptt_shortcode_data[ 'params' ][ 'responsive' ] == '0' ? ' mptt-table-fixed' : ' mptt-table-responsive' )
17
+ );
18
  ?>
19
+ <div <?php if ( !empty($id) ) echo 'id="' . esc_attr( $id ) . '" '; ?>class="<?php echo esc_attr( $mptt_shortcode_wrapper_class );?>">
20
  <?php
21
  }
22
 
57
  $display_label = $params[ 'hide_label' ] ? 'display: none' : '';
58
 
59
  if ( $params[ 'view' ] == 'dropdown_list' ) { ?>
60
+ <select class="<?php echo esc_attr( apply_filters( 'mptt_shortcode_navigation_select_class', 'mptt-menu mptt-navigation-select' ) );?>"<?php echo $style ?>>
61
  <?php if ( ! $params[ 'hide_label' ] ) { ?>
62
  <option value="all"><?php echo ( strlen( trim( $params[ 'label' ] ) ) ) ?
63
+ esc_html( trim( $params[ 'label' ] ) ) : __( 'All Events', 'mp-timetable' ) ?></option>
64
  <?php } else { ?>
65
  <option value="all"></option>
66
  <?php }
71
  endif; ?>
72
  </select>
73
  <?php } elseif ( $params[ 'view' ] == 'tabs' ) { ?>
74
+ <ul class="<?php echo esc_attr( apply_filters( 'mptt_shortcode_navigation_tabs_class', 'mptt-menu mptt-navigation-tabs' ) );?>" <?php echo $style ?>>
75
+ <li style="<?php echo esc_attr( $display_label ) ?>">
76
  <a title="<?php echo ( strlen( trim( $params[ 'label' ] ) ) ) ?
77
+ esc_html( trim( $params[ 'label' ] ) ) : __( 'All Events', 'mp-timetable' ) ?>" href="#all" onclick="event.preventDefault();"><?php
78
+ echo ( strlen( trim( $params[ 'label' ] ) ) ) ? esc_html( trim( $params[ 'label' ] ) ) : __( 'All Events', 'mp-timetable' ) ?>
79
  </a>
80
  </li>
81
  <?php if ( ! empty( $unique_events ) ): ?>
133
  $data_grouped_by_row = mptt_make_data_shortcode( $bounds, $mptt_shortcode_data, $column_events );
134
 
135
  ?>
136
+ <table class="<?php echo ! empty( $table_class ) ? esc_attr( $table_class ) : ''; ?>" id="#<?php echo is_object( $post ) ? esc_attr( $post->post_name ) : esc_attr( $post ); ?>" style="display:none; <?php echo esc_attr( $font_size ); ?>" data-hide_empty_row="<?php echo esc_attr( $hide_empty_rows ); ?>">
137
  <?php echo View::get_instance()->get_template_html( 'shortcodes/table-header', array( 'header_items' => $data_grouped_by_row[ 'table_header' ], 'params' => $params ) ); ?>
138
  <tbody>
139
  <?php if ( isset( $data_grouped_by_row[ 'rows' ] ) && is_array( $data_grouped_by_row[ 'rows' ] ) ) {
142
  if ( ! $row[ 'show' ] && $params[ 'hide_empty_rows' ] ) {
143
  continue;
144
  } ?>
145
+ <tr class="mptt-shortcode-row-<?php echo esc_attr( $row_key ); ?>" data-index="<?php echo esc_attr( $row_key ) ?>">
146
  <?php $cells = $data_grouped_by_row[ 'rows' ][ $row_key ][ 'cells' ];
147
 
148
  foreach ( $cells as $key_event => $cell ) {
149
 
150
  if ( isset( $cell[ 'time_cell' ] ) && filter_var( $cell[ 'time_cell' ], FILTER_VALIDATE_BOOLEAN, array( 'options' => array( 'default' => false ) ) ) ) { ?>
151
+ <td class="mptt-shortcode-hours" style="<?php echo 'height:' . esc_attr( $row_height ) . 'px;'; ?>"><?php echo esc_html( $cell[ 'title' ] ); ?></td>
152
  <?php continue;
153
  }
154
 
155
  if ( ! $cell[ 'hide' ] ) { ?>
156
+ <td class="mptt-shortcode-event <?php echo esc_attr( mptt_is_grouped_event_class( $cell ) ); ?> mptt-event-vertical-<?php echo esc_attr( $params[ 'text_align_vertical' ] ); ?>" data-column-id="<?php echo esc_attr( $cell[ 'column_id' ] ); ?>" colspan="<?php echo ! isset( $cell[ 'count' ] ) ? '' : esc_attr( $cell[ 'count' ] ); ?>" data-row_height="<?php echo esc_attr( $row_height ); ?>" style="<?php echo 'height:' . esc_attr( $row_height ) . 'px;'; ?>">
157
  <?php
158
  $height = 100 / count( $cell[ 'events' ] );
159
  $top = 0;
240
  function mptt_shortcode_template_content_responsive_table() {
241
  global $mptt_shortcode_data;
242
  if ( $mptt_shortcode_data[ 'params' ][ 'responsive' ] ) { ?>
243
+ <div class="<?php echo esc_attr( apply_filters( 'mptt_shortcode_list_view_class', 'mptt-shortcode-list' ) ) . ' ' . esc_attr( $mptt_shortcode_data[ 'params' ][ 'custom_class' ] ); ?>">
244
  <?php if ( ! empty( $mptt_shortcode_data[ 'events_data' ] ) ):
245
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column' ] as $column ): ?>
246
  <div class="mptt-column">
250
  foreach ( $mptt_shortcode_data[ 'events_data' ][ 'column_events' ][ $column->ID ] as $event ) : ?>
251
  <li class="mptt-list-event" data-event-id="<?php echo esc_attr( $event->post->post_name ); ?>"
252
  <?php if ( ! empty( $event->post->color ) ) {
253
+ echo 'style="border-left-color:' . esc_attr( $event->post->color ) . ';"';
254
  } ?>>
255
  <?php if ( $mptt_shortcode_data[ 'params' ][ 'title' ] ):
256
  $disable_url = (bool) $event->post->timetable_disable_url || (bool) $mptt_shortcode_data[ 'params' ][ 'disable_event_url' ];
templates-functions/action-widget-functions.php CHANGED
@@ -4,13 +4,13 @@ function mptt_widget_template_before_content() {
4
  $wrapper_class = mptt_popular_theme_class();
5
  if (Settings::get_instance()->is_plugin_template_mode()) {
6
  ?>
7
- <div class="<?php echo apply_filters('mptt_widget_wrapper_class', 'upcoming-events-widget' . $wrapper_class) ?>">
8
- <ul class="mptt-widget <?php echo apply_filters('mptt_events_list_class', 'events-list') ?>">
9
  <?php
10
  } else {
11
  ?>
12
- <div class="widget_recent_entries <?php echo apply_filters('mptt_widget_theme_wrapper_class', 'theme-upcoming-events-widget' . $wrapper_class) ?>">
13
- <ul class="mptt-widget <?php echo apply_filters('mptt_events_list_class', '') ?>">
14
  <?php
15
  }
16
  }
4
  $wrapper_class = mptt_popular_theme_class();
5
  if (Settings::get_instance()->is_plugin_template_mode()) {
6
  ?>
7
+ <div class="<?php echo esc_attr( apply_filters('mptt_widget_wrapper_class', 'upcoming-events-widget' . $wrapper_class) );?>">
8
+ <ul class="mptt-widget <?php echo esc_attr( apply_filters('mptt_events_list_class', 'events-list') );?>">
9
  <?php
10
  } else {
11
  ?>
12
+ <div class="widget_recent_entries <?php echo esc_attr( apply_filters('mptt_widget_theme_wrapper_class', 'theme-upcoming-events-widget' . $wrapper_class) );?>">
13
+ <ul class="mptt-widget <?php echo esc_attr( apply_filters('mptt_events_list_class', '') );?>">
14
  <?php
15
  }
16
  }
templates-functions/actions-mp-event-functions.php CHANGED
@@ -33,19 +33,19 @@ function mptt_event_template_content_time_list() {
33
  $events = mptt_get_event_data();
34
  do_action('mptt-before-timeslots', $events);
35
  ?>
36
- <ul class="mptt-event <?php echo apply_filters('mptt_events_list_class', 'events-list') ?>">
37
  <?php foreach ($events as $event): ?>
38
- <li class="event mptt-colorized" id="event_hours_<?php echo $event->event_id ?>">
39
 
40
  <h4 class="event-title">
41
- <a class="event-link" href="<?php echo get_permalink($event->column_id); ?>" title="<?php the_title_attribute(array('post' => $event->event_id)); ?>"><?php echo get_the_title($event->column_id); ?></a>
42
  </h4>
43
  <p class="timeslot">
44
- <time datetime="<?php echo $event->event_start; ?>" class="timeslot-start"><?php
45
- echo date(get_option('time_format'), strtotime($event->event_start)); ?></time><?php
46
  echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
47
- <time datetime="<?php echo $event->event_end; ?>" class="timeslot-end"><?php
48
- echo date(get_option('time_format'), strtotime($event->event_end)); ?></time>
49
  </p>
50
  <?php if (!empty($event->post->sub_title)) { ?>
51
  <p class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></p>
@@ -56,9 +56,9 @@ function mptt_event_template_content_time_list() {
56
  <?php } ?>
57
  <?php if (!empty($event->user)) { ?>
58
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>" title="<?php
59
- echo $event->user->display_name; ?>"><?php
60
  echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name) . ' ';
61
- echo $event->user->display_name ?></a></p>
62
  <?php } ?>
63
  </li>
64
  <?php endforeach; ?>
33
  $events = mptt_get_event_data();
34
  do_action('mptt-before-timeslots', $events);
35
  ?>
36
+ <ul class="mptt-event <?php echo esc_attr( apply_filters('mptt_events_list_class', 'events-list') );?>">
37
  <?php foreach ($events as $event): ?>
38
+ <li class="event mptt-colorized" id="event_hours_<?php echo esc_attr( $event->event_id ); ?>">
39
 
40
  <h4 class="event-title">
41
+ <a class="event-link" href="<?php echo esc_url( get_permalink($event->column_id) ); ?>" title="<?php esc_attr( the_title_attribute(array('post' => $event->event_id)) ); ?>"><?php echo esc_html( get_the_title($event->column_id) ); ?></a>
42
  </h4>
43
  <p class="timeslot">
44
+ <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
45
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_start)) ); ?></time><?php
46
  echo apply_filters('mptt_timeslot_delimiter', ' - '); ?>
47
+ <time datetime="<?php echo esc_attr( $event->event_end ); ?>" class="timeslot-end"><?php
48
+ echo esc_html( date(get_option('time_format'), strtotime($event->event_end)) ); ?></time>
49
  </p>
50
  <?php if (!empty($event->post->sub_title)) { ?>
51
  <p class="event-subtitle"><?php echo wp_kses_post( $event->post->sub_title ); ?></p>
56
  <?php } ?>
57
  <?php if (!empty($event->user)) { ?>
58
  <p class="event-user"><a href="<?php echo get_author_posts_url($event->user->ID); ?>" title="<?php
59
+ echo esc_attr( $event->user->display_name ); ?>"><?php
60
  echo get_avatar($event->user->ID, apply_filters('mptt-column-user-avatar-size', 32), '', $event->user->display_name) . ' ';
61
+ echo esc_html( $event->user->display_name ); ?></a></p>
62
  <?php } ?>
63
  </li>
64
  <?php endforeach; ?>
templates/column/metabox-column-options.php CHANGED
@@ -1,5 +1,5 @@
1
  <input type="hidden" name="<?php echo Mp_Time_Table::get_plugin_name() . '_noncename' ?>" value="<?php echo wp_create_nonce(Mp_Time_Table::get_plugin_path()) ?>"/>
2
- <input type="hidden" id="date-format" value="<?php echo get_option('date_format') ?>">
3
 
4
  <table id="column-options" class="column-options form-table">
5
 
@@ -46,7 +46,7 @@
46
  }
47
  ?>
48
  <input id="datepicker" class="option-input" type="text" name="column[option_day]"
49
- value="<?php echo $datepicker_value ?>"
50
  <?php echo ($post->column_option != 'date') ? 'disabled="disabled"' : '' ?>
51
  placeholder="<?php echo date('d/m/Y', current_time( 'timestamp' ) ) ?>">
52
  </div>
1
  <input type="hidden" name="<?php echo Mp_Time_Table::get_plugin_name() . '_noncename' ?>" value="<?php echo wp_create_nonce(Mp_Time_Table::get_plugin_path()) ?>"/>
2
+ <input type="hidden" id="date-format" value="<?php echo esc_attr( get_option('date_format') );?>">
3
 
4
  <table id="column-options" class="column-options form-table">
5
 
46
  }
47
  ?>
48
  <input id="datepicker" class="option-input" type="text" name="column[option_day]"
49
+ value="<?php echo esc_attr( $datepicker_value ); ?>"
50
  <?php echo ($post->column_option != 'date') ? 'disabled="disabled"' : '' ?>
51
  placeholder="<?php echo date('d/m/Y', current_time( 'timestamp' ) ) ?>">
52
  </div>
templates/events/column-category.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  foreach ($terms as $term) {
4
- ?><a href="<?php echo get_term_link($term->term_id) ?>" rel="tag" title="<?php echo esc_attr( $term->name ); ?>"><?php
5
  echo esc_html( $term->name ); ?></a><?php echo ($term !== end($terms)) ? ', ' : '' ?>
6
  <?php
7
  }
1
  <?php
2
 
3
  foreach ($terms as $term) {
4
+ ?><a href="<?php echo esc_url( get_term_link($term->term_id) );?>" rel="tag" title="<?php echo esc_attr( $term->name ); ?>"><?php
5
  echo esc_html( $term->name ); ?></a><?php echo ($term !== end($terms)) ? ', ' : '' ?>
6
  <?php
7
  }
templates/events/event-data.php CHANGED
@@ -20,20 +20,20 @@
20
  <tbody>
21
  <?php if (!empty($event_data)): ?>
22
  <?php foreach ($event_data as $data): ?>
23
- <tr data-id="<?php echo $data->id ?>">
24
  <td class="event-column"><?php echo esc_html( get_the_title($data->column_id) ); ?></td>
25
- <td class="event-start"><?php echo date(get_option('time_format'), strtotime($data->event_start)); ?></td>
26
- <td class="event-end"><?php echo date(get_option('time_format'), strtotime($data->event_end)); ?></td>
27
  <td class="event-description"><?php echo wp_kses_post( $data->description ); ?></td>
28
  <td class="event-user-id"><?php
29
  $user = ($data->user_id != '-1') ? get_userdata($data->user_id) : false;
30
  if ($user) {
31
- echo $user->display_name;
32
  } ?>
33
  </td>
34
  <td>
35
- <a class="button icon dashicons-edit edit-event-button" data-id="<?php echo $data->id ?>" title="<?php _e('Edit event in the form below', 'mp-timetable') ?>"></a>
36
- <a class="button icon dashicons-trash delete-event-button" data-id="<?php echo $data->id ?>" title="<?php _e('Delete', 'mp-timetable') ?>"></a>
37
  <span class="spinner left"></span>
38
  </td>
39
  </tr>
20
  <tbody>
21
  <?php if (!empty($event_data)): ?>
22
  <?php foreach ($event_data as $data): ?>
23
+ <tr data-id="<?php echo esc_attr( $data->id );?>">
24
  <td class="event-column"><?php echo esc_html( get_the_title($data->column_id) ); ?></td>
25
+ <td class="event-start"><?php echo esc_html( date(get_option('time_format'), strtotime($data->event_start)) ); ?></td>
26
+ <td class="event-end"><?php echo esc_html( date(get_option('time_format'), strtotime($data->event_end)) ); ?></td>
27
  <td class="event-description"><?php echo wp_kses_post( $data->description ); ?></td>
28
  <td class="event-user-id"><?php
29
  $user = ($data->user_id != '-1') ? get_userdata($data->user_id) : false;
30
  if ($user) {
31
+ echo esc_html( $user->display_name );
32
  } ?>
33
  </td>
34
  <td>
35
+ <a class="button icon dashicons-edit edit-event-button" data-id="<?php echo esc_attr( $data->id );?>" title="<?php _e('Edit event in the form below', 'mp-timetable') ?>"></a>
36
+ <a class="button icon dashicons-trash delete-event-button" data-id="<?php echo esc_attr( $data->id );?>" title="<?php _e('Delete', 'mp-timetable') ?>"></a>
37
  <span class="spinner left"></span>
38
  </td>
39
  </tr>
templates/events/metabox-event-data.php CHANGED
@@ -1,7 +1,7 @@
1
  <input type="hidden" name="<?php echo Mp_Time_Table::get_plugin_name() . '_noncename' ?>" id="eventmeta_noncename" value="<?php echo wp_create_nonce(Mp_Time_Table::get_plugin_path()) ?>"/>
2
  <input type="hidden" name="events[place]" id="eventmeta_place" value=""/>
3
  <input type="hidden" name="events[leading_event]" id="eventmeta_leading_event" value="'.<?php wp_create_nonce(plugin_basename(__FILE__)) ?>.'"/>
4
- <input type="hidden" id="time_format" value="<?php echo $date["time_format"]["am_pm"] === true ? '1' : '0' ?>"/>
5
  <?php
6
 
7
  \mp_timetable\plugin_core\classes\View::get_instance()->render_html('events/event-data', array('event_data' => $event_data), true);
@@ -15,7 +15,7 @@
15
  <?php if (count($columns)) { ?>
16
  <select id="weekday_id" name="events[weekday_id]">
17
  <?php foreach ($columns as $column) { ?>
18
- <option value="<?php echo $column->ID ?>"><?php echo $column->post_title ?></option>
19
  <?php } ?>
20
  </select>
21
  <span class="description"><?php printf(__('Select column or <a target="_blank" href="%s">Add New</a>.', 'mp-timetable'), admin_url('post-new.php?post_type=mp-column') ); ?></span>
1
  <input type="hidden" name="<?php echo Mp_Time_Table::get_plugin_name() . '_noncename' ?>" id="eventmeta_noncename" value="<?php echo wp_create_nonce(Mp_Time_Table::get_plugin_path()) ?>"/>
2
  <input type="hidden" name="events[place]" id="eventmeta_place" value=""/>
3
  <input type="hidden" name="events[leading_event]" id="eventmeta_leading_event" value="'.<?php wp_create_nonce(plugin_basename(__FILE__)) ?>.'"/>
4
+ <input type="hidden" id="time_format" value="<?php echo ( $date["time_format"]["am_pm"] === true ) ? '1' : '0' ?>"/>
5
  <?php
6
 
7
  \mp_timetable\plugin_core\classes\View::get_instance()->render_html('events/event-data', array('event_data' => $event_data), true);
15
  <?php if (count($columns)) { ?>
16
  <select id="weekday_id" name="events[weekday_id]">
17
  <?php foreach ($columns as $column) { ?>
18
+ <option value="<?php echo esc_attr( $column->ID );?>"><?php echo esc_html( $column->post_title );?></option>
19
  <?php } ?>
20
  </select>
21
  <span class="description"><?php printf(__('Select column or <a target="_blank" href="%s">Add New</a>.', 'mp-timetable'), admin_url('post-new.php?post_type=mp-column') ); ?></span>
templates/popup/index.php CHANGED
@@ -6,7 +6,7 @@
6
  <td>
7
  <select multiple="multiple" id="weekday" name="weekday" class="widefat mptt-resize-vertical">
8
  <?php foreach ($data[ 'column' ] as $column): ?>
9
- <option value="<?php echo $column->ID; ?>"><?php echo $column->post_title; ?></option>
10
  <?php endforeach; ?>
11
  </select>
12
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable') ?></p>
@@ -17,7 +17,7 @@
17
  <td>
18
  <select multiple="multiple" id="event" name="event" class="widefat mptt-resize-vertical">
19
  <?php foreach ($data[ 'events' ] as $events): ?>
20
- <option value="<?php echo $events->ID; ?>"><?php echo $events->post_title; ?></option>
21
  <?php endforeach; ?>
22
  </select>
23
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable') ?></p>
@@ -28,7 +28,7 @@
28
  <td>
29
  <select multiple="multiple" id="event_category" name="event_category" class="widefat mptt-resize-vertical">
30
  <?php foreach ($data[ 'category' ] as $category): ?>
31
- <option value="<?php echo $category->term_id; ?>"><?php echo $category->name; ?></option>
32
  <?php endforeach; ?>
33
  </select>
34
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable'); ?></p>
6
  <td>
7
  <select multiple="multiple" id="weekday" name="weekday" class="widefat mptt-resize-vertical">
8
  <?php foreach ($data[ 'column' ] as $column): ?>
9
+ <option value="<?php echo esc_attr( $column->ID ); ?>"><?php echo esc_html( $column->post_title ); ?></option>
10
  <?php endforeach; ?>
11
  </select>
12
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable') ?></p>
17
  <td>
18
  <select multiple="multiple" id="event" name="event" class="widefat mptt-resize-vertical">
19
  <?php foreach ($data[ 'events' ] as $events): ?>
20
+ <option value="<?php echo esc_attr( $events->ID ); ?>"><?php echo esc_html( $events->post_title ); ?></option>
21
  <?php endforeach; ?>
22
  </select>
23
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable') ?></p>
28
  <td>
29
  <select multiple="multiple" id="event_category" name="event_category" class="widefat mptt-resize-vertical">
30
  <?php foreach ($data[ 'category' ] as $category): ?>
31
+ <option value="<?php echo esc_attr( $category->term_id ); ?>"><?php echo esc_html( $category->name ); ?></option>
32
  <?php endforeach; ?>
33
  </select>
34
  <p class="description"><?php _e('Hold the Ctrl or Command key to select/deselect multiple options.', 'mp-timetable'); ?></p>
templates/settings/general.php CHANGED
@@ -10,7 +10,7 @@
10
  <td><label for="template_source"><?php _e('Template Mode', 'mp-timetable'); ?></label></td>
11
  <td>
12
  <?php $theme_mode = !empty($settings['theme_mode']) ? $settings['theme_mode'] : 'theme'; ?>
13
- <select id="theme_mode" name="theme_mode" <?php echo $theme_supports ? ' disabled' : ''; ?>>
14
  <option value="theme" <?php selected($theme_mode, 'theme'); ?>><?php _e('Theme Mode', 'mp-timetable'); ?></option>
15
  <option value="plugin" <?php selected($theme_mode, 'plugin'); ?>><?php _e('Developer Mode', 'mp-timetable'); ?></option>
16
  </select>
10
  <td><label for="template_source"><?php _e('Template Mode', 'mp-timetable'); ?></label></td>
11
  <td>
12
  <?php $theme_mode = !empty($settings['theme_mode']) ? $settings['theme_mode'] : 'theme'; ?>
13
+ <select id="theme_mode" name="theme_mode" <?php echo ( $theme_supports == TRUE ) ? ' disabled' : ''; ?>>
14
  <option value="theme" <?php selected($theme_mode, 'theme'); ?>><?php _e('Theme Mode', 'mp-timetable'); ?></option>
15
  <option value="plugin" <?php selected($theme_mode, 'plugin'); ?>><?php _e('Developer Mode', 'mp-timetable'); ?></option>
16
  </select>
templates/theme/widget-upcoming-view.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php echo $args['before_widget'];
2
 
3
  if (!empty($instance['title'])) {
4
- echo $args['before_title'] . $instance['title'] . $args['after_title'];
5
  }
6
 
7
  do_action('mptt_widget_upcoming_before_content', $events);
@@ -39,7 +39,7 @@ if (!empty($events)): ?>
39
  </a><br/>
40
  <?php } ?>
41
  <span class="post-date">
42
- <?php if ($instance['view_settings'] !== 'today' && $instance['view_settings'] !== 'current'): ?><?php echo get_the_title($event->column_id) ?>
43
  <br/>
44
  <?php endif; ?>
45
  <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
1
  <?php echo $args['before_widget'];
2
 
3
  if (!empty($instance['title'])) {
4
+ echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title'];
5
  }
6
 
7
  do_action('mptt_widget_upcoming_before_content', $events);
39
  </a><br/>
40
  <?php } ?>
41
  <span class="post-date">
42
+ <?php if ($instance['view_settings'] !== 'today' && $instance['view_settings'] !== 'current'): ?><?php echo esc_html( get_the_title($event->column_id) ); ?>
43
  <br/>
44
  <?php endif; ?>
45
  <time datetime="<?php echo esc_attr( $event->event_start ); ?>" class="timeslot-start"><?php
templates/widgets/gallery-list.php CHANGED
@@ -1,15 +1,15 @@
1
  <div class="<?php echo esc_attr( $widget_object->widget_options['classname'] ); ?>">
2
  <p>
3
  <label for="<?php echo esc_attr( $widget_object->get_field_id('title') ); ?>"><?php _e('Title', "mp-timetable") ?></label>
4
- <input class="widefat" id="<?php echo $widget_object->get_field_id('title') ?>"
5
- name="<?php echo $widget_object->get_field_name('title') ?>" type="text"
6
- value="<?php echo $instance['title'] ?>">
7
  </p>
8
  <p>
9
  <label
10
- for="<?php echo $widget_object->get_field_id('view_settings') ?>"><?php _e('Events to display', "mp-timetable") ?></label>
11
- <select class="view_settings widefat" id="<?php echo $widget_object->get_field_id('view_settings') ?>"
12
- name="<?php echo $widget_object->get_field_name('view_settings') ?>">
13
  <option
14
  value="today" <?php echo $instance['view_settings'] === 'today' ? 'selected="selected"' : '' ?> ><?php _e('Today upcoming events', "mp-timetable") ?></option>
15
  <option
@@ -19,28 +19,28 @@
19
  </select>
20
  </p>
21
  <p class="next-days" style="display: <?php echo $instance['view_settings'] === 'all' ? 'block' : 'none' ?> ;">
22
- <label for="<?php echo $widget_object->get_field_id('next_days') ?>">
23
  <?php _e('Input number of days', "mp-timetable") ?>
24
  </label>
25
- <input class="widefat" id="<?php echo $widget_object->get_field_id('next_days') ?>"
26
- name="<?php echo $widget_object->get_field_name('next_days') ?>" type="text"
27
- value="<?php echo $instance['next_days'] ?>">
28
  <?php _n('day', 'days', $instance['next_days'], "mp-timetable") ?>
29
  </p>
30
  <p>
31
  <label class="widget-categories"
32
- for="<?php echo $widget_object->get_field_id('mp_categories') ?>"><?php _e('Event categories. Leave blank to display all.', "mp-timetable") ?></label>
33
- <select class="widefat mptt-resize-vertical" multiple="multiple" id="<?php echo $widget_object->get_field_id('mp_categories') ?>"
34
- name="<?php echo $widget_object->get_field_name('mp_categories') ?>[]">
35
  <?php
36
  if ( !empty($event_categories) ):
37
  foreach ( $event_categories as $category ) :
38
  if ( empty($instance['mp_categories']) ):
39
  $instance['mp_categories'] = array();
40
  endif ?>
41
- <option value="<?php echo $category->term_id ?>"<?php
42
  echo in_array($category->term_id, $instance['mp_categories']) ? 'selected="selected"' : '' ?> ><?php
43
- echo $category->name
44
  ?></option>
45
  <?php endforeach;
46
  endif; ?>
@@ -49,16 +49,16 @@
49
  </p>
50
  <p>
51
  <label
52
- for="<?php echo $widget_object->get_field_id('limit') ?>"><?php _e('Number of events to display', "mp-timetable") ?></label>
53
- <input class="widefat" id="<?php echo $widget_object->get_field_id('limit') ?>"
54
- name="<?php echo $widget_object->get_field_name('limit') ?>" type="text"
55
- value="<?php echo $instance['limit'] ?>">
56
  </p>
57
  <p>
58
  <label
59
- for="<?php echo $widget_object->get_field_id('disable_url') ?>"><?php _e('Disable event link', "mp-timetable") ?></label>
60
- <select class="widefat" id="<?php echo $widget_object->get_field_id('disable_url') ?>"
61
- name="<?php echo $widget_object->get_field_name('disable_url') ?>">
62
  <option
63
  value="0" <?php echo $instance['disable_url'] === '0' ? 'selected="selected"' : '' ?>> <?php _e('No', "mp-timetable") ?> </option>
64
  <option
@@ -67,79 +67,79 @@
67
  </p>
68
  <p>
69
  <label
70
- for="<?php echo $widget_object->get_field_id('custom_url') ?>"><?php _e('Custom link for events', "mp-timetable") ?></label>
71
- <input class="widefat" id="<?php echo $widget_object->get_field_id('custom_url') ?>"
72
- name="<?php echo $widget_object->get_field_name('custom_url') ?>" type="text"
73
- value="<?php echo $instance['custom_url'] ?>">
74
  </p>
75
  <?php if (\mp_timetable\classes\models\Settings::get_instance()->is_plugin_template_mode()): ?>
76
  <p style="margin-bottom:0px;">
77
  <label
78
- for="<?php echo $widget_object->get_field_id('background_color'); ?>"><?php _e('Event background color', "mp-timetable"); ?></label>
79
  </p>
80
  <p class="select-color" style="margin-top:0px;">
81
- <input type="hidden" class="clr-picker" value="<?php echo $instance['background_color']; ?>">
82
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('background_color'); ?>"
83
- name="<?php echo $widget_object->get_field_name('background_color'); ?>" type="text"
84
- value="<?php echo $instance['background_color']; ?>"/>
85
  </p>
86
  <p style="margin-bottom:0px;">
87
  <label
88
- for="<?php echo $widget_object->get_field_id('hover_background_color'); ?>"><?php _e('Event background color on hover', "mp-timetable"); ?></label>
89
  </p>
90
  <p class="select-color" style="margin-top:0px;">
91
- <input type="hidden" class="clr-picker" value="<?php echo $instance['hover_background_color']; ?>">
92
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('hover_background_color'); ?>"
93
- name="<?php echo $widget_object->get_field_name('hover_background_color'); ?>" type="text"
94
- value="<?php echo $instance['hover_background_color']; ?>"/>
95
  </p>
96
  <p style="margin-bottom:0px;">
97
  <label
98
- for="<?php echo $widget_object->get_field_id('text_color'); ?>"><?php _e('Event text color', "mp-timetable"); ?></label>
99
  </p>
100
  <p class="select-color" style="margin-top:0px;">
101
- <input type="hidden" class="clr-picker" value="<?php echo $instance['text_color']; ?>">
102
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('text_color'); ?>"
103
- name="<?php echo $widget_object->get_field_name('text_color'); ?>" type="text"
104
- value="<?php echo $instance['text_color']; ?>"/>
105
  </p>
106
  <p style="margin-bottom:0px;">
107
  <label
108
- for="<?php echo $widget_object->get_field_id('hover_text_color'); ?>"><?php _e('Event text color on hover', "mp-timetable"); ?></label>
109
  </p>
110
  <p class="select-color" style="margin-top:0px;">
111
- <input type="hidden" class="clr-picker" value="<?php echo $instance['hover_text_color']; ?>">
112
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('hover_text_color'); ?>"
113
- name="<?php echo $widget_object->get_field_name('hover_text_color'); ?>" type="text"
114
- value="<?php echo $instance['hover_text_color']; ?>"/>
115
  </p>
116
  <p style="margin-bottom:0px;">
117
  <label
118
- for="<?php echo $widget_object->get_field_id('item_border_color'); ?>"><?php _e('Event border color', "mp-timetable"); ?></label>
119
  </p>
120
  <P class="select-color" style="margin-top:0px;">
121
- <input type="hidden" class="clr-picker" value="<?php echo $instance['item_border_color']; ?>">
122
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('item_border_color'); ?>"
123
- name="<?php echo $widget_object->get_field_name('item_border_color'); ?>" type="text"
124
- value="<?php echo $instance['item_border_color']; ?>"/>
125
  </P>
126
  <p style="margin-bottom:0px;">
127
  <label
128
- for="<?php echo $widget_object->get_field_id('hover_item_border_color'); ?>"><?php _e('Event border color on hover', "mp-timetable"); ?></label>
129
  </p>
130
  <p class="select-color" style="margin-top:0px;">
131
- <input type="hidden" class="clr-picker" value="<?php echo $instance['hover_item_border_color']; ?>">
132
- <input class="regular-text" id="<?php echo $widget_object->get_field_id('hover_item_border_color'); ?>"
133
- name="<?php echo $widget_object->get_field_name('hover_item_border_color'); ?>" type="text"
134
- value="<?php echo $instance['hover_item_border_color']; ?>"/>
135
  </p>
136
  <?php else: ?>
137
- <input type="hidden" name="<?php echo $widget_object->get_field_name('background_color'); ?>" value=""/>
138
- <input type="hidden" name="<?php echo $widget_object->get_field_name('hover_background_color'); ?>" value=""/>
139
- <input type="hidden" name="<?php echo $widget_object->get_field_name('text_color'); ?>" value=""/>
140
- <input type="hidden" name="<?php echo $widget_object->get_field_name('hover_text_color'); ?>" value=""/>
141
- <input type="hidden" name="<?php echo $widget_object->get_field_name('item_border_color'); ?>" value=""/>
142
- <input type="hidden" name="<?php echo $widget_object->get_field_name('hover_item_border_color'); ?>" value=""/>
143
  <?php endif; ?>
144
  </div>
145
  <script type="application/javascript">
@@ -147,8 +147,8 @@
147
  "use strict";
148
  $(document).ready(function() {
149
  Registry._get("Event").initColorPicker('#widgets-right .mptt-container');
150
- Registry._get("Event").displaySettings("<?php echo $widget_object->get_field_id('view_settings') ?>");
151
- Registry._get("Event").timeMode("<?php echo $widget_object->get_field_id('time_settings');?>");
152
  });
153
  })(jQuery);
154
  </script>
1
  <div class="<?php echo esc_attr( $widget_object->widget_options['classname'] ); ?>">
2
  <p>
3
  <label for="<?php echo esc_attr( $widget_object->get_field_id('title') ); ?>"><?php _e('Title', "mp-timetable") ?></label>
4
+ <input class="widefat" id="<?php echo esc_attr( $widget_object->get_field_id('title') );?>"
5
+ name="<?php echo esc_attr( $widget_object->get_field_name('title') );?>" type="text"
6
+ value="<?php echo esc_html( $instance['title'] ); ?>">
7
  </p>
8
  <p>
9
  <label
10
+ for="<?php echo esc_attr( $widget_object->get_field_id('view_settings') );?>"><?php _e('Events to display', "mp-timetable") ?></label>
11
+ <select class="view_settings widefat" id="<?php echo esc_attr( $widget_object->get_field_id('view_settings') );?>"
12
+ name="<?php echo esc_attr( $widget_object->get_field_name('view_settings') );?>">
13
  <option
14
  value="today" <?php echo $instance['view_settings'] === 'today' ? 'selected="selected"' : '' ?> ><?php _e('Today upcoming events', "mp-timetable") ?></option>
15
  <option
19
  </select>
20
  </p>
21
  <p class="next-days" style="display: <?php echo $instance['view_settings'] === 'all' ? 'block' : 'none' ?> ;">
22
+ <label for="<?php echo esc_attr( $widget_object->get_field_id('next_days') );?>">
23
  <?php _e('Input number of days', "mp-timetable") ?>
24
  </label>
25
+ <input class="widefat" id="<?php echo esc_attr( $widget_object->get_field_id('next_days') );?>"
26
+ name="<?php echo esc_attr( $widget_object->get_field_name('next_days') );?>" type="text"
27
+ value="<?php echo esc_html( $instance['next_days'] ); ?>">
28
  <?php _n('day', 'days', $instance['next_days'], "mp-timetable") ?>
29
  </p>
30
  <p>
31
  <label class="widget-categories"
32
+ for="<?php echo esc_attr( $widget_object->get_field_id('mp_categories') );?>"><?php _e('Event categories. Leave blank to display all.', "mp-timetable") ?></label>
33
+ <select class="widefat mptt-resize-vertical" multiple="multiple" id="<?php echo esc_attr( $widget_object->get_field_id('mp_categories') );?>"
34
+ name="<?php echo esc_attr( $widget_object->get_field_name('mp_categories') );?>[]">
35
  <?php
36
  if ( !empty($event_categories) ):
37
  foreach ( $event_categories as $category ) :
38
  if ( empty($instance['mp_categories']) ):
39
  $instance['mp_categories'] = array();
40
  endif ?>
41
+ <option value="<?php echo esc_attr( $category->term_id );?>"<?php
42
  echo in_array($category->term_id, $instance['mp_categories']) ? 'selected="selected"' : '' ?> ><?php
43
+ echo esc_html( $category->name );
44
  ?></option>
45
  <?php endforeach;
46
  endif; ?>
49
  </p>
50
  <p>
51
  <label
52
+ for="<?php echo esc_attr( $widget_object->get_field_id('limit') );?>"><?php _e('Number of events to display', "mp-timetable") ?></label>
53
+ <input class="widefat" id="<?php echo esc_attr( $widget_object->get_field_id('limit') );?>"
54
+ name="<?php echo esc_attr( $widget_object->get_field_name('limit') );?>" type="text"
55
+ value="<?php echo esc_html( $instance['limit'] ); ?>">
56
  </p>
57
  <p>
58
  <label
59
+ for="<?php echo esc_attr( $widget_object->get_field_id('disable_url') );?>"><?php _e('Disable event link', "mp-timetable") ?></label>
60
+ <select class="widefat" id="<?php echo esc_attr( $widget_object->get_field_id('disable_url') );?>"
61
+ name="<?php echo esc_attr( $widget_object->get_field_name('disable_url') );?>">
62
  <option
63
  value="0" <?php echo $instance['disable_url'] === '0' ? 'selected="selected"' : '' ?>> <?php _e('No', "mp-timetable") ?> </option>
64
  <option
67
  </p>
68
  <p>
69
  <label
70
+ for="<?php echo esc_attr( $widget_object->get_field_id('custom_url') );?>"><?php _e('Custom link for events', "mp-timetable") ?></label>
71
+ <input class="widefat" id="<?php echo esc_attr( $widget_object->get_field_id('custom_url') );?>"
72
+ name="<?php echo esc_attr( $widget_object->get_field_name('custom_url') );?>" type="text"
73
+ value="<?php echo esc_url( $instance['custom_url'] );?>">
74
  </p>
75
  <?php if (\mp_timetable\classes\models\Settings::get_instance()->is_plugin_template_mode()): ?>
76
  <p style="margin-bottom:0px;">
77
  <label
78
+ for="<?php echo esc_attr( $widget_object->get_field_id('background_color') ); ?>"><?php _e('Event background color', "mp-timetable"); ?></label>
79
  </p>
80
  <p class="select-color" style="margin-top:0px;">
81
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['background_color'] ); ?>">
82
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('background_color') ); ?>"
83
+ name="<?php echo esc_attr( $widget_object->get_field_name('background_color') ); ?>" type="text"
84
+ value="<?php echo esc_attr( $instance['background_color'] ); ?>"/>
85
  </p>
86
  <p style="margin-bottom:0px;">
87
  <label
88
+ for="<?php echo esc_attr( $widget_object->get_field_id('hover_background_color') ); ?>"><?php _e('Event background color on hover', "mp-timetable"); ?></label>
89
  </p>
90
  <p class="select-color" style="margin-top:0px;">
91
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['hover_background_color'] ); ?>">
92
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('hover_background_color') ); ?>"
93
+ name="<?php echo esc_attr( $widget_object->get_field_name('hover_background_color') ); ?>" type="text"
94
+ value="<?php echo esc_attr( $instance['hover_background_color'] ); ?>"/>
95
  </p>
96
  <p style="margin-bottom:0px;">
97
  <label
98
+ for="<?php echo esc_attr( $widget_object->get_field_id('text_color') ); ?>"><?php _e('Event text color', "mp-timetable"); ?></label>
99
  </p>
100
  <p class="select-color" style="margin-top:0px;">
101
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['text_color'] ); ?>">
102
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('text_color') ); ?>"
103
+ name="<?php echo esc_attr( $widget_object->get_field_name('text_color') ); ?>" type="text"
104
+ value="<?php echo esc_attr( $instance['text_color'] ); ?>"/>
105
  </p>
106
  <p style="margin-bottom:0px;">
107
  <label
108
+ for="<?php echo esc_attr( $widget_object->get_field_id('hover_text_color') ); ?>"><?php _e('Event text color on hover', "mp-timetable"); ?></label>
109
  </p>
110
  <p class="select-color" style="margin-top:0px;">
111
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['hover_text_color'] ); ?>">
112
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('hover_text_color') ); ?>"
113
+ name="<?php echo esc_attr( $widget_object->get_field_name('hover_text_color') ); ?>" type="text"
114
+ value="<?php echo esc_attr( $instance['hover_text_color'] ); ?>"/>
115
  </p>
116
  <p style="margin-bottom:0px;">
117
  <label
118
+ for="<?php echo esc_attr( $widget_object->get_field_id('item_border_color') ); ?>"><?php _e('Event border color', "mp-timetable"); ?></label>
119
  </p>
120
  <P class="select-color" style="margin-top:0px;">
121
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['item_border_color'] ); ?>">
122
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('item_border_color') ); ?>"
123
+ name="<?php echo esc_attr( $widget_object->get_field_name('item_border_color') ); ?>" type="text"
124
+ value="<?php echo esc_attr( $instance['item_border_color'] ); ?>"/>
125
  </P>
126
  <p style="margin-bottom:0px;">
127
  <label
128
+ for="<?php echo esc_attr( $widget_object->get_field_id('hover_item_border_color') ); ?>"><?php _e('Event border color on hover', "mp-timetable"); ?></label>
129
  </p>
130
  <p class="select-color" style="margin-top:0px;">
131
+ <input type="hidden" class="clr-picker" value="<?php echo esc_attr( $instance['hover_item_border_color'] ); ?>">
132
+ <input class="regular-text" id="<?php echo esc_attr( $widget_object->get_field_id('hover_item_border_color') ); ?>"
133
+ name="<?php echo esc_attr( $widget_object->get_field_name('hover_item_border_color') ); ?>" type="text"
134
+ value="<?php echo esc_attr( $instance['hover_item_border_color'] ); ?>"/>
135
  </p>
136
  <?php else: ?>
137
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('background_color') ); ?>" value=""/>
138
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('hover_background_color') ); ?>" value=""/>
139
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('text_color') ); ?>" value=""/>
140
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('hover_text_color') ); ?>" value=""/>
141
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('item_border_color') ); ?>" value=""/>
142
+ <input type="hidden" name="<?php echo esc_attr( $widget_object->get_field_name('hover_item_border_color') ); ?>" value=""/>
143
  <?php endif; ?>
144
  </div>
145
  <script type="application/javascript">
147
  "use strict";
148
  $(document).ready(function() {
149
  Registry._get("Event").initColorPicker('#widgets-right .mptt-container');
150
+ Registry._get("Event").displaySettings("<?php echo esc_attr( $widget_object->get_field_id('view_settings') ); ?>");
151
+ Registry._get("Event").timeMode("<?php echo esc_attr( $widget_object->get_field_id('time_settings') ); ?>");
152
  });
153
  })(jQuery);
154
  </script>
templates/widgets/widget-view.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  <?php use mp_timetable\classes\models\Events as Events;
4
 
5
- if (!empty($instance['title'])) {
6
- echo $args['before_title'] . $instance['title'] . $args['after_title'];
7
  }
8
 
9
  do_action('mptt_widget_template_before_content', $events);
@@ -51,12 +51,12 @@ if (!empty($events)): ?>
51
  data-border-color="<?php echo esc_attr( $instance['item_border_color'] ); ?>"
52
  data-hover-border-color="<?php echo esc_attr( $instance['hover_item_border_color'] ); ?>"
53
  <?php
54
- $style .= !empty($instance['item_border_color']) ? ' border-left-color:' . $instance['item_border_color'] . ' ;' : '';
55
- $style .= !empty($background_color) ? ' background:' . $background_color . ' ;' : '';
56
- $style .= !empty($color) ? ' color:' . $color . ' ;' : '';
57
 
58
  else:
59
- $style .= !empty($event->post->color) ? ' border-left-color:' . $event->post->color . ' ;' : '';
60
  endif;
61
 
62
  echo $style . '"';
2
 
3
  <?php use mp_timetable\classes\models\Events as Events;
4
 
5
+ if ( !empty($instance['title']) ) {
6
+ echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title'];
7
  }
8
 
9
  do_action('mptt_widget_template_before_content', $events);
51
  data-border-color="<?php echo esc_attr( $instance['item_border_color'] ); ?>"
52
  data-hover-border-color="<?php echo esc_attr( $instance['hover_item_border_color'] ); ?>"
53
  <?php
54
+ $style .= !empty($instance['item_border_color']) ? ' border-left-color:' . esc_attr( $instance['item_border_color'] ) . ' ;' : '';
55
+ $style .= !empty($background_color) ? ' background:' . esc_attr( $background_color ) . ' ;' : '';
56
+ $style .= !empty($color) ? ' color:' . esc_attr( $color ) . ' ;' : '';
57
 
58
  else:
59
+ $style .= !empty($event->post->color) ? ' border-left-color:' . esc_attr( $event->post->color ) . ' ;' : '';
60
  endif;
61
 
62
  echo $style . '"';