Skip to content

Commit

Permalink
Merge pull request #41 from shashachu/5.9.10-upgrade
Browse files Browse the repository at this point in the history
EM 5.9.10 upgrade
  • Loading branch information
shashachu authored May 2, 2024
2 parents 754b381 + 541616b commit d90e1ea
Show file tree
Hide file tree
Showing 45 changed files with 479 additions and 209 deletions.
53 changes: 36 additions & 17 deletions admin/em-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,25 +256,44 @@ function em_updates_check( $transient ) {

//only bother if we're checking for dev versions
if( get_option('em_check_dev_version') || get_option('dbem_pro_dev_updates') ){
//check WP repo for trunk version
$request = wp_remote_get('https://plugins.svn.wordpress.org/events-manager/trunk/events-manager.php');

if( !is_wp_error($request) ){
preg_match('/Version: ([0-9a-z\.]+)/', $request['body'], $matches);

if( !empty($matches[1]) ){
//we have a version number!
if( version_compare($transient->checked[EM_SLUG], $matches[1]) < 0) {
$response = new stdClass();
$response->slug = EM_SLUG;
$response->new_version = $matches[1] ;
$response->url = 'http://wordpress.org/extend/plugins/events-manager/';
$response->package = 'http://downloads.wordpress.org/plugin/events-manager.zip';
$transient->response[EM_SLUG] = $response;
//check WP repo for trunk version, other EM-related plugins on .org can hook here to make the best of our admin setting option
$plugins = apply_filters('em_org_dev_versions', array(
'events-manager'=> array(
'slug' => EM_SLUG,
'version' => EM_VERSION
)
));
foreach( $plugins as $org_slug => $plugin_info ) {
$request = wp_remote_get('https://plugins.svn.wordpress.org/'.$org_slug.'/trunk/'.$org_slug.'.php');
$wp_slug = $plugin_info['slug'];
if( empty($transient->checked[$wp_slug]) ){
$transient->checked[$wp_slug] = !empty($plugin_info['version']) ? $plugin_info['version'] : 0;
}
if (!is_wp_error($request)) {
preg_match('/Version: ([0-9a-z\.]+)/', $request['body'], $matches);

if (!empty($matches[1])) {
//we have a version number!
$response = new stdClass();
$response->slug = $wp_slug;
$response->new_version = $matches[1];
$response->url = 'http://wordpress.org/extend/plugins/'.$org_slug.'/';
$response->package = 'http://downloads.wordpress.org/plugin/'.$org_slug.'.zip';
$icon_test = wp_remote_get('https://ps.w.org/'.$org_slug.'/assets/icon-128x128.png');
if( !is_wp_error($icon_test) && $icon_test['response']['code'] == 200 ){
$response->icons = array(
'1x' => 'https://ps.w.org/'.$org_slug.'/assets/icon-128x128.png',
'2x' => 'https://ps.w.org/'.$org_slug.'/assets/icon-256x256.png'
);
}
if ( version_compare($transient->checked[$wp_slug], $matches[1]) < 0) {
$transient->response[$wp_slug] = $response;
}else{
$transient->no_update[$wp_slug] = $response;
}
}
}
}

}
delete_option('em_check_dev_version');
}

Expand Down
14 changes: 8 additions & 6 deletions admin/em-bookings.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ function em_bookings_single(){
<?php
return false;
}
do_action('em_booking_admin', $EM_Booking);
?>
<div class='wrap' id="em-bookings-admin-booking">
<?php if( is_admin() ): ?><h1><?php else: ?><h2><?php endif; ?>
Expand Down Expand Up @@ -239,11 +240,11 @@ function em_bookings_single(){
</form>
<script type="text/javascript">
jQuery(document).ready( function($){
$('#em-booking-person-modify').click(function(){
$('#em-booking-person-modify').on('click', function(){
$('.em-booking-person-details').hide();
$('.em-booking-person-editor').show();
});
$('#em-booking-person-modify-cancel').click(function(){
$('#em-booking-person-modify-cancel').on('click', function(){
$('.em-booking-person-details').show();
$('.em-booking-person-editor').hide();
});
Expand Down Expand Up @@ -424,29 +425,30 @@ function em_bookings_single(){
</form>
<script type="text/javascript">
jQuery(document).ready( function($){
$('#em-booking-submit-modify').click(function(){
$('#em-booking-submit-modify').on('click', function(){
$('.em-booking-single-info').hide();
$('.em-booking-single-edit').show();
});
$('#em-booking-submit-cancel').click(function(){
$('#em-booking-submit-cancel').on('click', function(){
$('.em-booking-single-info').show();
$('.em-booking-single-edit').hide();
});
$('.em-booking-single-info').show();
$('.em-booking-single-edit').hide();

$('#em-booking-submit-status-modify').click(function(){
$('#em-booking-submit-status-modify').on('click', function(){
$('.em-booking-single-status-info').hide();
$('.em-booking-single-status-edit').show();
});
$('#em-booking-submit-status-cancel').click(function(){
$('#em-booking-submit-status-cancel').on('click', function(){
$('.em-booking-single-status-info').show();
$('.em-booking-single-status-edit').hide();
});
$('.em-booking-single-status-info').show();
$('.em-booking-single-status-edit').hide();
});
</script>
<?php do_action('em_bookings_single_details_footer', $EM_Booking); ?>
</div>
</div>
<div id="em-booking-notes" class="postbox">
Expand Down
2 changes: 1 addition & 1 deletion admin/em-docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function em_docs_init($force_init = false){
'desc' => 'These placeholders will only show if bookings are enabled for the given event and in the events manager settings page. Spaces placeholders will default to 0',
'placeholders' => array(
'#_BOOKINGFORM' => array( 'desc' => 'Adds a booking forms for this event.' ),
'#_BOOKINGBUTTON' => array( 'desc' => 'A single button that will appear to logged in users, if they click on it, they apply for a booking. This button will only display if there is one ticket.' ),
'#_BOOKINGBUTTON' => array( 'desc' => 'A single button that will appear to logged in users, if they click on it a booking will be made. This button will automatically book the first aailable ticket if more than one ticket exists for the event, and will also circumvent any payment requirements. Use in combination with conditional placeholders such as is_free to avoid unpaid bookings.' ),
'#_AVAILABLESPACES' => array( 'desc' => 'Shows available spaces for the event.' ),
'#_BOOKEDSPACES' => array( 'desc' => 'Shows the amount of currently booked spaces for the event.' ),
'#_PENDINGSPACES' => array( 'desc' => 'Shows the amount of pending spaces for the event.' ),
Expand Down
12 changes: 6 additions & 6 deletions admin/em-ms-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,46 +84,46 @@ function em_ms_admin_options_page() {
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){
//events
$('input[name="dbem_ms_global_events"]').change(function(){
$('input[name="dbem_ms_global_events"]').on('change', function(){
if( $('input:radio[name="dbem_ms_global_events"]:checked').val() == 1 ){
$("tr#dbem_ms_global_events_links_row").show();
$('input:radio[name="dbem_ms_global_events_links"]:checked').trigger('change');
}else{
$("tr#dbem_ms_global_events_links_row, tr#dbem_ms_events_slug_row").hide();
}
}).first().trigger('change');
$('input[name="dbem_ms_global_events_links"]').change(function(){
$('input[name="dbem_ms_global_events_links"]').on('change', function(){
if( $('input:radio[name="dbem_ms_global_events_links"]:checked').val() == 1 ){
$("tr#dbem_ms_events_slug_row").hide();
}else{
$("tr#dbem_ms_events_slug_row").show();
}
}).first().trigger('change');
//locations
$('input[name="dbem_ms_mainblog_locations"]').change(function(){
$('input[name="dbem_ms_mainblog_locations"]').on('change', function(){
if( $('input:radio[name="dbem_ms_mainblog_locations"]:checked').val() == 1 ){
$("tbody.em-global-locations").hide();
}else{
$("tbody.em-global-locations").show();
}
}).first().trigger('change');
$('input[name="dbem_ms_global_locations"]').change(function(){
$('input[name="dbem_ms_global_locations"]').on('change', function(){
if( $('input:radio[name="dbem_ms_global_locations"]:checked').val() == 1 ){
$("tr#dbem_ms_global_locations_links_row").show();
$('input:radio[name="dbem_ms_global_locations_links"]:checked').trigger('change');
}else{
$("tr#dbem_ms_global_locations_links_row, tr#dbem_ms_locations_slug_row").hide();
}
}).first().trigger('change');
$('input[name="dbem_ms_global_locations_links"]').change(function(){
$('input[name="dbem_ms_global_locations_links"]').on('change', function(){
if( $('input:radio[name="dbem_ms_global_locations_links"]:checked').val() == 1 ){
$("tr#dbem_ms_locations_slug_row").hide();
}else{
$("tr#dbem_ms_locations_slug_row").show();
}
});
//MS Mode selection hiders
$('input[name="dbem_ms_global_table"]').change(function(){ //global
$('input[name="dbem_ms_global_table"]').on('change', function(){ //global
if( $('input:radio[name="dbem_ms_global_table"]:checked').val() == 1 ){
$("tbody.em-global-options").show();
$('input:radio[name="dbem_ms_mainblog_locations"]:checked').trigger('change');
Expand Down
10 changes: 5 additions & 5 deletions admin/em-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,15 @@ function em_admin_option_box_email(){
</table>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){
$('#dbem_rsvp_mail_send_method_row select').change(function(){
$('#dbem_rsvp_mail_send_method_row select').on('change', function(){
el = $(this);
if( el.find(':selected').val() == 'smtp' ){
$('.em-email-settings-smtp').show();
}else{
$('.em-email-settings-smtp').hide();
}
}).trigger('change');
$('input#em-admin-check-email').click(function(e,el){
$('input#em-admin-check-email').on('click', function(e,el){
var email_data = $('.em-email-form input, .em-email-form select').serialize();
$.ajax({
url: EM.ajaxurl,
Expand Down Expand Up @@ -837,7 +837,7 @@ function em_admin_option_box_uninstall(){
</td>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){
$('a#em-admin-import-settings').click(function(e,el){
$('a#em-admin-import-settings').on('click', function(e,el){
var thisform = $(this).closest('form');
thisform.find('input[type=text], textarea, select, input[type=radio], input[type=hidden]').prop('disabled', true);
thisform.find('input[name=_wpnonce]').val('<?php echo esc_attr($import_nonce); ?>').prop('disabled', false);
Expand Down Expand Up @@ -931,14 +931,14 @@ function em_admin_option_box_uninstall(){
</td>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){
$('select[name="timezone_reset_value"]').change( function( e ){
$('select[name="timezone_reset_value"]').on('change', function( e ){
if( $(this).val() == '' ){
$('a#em-reset-event-timezones').css({opacity:0.5, cursor:'default'});
}else{
$('a#em-reset-event-timezones').css({opacity:1, cursor:'pointer'});
}
}).trigger('change');
$('a#em-reset-event-timezones').click(function(e,el){
$('a#em-reset-event-timezones').on('click', function(e,el){
if( $('select[name="timezone_reset_value"]').val() == '' ) return false;
var thisform = $(this).closest('form');
thisform.find('input, textarea, select').prop('disabled', true);
Expand Down
4 changes: 2 additions & 2 deletions admin/settings/tabs/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@
</table>
<script type="text/javascript">
jQuery(document).ready(function($){
$('input:radio[name="dbem_js_limit"]').change(function(){
$('input:radio[name="dbem_js_limit"]').on('change', function(){
if( $('input:radio[name="dbem_js_limit"]:checked').val() == 1 ){
$('tbody#dbem-js-limit-options').show();
}else{
$('tbody#dbem-js-limit-options').hide();
}
}).trigger('change');

$('input:radio[name="dbem_css_limit"]').change(function(){
$('input:radio[name="dbem_css_limit"]').on('change', function(){
if( $('input:radio[name="dbem_css_limit"]:checked').val() == 1 ){
$('tbody#dbem-css-limit-options').show();
}else{
Expand Down
2 changes: 1 addition & 1 deletion admin/settings/wpfc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function wpfc_em_install(){
//check for updates - try adding one option, if it works then it's a first time install so add more
if( current_user_can('manage_options') && get_option('dbem_emfc_full_calendar_event_format', false) ){
add_option('dbem_emfc_full_calendar_event_format','#_EVENTTIMES - #_EVENTNAME');
add_option('dbem_emfc_qtips_format', '{has_image}<div style="float:left; margin:0px 5px 5px 0px;">#_EVENTIMAGE{75,75}</div>{/has_image}#_EVENTEXCERPT');
add_option('dbem_emfc_qtips_format', '{has_image}<div style="float:left; margin:5px 10px 5px 0px;">#_EVENTIMAGE{75,75}</div>{/has_image}#_EVENTEXCERPT');
}
}
add_action('init', 'wpfc_em_install');
4 changes: 3 additions & 1 deletion classes/em-admin-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class EM_Admin_Notice {
*/
public $network = false;

public function __construct( $key, $type = false, $message = false ){
public function __construct( $key, $type = false, $message = false, $where = false ){
//process the supplied data
if( empty($message) ){
if( empty($type) && is_array($key) ){
Expand All @@ -79,6 +79,8 @@ public function __construct( $key, $type = false, $message = false ){
foreach( $notice as $key => $value ){
$this->$key = $value;
}
//add where if defined
if( !empty($where) ) $this->where = $where;
//call a hook
do_action('em_admin_notice_'.$this->name, $this);
if( !is_multisite() && $this->where == 'network_admin' ) $this->where = 'settings';
Expand Down
Loading

0 comments on commit d90e1ea

Please sign in to comment.