Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions includes/abstracts/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,25 +664,15 @@ public function set_start($timestamp = 0)
} elseif ('this_month' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)->startOfMonth();
} elseif ('months_before' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)
->subMonths($nth)
->startOfMonth();
$start_dt = Carbon::today($this->timezone)->subMonths($nth)->startOfMonth();
} elseif ('months_after' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)
->addMonths($nth)
->startOfMonth();
$start_dt = Carbon::today($this->timezone)->addMonths($nth)->startOfMonth();
} elseif ('this_year' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)
->startOfYear()
->addHour();
$start_dt = Carbon::today($this->timezone)->startOfYear()->addHour();
} elseif ('years_before' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)
->subYears($nth)
->startOfYear();
$start_dt = Carbon::today($this->timezone)->subYears($nth)->startOfYear();
} elseif ('years_after' == $calendar_begins) {
$start_dt = Carbon::today($this->timezone)
->addYears($nth)
->startOfYear();
$start_dt = Carbon::today($this->timezone)->addYears($nth)->startOfYear();
} elseif ('custom_date' == $calendar_begins) {
if ($date = get_post_meta($this->id, '_calendar_begins_custom_date', true)) {
$start_dt = Carbon::createFromFormat('Y-m-d', esc_attr($date), $this->timezone)
Expand Down Expand Up @@ -847,8 +837,8 @@ public function html($view = '')
$calendar_class = trim(
implode(
' simcal-',
apply_filters('simcal_calendar_class', ['simcal-calendar', $this->type, $view_class], $this->id)
)
apply_filters('simcal_calendar_class', ['simcal-calendar', $this->type, $view_class], $this->id),
),
);

echo '<div class="' .
Expand Down Expand Up @@ -896,7 +886,7 @@ public function html($view = '')
'">' .
sprintf(
__('Powered by <a href="%s" target="_blank">Simple Calendar</a>', 'google-calendar-events'),
simcal_get_url('home')
simcal_get_url('home'),
) .
'</small>';
}
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function manage_add_on_license()
// Check for user capabilities.
if (!current_user_can('edit_posts')) {
wp_send_json_error(
sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.')
sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.'),
);
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public function manage_add_on_license()
'timeout' => 15,
'sslverify' => false,
'body' => $api_request,
]
],
);

// Update license in db.
Expand All @@ -152,8 +152,8 @@ public function manage_add_on_license()
wp_send_json_error(
sprintf(
__('There was an error processing your request: %s', 'google-calendar-events'),
$response->get_error_message()
)
$response->get_error_message(),
),
);
}

Expand Down Expand Up @@ -197,7 +197,7 @@ public function reset_licenses()
// Check for user capabilities.
if (!current_user_can('edit_posts')) {
wp_send_json_error(
sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.')
sprintf(__('An error occurred: %s', 'google-calendar-events'), 'You don\'t have permission to make changes.'),
);
}
delete_option('simple-calendar_settings_licenses');
Expand Down
12 changes: 6 additions & 6 deletions includes/admin/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,29 @@ public function load()
$js_path_vendor . 'jquery.tipTip.minified.js',
['jquery'],
SIMPLE_CALENDAR_VERSION,
true
true,
);
wp_register_script('simcal-select2', $js_path_vendor . 'select2.min.js', [], SIMPLE_CALENDAR_VERSION, true);
wp_register_script(
'simcal-admin',
$js_path . 'admin.min.js',
['jquery', 'jquery-ui-sortable', 'jquery-ui-datepicker', 'wp-color-picker', 'simcal-tiptip', 'simcal-select2'],
SIMPLE_CALENDAR_VERSION,
true
true,
);
wp_register_script(
'simcal-admin-add-calendar',
$js_path . 'admin-add-calendar.min.js',
['simcal-select2'],
SIMPLE_CALENDAR_VERSION,
true
true,
);
wp_register_script(
'simcal-oauth-helper-admin',
$js_path . 'oauth-helper-admin.min.js',
['jquery'],
SIMPLE_CALENDAR_VERSION,
true
true,
);

if (class_exists('SimpleCalendar\Feeds\Google_Pro') && $this->current_page === 'simple-calendar_settings') {
Expand All @@ -100,13 +100,13 @@ public function load()
'simcal-admin',
$css_path . 'admin.min.css',
['wp-color-picker', 'simcal-select2'],
SIMPLE_CALENDAR_VERSION
SIMPLE_CALENDAR_VERSION,
);
wp_register_style(
'simcal-admin-add-calendar',
$css_path . 'admin-add-calendar.min.css',
['simcal-select2'],
SIMPLE_CALENDAR_VERSION
SIMPLE_CALENDAR_VERSION,
);

if (simcal_is_admin_screen() !== false) {
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/bulk-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function custom_bulk_action()
'bulk_edit',
'post_view',
],
$sendback
$sendback,
);

wp_redirect($sendback);
Expand Down Expand Up @@ -220,7 +220,7 @@ public function custom_bulk_admin_notices()
if (is_array($message)) {
$message = sprintf(
_n($message['single'], $message['plural'], $post_ids_count, 'google-calendar-events'),
$post_ids_count
$post_ids_count,
);
}

Expand Down
34 changes: 17 additions & 17 deletions includes/admin/fields/datetime-format.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ private function weekday()
<option value="" data-preview=""></option>
<option value="D" <?php selected('D', strpbrk('D', $this->value)); ?> data-preview="<?php echo date_i18n(
'D',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date_i18n('D', $this->timestamp); ?></option>
<option value="l" <?php selected('l', strpbrk('l', $this->value)); ?> data-preview="<?php echo date_i18n(
'l',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date_i18n('l', $this->timestamp); ?></option>
</select>
</label>
Expand All @@ -227,11 +227,11 @@ private function day()
<option value="" data-preview=""></option>
<option value="j" <?php selected('j', strpbrk('j', $this->value)); ?> data-preview="<?php echo date(
'j',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('j', $this->timestamp); ?></option>
<option value="d" <?php selected('d', strpbrk('d', $this->value)); ?> data-preview="<?php echo date(
'd',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('d', $this->timestamp); ?></option>
</select>
</label>
Expand All @@ -255,19 +255,19 @@ private function month()
<option value="" data-preview=""></option>
<option value="F" <?php selected('F', strpbrk('F', $this->value)); ?> data-preview="<?php echo date_i18n(
'F',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date_i18n('F', $this->timestamp); ?></option>
<option value="M" <?php selected('M', strpbrk('M', $this->value)); ?> data-preview="<?php echo date_i18n(
'M',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date_i18n('M', $this->timestamp); ?></option>
<option value="m" <?php selected('m', strpbrk('m', $this->value)); ?> data-preview="<?php echo date(
'm',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('m', $this->timestamp); ?></option>
<option value="n" <?php selected('n', strpbrk('n', $this->value)); ?> data-preview="<?php echo date(
'n',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('n', $this->timestamp); ?></option>
</select>
</label>
Expand All @@ -291,11 +291,11 @@ private function year()
<option value="" data-preview=""></option>
<option value="Y" <?php selected('Y', strpbrk('Y', $this->value)); ?> data-preview="<?php echo date(
'Y',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('Y', $this->timestamp); ?></option>
<option value="y" <?php selected('y', strpbrk('y', $this->value)); ?> data-preview="<?php echo date(
'y',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('y', $this->timestamp); ?></option>
</select>
</label>
Expand All @@ -319,19 +319,19 @@ private function hours()
<option value="" data-preview=""></option>
<option value="g" <?php selected('g', strpbrk('g', $this->value)); ?> data-preview="<?php echo date(
'g',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('g', $this->timestamp) . ' (12h)'; ?></option>
<option value="G" <?php selected('G', strpbrk('G', $this->value)); ?> data-preview="<?php echo date(
'G',
$this->timestamp - 43200
$this->timestamp - 43200,
); ?>"><?php echo date('G', $this->timestamp - 43200) . ' (24h)'; ?></option>
<option value="h" <?php selected('h', strpbrk('h', $this->value)); ?> data-preview="<?php echo date(
'h',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('h', $this->timestamp) . ' (12h)'; ?></option>
<option value="H" <?php selected('H', strpbrk('H', $this->value)); ?> data-preview="<?php echo date(
'H',
$this->timestamp - 43200
$this->timestamp - 43200,
); ?>"><?php echo date('H', $this->timestamp - 43200) . ' (24h)'; ?></option>
</select>
</label>
Expand All @@ -355,7 +355,7 @@ private function minutes()
<option value="" data-preview=""></option>
<option value="i" <?php selected('i', strpbrk('i', $this->value)); ?> data-preview="<?php echo date(
'i',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('i', $this->timestamp); ?></option>
</select>
</label>
Expand All @@ -379,11 +379,11 @@ private function meridiem()
<option value="" data-preview=""></option>
<option value="a" <?php selected('a', strpbrk('a', $this->value)); ?> data-preview="<?php echo date(
'a',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('a', $this->timestamp); ?></option>
<option value="A" <?php selected('A', strpbrk('A', $this->value)); ?> data-preview="<?php echo date(
'A',
$this->timestamp
$this->timestamp,
); ?>"><?php echo date('A', $this->timestamp); ?></option>
</select>
</label>
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/fields/license.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ class="<?php echo $this->class; ?>" />
<button class="button-secondary button-primary simcal-addon-manage-license deactivate" data-add-on="<?php echo $this->addon; ?>" style="<?php echo $display_deactivate; ?>">
<i class="simcal-icon-spinner simcal-icon-spin" style="display: none; "></i><?php _e(
'Deactivate',
'google-calendar-events'
'google-calendar-events',
); ?>
</button>

<button class="button-secondary button-primary simcal-addon-manage-license activate" data-add-on="<?php echo $this->addon; ?>" style="<?php echo $display_activate; ?>">
<i class="simcal-icon-spinner simcal-icon-spin" style="display: none; border: unset;"></i><?php _e(
'Activate',
'google-calendar-events'
'google-calendar-events',
); ?>
</button>

<span class="error sc-error-notice" style="color: red; display: none; vertical-align: sub;"> </span>

<strong class="label" style="color:green; <?php echo $active; ?>"> <?php _e(
'(active)',
'google-calendar-events'
'google-calendar-events',
); ?></strong>

</div>
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function add_menu_items()
function () {
$page = new Pages('settings');
$page->html();
}
},
);

add_submenu_page(
Expand All @@ -85,7 +85,7 @@ function () {
function () {
$page = new Pages('add-ons');
$page->html();
}
},
);

add_submenu_page(
Expand All @@ -97,7 +97,7 @@ function () {
function () {
$page = new Pages('tools');
$page->html();
}
},
);

do_action('simcal_admin_add_menu_items');
Expand Down Expand Up @@ -184,12 +184,12 @@ public function admin_footer_text($footer_text)
$footer_text = sprintf(
__(
'If you like <strong>Simple Calendar</strong> please leave us a %s&#9733;&#9733;&#9733;&#9733;&#9733; rating on WordPress.org%s. A huge thank you in advance!',
'google-calendar-events'
'google-calendar-events',
),
'<a href="https://wordpress.org/support/view/plugin-reviews/google-calendar-events?filter=5#postform" target="_blank" class="simcal-rating-link" data-rated="' .
esc_attr__('Thanks :)', 'google-calendar-events') .
'">',
'</a>'
'</a>',
);
// Add a nonce field used in ajax.
$footer_text .= wp_nonce_field('simcal_rating_nonce', 'simcal_rating_nonce');
Expand Down
8 changes: 4 additions & 4 deletions includes/admin/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function add_meta_boxes()
'\SimpleCalendar\Admin\Metaboxes\Settings::html',
'calendar',
'normal',
'core'
'core',
);

$addons = apply_filters('simcal_installed_addons', []);
Expand All @@ -96,7 +96,7 @@ public function add_meta_boxes()
'\SimpleCalendar\Admin\Metaboxes\Upgrade_To_Premium::html',
'calendar',
'side',
'default'
'default',
);

// Removing coupon code + mailing list sign-up for now. 9/26/16
Expand All @@ -118,7 +118,7 @@ public function add_meta_boxes()
'\SimpleCalendar\Admin\Metaboxes\Get_Shortcode::html',
'calendar',
'side',
'default'
'default',
);

// Add meta box if there are calendars.
Expand All @@ -130,7 +130,7 @@ public function add_meta_boxes()
'\SimpleCalendar\Admin\Metaboxes\Attach_Calendar::html',
$post_type,
'side',
'low'
'low',
);
}
}
Expand Down
Loading
Loading