public function show_upcoming_events() { ?> <div class="show-upcoming-dates-calendar-wrapper"> <input id="show-upcoming-dates-calendar-true" name="_bpt_show_upcoming_events_calendar" <?php esc_attr_e(Utilities::is_selected('true', '_bpt_show_upcoming_events_calendar', 'checked')); ?> value="true" type="radio" /> <label for="show-upcoming-events-calendar-true">Yes</label> <input id="show-upcoming-events-calendar-false" name="_bpt_show_upcoming_events_calendar" <?php esc_attr_e(Utilities::is_selected('false', '_bpt_show_upcoming_events_calendar', 'checked')); ?> value="false" type="radio" /> <label for="show-upcoming-events-calendar-false">No</label> <div class="<?php esc_attr_e(plugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p> If you would like to show upcoming events in the calendar, select yes. </p> </div> </div> </div> <?php }
public function __construct() { self::$plugin_version = plugin::get_plugin_version(); parent::__construct('_bpt_widget_calendar', __('Brown Paper Tickets Calendar Widget', 'brown-paper-tickets-locale'), array('description', __('Simple widget to display events in a calendar.', 'brown-paper-tickets-locale'))); if (is_active_widget(false, false, $this->id_base, true)) { } }
public static function client_id() { ?> <div class="client-id-wrapper"> <input name="_bpt_client_id" value="<?php esc_attr_e(get_option('_bpt_client_id')); ?> " type="text" placeholder="<?php esc_attr_e('Client ID'); ?> "> <div class="<?php esc_attr_e(plugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p> This is your Brown Paper Tickets username. </p> </div> </div> </div> <?php }
public static function enable_sales() { if (!is_ssl()) { echo 'SSL must be enabled.'; return; } $options = get_option('_bpt_purchase_settings'); $enable_sales = isset($options['enable_sales']) ? true : false; ?> <p>Not yet implemented!</p> <!-- <div class="purchase-settings-wrapper"> <label for="bpt-purchase-enable-sales">Enable Sales on Event List</label> <input id="bpt-purchase-enable-sales" class="checkbox" name="_bpt_purchase_settings[enable_sales]" type="checkbox" value="true" <?php esc_attr_e($enable_sales ? 'checked' : ''); ?> > <div class="<?php esc_attr_e(BPTPlugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p> If you would like to use allow customers to purchase tickets from your site, check this. </p> </div> </div> </div> --> <?php }
/** * Shortcode stuff! */ public static function list_event_shortcode($atts) { global $post; if (is_home() || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list-events') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list_events') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list-event') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list_event')) { $event_list_attributes = shortcode_atts(array('event_id' => null, 'client_id' => null, 'event-id' => null, 'client-id' => null), $atts); $localized_variables = array('ajaxurl' => admin_url('admin-ajax.php'), 'bptNonce' => wp_create_nonce('bpt-event-list-nonce'), 'postID' => $post->ID); $purchase_options = get_option('_bpt_purchase_settings'); if (isset($purchase_options['enable_sales'])) { $localized_variables['enableSales'] = $purchase_options['enable_sales']; } if ($event_list_attributes['event_id']) { $localized_variables['eventID'] = $event_list_attributes['event_id']; } if ($event_list_attributes['event-id']) { $localized_variables['eventID'] = $event_list_attributes['event-id']; } if ($event_list_attributes['client-id']) { $localized_variables['clientID'] = $event_list_attributes['client-id']; } if ($event_list_attributes['client_id']) { $localized_variables['clientID'] = $event_list_attributes['client_id']; } wp_enqueue_style('bpt_event_list_css', plugins_url('/assets/css/bpt-event-list-shortcode.css', __FILE__), array(), plugin::get_plugin_version()); wp_register_script('event_feed_js_' . $post->ID, plugins_url('/assets/js/event-feed.js', __FILE__), array('jquery', 'underscore', 'ractive_js', 'ractive_transitions_slide_js', 'moment_with_langs_min'), null, true); wp_enqueue_script('event_feed_js_' . $post->ID); wp_localize_script('event_feed_js_' . $post->ID, 'bptEventFeedAjaxPost' . $post->ID, $localized_variables); } return require __DIR__ . '/assets/templates/event-list.php'; }
<?php require_once plugin_dir_path(__FILE__) . '../src/brown-paper-tickets-plugin.php'; use BrownPaperTickets\BPTFeed; use BrownPaperTickets\BPTPlugin; $menu_slug = BPTPlugin::get_menu_slug(); $plugin_slug = BPTPlugin::get_plugin_slug(); $plugin_version = BPTPlugin::get_plugin_version(); ?> <h1> <img src="<?php echo esc_url(plugins_url('public//assets/img/bpt.png', dirname(__FILE__))); ?> "> </h1> <div class="wrap"> <div class="bpt-welcome-panel"> <div class="bpt-welcome-panel-content"> </div> <div class="bpt-welcome-panel-content"> <h2>Please be aware that this plugin is a beta release. You may encounter errors and bugs.</h2> <p> If you are having issues with your Client ID or your Developer ID, please email <a href="mailto:support@brownpapertickets.com">support@brownpapertickets.com</a>. </p> <h3> If you would like to request a new feature or if you have encountered a bug, please go <a target="_blank" href="https://github.com/BrownPaperTickets/brown-paper-tickets-wordpress/issues/new">here</a></span> to open up a new issue. </h3> </div> <span class="bpt-welcome-info-plugin-info">Plugin Info: <?php
public function cache_time() { $increment = 1; $cache_time = get_option('_bpt_cache_time'); $cache_unit = get_option('_bpt_cache_unit'); ?> <div class="cache-time-wrapper"> <p>Enabling caching of your event data will increase page load times.</p> <p>By setting the time below, you will tell the plugin to save the event data to the database temporarily and to serve the event data from there, rather than having to pull it in through the Brown Paper Tickets API every page load</p> <label for="cache-time-increment">Cache Time</label> <select id="cache-time-increment" name="_bpt_cache_time"> <option value="false" <?php esc_attr_e(selected($cache_time, '0')); ?> >Do Not Cache</option> <option value="0" <?php esc_attr_e(selected($cache_time, '0')); ?> >Cache Indefinitely</option> <?php while ($increment < 50) { echo '<option value="' . esc_attr($increment) . '"' . esc_attr(selected($cache_time, $increment)) . '>' . esc_attr($increment) . '</option>'; $increment++; } ?> </select> <label for="cache-time-unit">Cache Unit</label> <select id="cache-time-unit" name="_bpt_cache_unit"> <option value="minutes" <?php selected($cache_unit, 'minutes'); ?> >Minutes</option> <option value="hours" <?php selected($cache_unit, 'hours'); ?> >Hours</option> <option value="days" <?php selected($cache_unit, 'days'); ?> >Days</option> </select> <div class="<?php esc_attr_e(plugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p>Select the amount of time you would like to cache your event data.</p> <p>Setting this option will decrease the amount of time it takes for the data to load</p> <p></p> </div> </div> <div class="bpt-advanced-options"> <button class="button-large button" id="bpt-delete-cache">Delete Cache</button> <img class="bpt-loading hidden" src="<?php echo esc_url(Utilities::plugin_root_url() . '/public/assets/img/loading.gif'); ?> "> <p class="bpt-success-message hidden"></p> <p class="bpt-error-message hidden"></p> </div> </div> <?php }
<?php use BrownPaperTickets\Modules\Account\Inputs as AccountInputs; use BrownPaperTickets\Modules\EventList\Inputs as EventListInputs; use BrownPaperTickets\Modules\Calendar\Inputs as CalendarInputs; use BrownPaperTickets\Modules\General\Inputs as GeneralInputs; require_once plugin_dir_path(__FILE__) . '../src/brown-paper-tickets-plugin.php'; use BrownPaperTickets\BPTPlugin; $menu_slug = BPTPlugin::get_menu_slug(); ?> <form id="bpt-setup-wizard-form" method="post" action="options.php"> <?php settings_fields($menu_slug); ?> <div class="bpt-setup-wizard-wrapper"> <h1> <img src="<?php echo esc_url(plugins_url('public/assets/img/bpt.png', dirname(__FILE__))); ?> "> </h1> <div class="bpt-setup-wizard bpt-intro"> <h1>Thanks for installing the Brown Paper Tickets Wordpress Plugin.</h1> <p>In order to make use of this plugin, you'll need to set up a few options.</p> <div class="bpt-setup-wizard-button-container"> <button class="bpt-setup-wizard-prev-step button-secondary button-large" disabled >« Previous</button> <button class="bpt-setup-wizard-next-step button-primary button-large">Next »</button> </div> </div> <div class="bpt-setup-wizard bpt-step-1">
public function calendar() { $calendar_options = get_option('_bpt_calendar_style'); if (isset($calendar_options['use_style']) && isset($calendar_options['custom_css'])) { $use_calendar_style = $calendar_options['use_style']; $calendar_css = $calendar_options['custom_css']; } else { $use_calendar_style = false; $calendar_css = ''; } ?> <div class="event-list-appearance-wrapper"> <p> <label for="bpt-calendar-use-style">Use Custom Style</label> <input id="bpt-calendar-use-style" class="checkbox" name="_bpt_calendar_style[use_style]" type="checkbox" value="true" <?php esc_attr_e($use_calendar_style ? 'checked' : ''); ?> > <div class="<?php esc_attr_e(BPTPlugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p> If you would like to use a custom style, check this box. </p> </div> </div> </p> <div id="bpt-calendar-css" > <label for="bpt-calendar-css-box">Custom CSS</label> <textarea id="bpt-calendar-css-box" name="_bpt_calendar_style[custom_css]"><?php esc_html_e($calendar_css); ?> </textarea> </div> </div> <?php }
public function include_service_fee() { ?> <div class="include-service-fee-wrapper"> <input id="include-service-fee-true" name="_bpt_include_service_fee" <?php esc_attr_e(Utils::is_selected('true', '_bpt_include_service_fee', 'checked')); ?> value="true" type="radio" /> <label for="include-service-fee-true">Yes</label> <input id="include-service-fee-true" name="_bpt_include_service_fee" <?php esc_attr_e(Utils::is_selected('false', '_bpt_include_service_fee', 'checked')); ?> value="false" type="radio" /> <label for="include-service-fee-true">No</label> <div class="<?php esc_attr_e(BPTPlugin::get_menu_slug()); ?> _help"> <span>?</span> <div> <p> If you would like to include the Brown Paper Tickets service fees in your price total, select true. </p> </div> </div> <p class="bpt-help">This will override any individual price's service fee setting.</p> </div> <?php }