Пример #1
0
$origin_post_statuses = array('' => $use_global_settings_phrase) + $post_statuses;
$category_dropdown = wp_dropdown_categories(array('echo' => false, 'hide_empty' => false, 'orderby' => 'post_title', 'taxonomy' => Tribe__Events__Main::TAXONOMY));
preg_match_all('!\\<option.*value="([^"]+)"[^\\>]*\\>(.*)\\</option\\>!m', $category_dropdown, $matches);
$categories = array('' => __('No default category', 'the-events-calendar'));
$origin_categories = array('' => $use_global_settings_phrase);
foreach ($matches[1] as $key => $match) {
    $categories[$match] = $matches[2][$key];
    $origin_categories[$match] = $matches[2][$key];
}
$show_map_options = array('no' => __('No', 'the-events-calendar'), 'yes' => __('Yes', 'the-events-calendar'));
$origin_show_map_options = array('' => $use_global_settings_phrase) + $show_map_options;
$change_authority = array('import-defaults-update_authority' => array('type' => 'html', 'html' => '<h3 id="tribe-import-update-authority">' . esc_html__('Event Update Authority', 'the-events-calendar') . '</h3>'), 'info-update_authority' => array('type' => 'html', 'html' => '<p>' . esc_html__('You can make changes to imported events via The Events Calendar and see those changes reflected on your site’s calendar. The owner of the original event source (e.g. the iCalendar feed or Facebook group) might also make changes to their event. If you choose to re-import an altered event (manually or via a scheduled import), any changes made at the source or on your calendar will need to be addressed.', 'the-events-calendar') . '</p>'), 'tribe_aggregator_default_update_authority' => array('type' => 'radio', 'label' => esc_html__('Event Update Authority', 'the-events-calendar'), 'validation_type' => 'options', 'default' => Tribe__Events__Aggregator__Settings::$default_update_authority, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => array('overwrite' => __('Overwrite my event with any changes from the original source.', 'the-events-calendar'), 'retain' => __('Do not re-import events. Changes made locally will be preserved.', 'the-events-calendar'), 'preserve_changes' => __('Preserve the most recent change in each event field, whether that change occurred on my site or at the original source.', 'the-events-calendar'))));
$csv = array('csv-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-csv-settings">' . esc_html__('CSV Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_csv_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via CSV', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_csv_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via CSV', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories));
$global = $ical = $ics = $facebook = $gcal = $meetup = array();
// if there's an Event Aggregator license key, add the Global settings, Facebook, iCal, and Meetup fields
if (Tribe__Events__Aggregator::is_service_active()) {
    $global = array('import-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-global-settings">' . esc_html__('Global Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'publish', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $post_statuses), 'tribe_aggregator_default_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $categories), 'tribe_aggregator_default_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $show_map_options));
    $ical = array('ical-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-ical-settings">' . esc_html__('iCalendar Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_ical_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via iCalendar', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_ical_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via iCalendar', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories), 'tribe_aggregator_default_ical_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_show_map_options));
    $ics = array('ics-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-ics-settings">' . esc_html__('ICS File Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_ics_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via .ics files', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_ics_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via .ics files', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories), 'tribe_aggregator_default_ics_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_show_map_options));
    $facebook = array('facebook-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-facebook-settings">' . esc_html__('Facebook Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_facebook_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via Facebook', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_facebook_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via Facebook', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories), 'tribe_aggregator_default_facebook_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_show_map_options));
    $gcal = array('gcal-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-google-settings">' . esc_html__('Google Calendar Import Settings', 'the-events-calendar') . '</h3>'), 'tribe_aggregator_default_gcal_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via Google Calendar', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_gcal_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via Google Calendar', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories), 'tribe_aggregator_default_gcal_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_show_map_options));
    $meetup = array('meetup-defaults' => array('type' => 'html', 'html' => '<h3 id="tribe-import-meetup-settings">' . esc_html__('Meetup Import Settings', 'the-events-calendar') . '</h3>'), 'meetup-defaults-info' => array('type' => 'html', 'html' => '<p>' . sprintf(esc_html__('To import Meetup events, please be sure to add your Meetup API key on %1$sEvents > Settings > APIs%2$s', 'the-events-calendar'), '<a href="' . admin_url(Tribe__Settings::$parent_page . '&page=tribe-common&tab=addons') . '">', '</a>') . '</p>'), 'tribe_aggregator_default_meetup_post_status' => array('type' => 'dropdown', 'label' => esc_html__('Default Status', 'the-events-calendar'), 'tooltip' => esc_html__('The default post status for events imported via Meetup', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_post_statuses), 'tribe_aggregator_default_meetup_category' => array('type' => 'dropdown', 'label' => esc_html__('Default Event Category', 'the-events-calendar'), 'tooltip' => esc_html__('The default event category for events imported via Meetup', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => '', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_categories), 'tribe_aggregator_default_meetup_show_map' => array('type' => 'dropdown', 'label' => esc_html__('Show Google Map', 'the-events-calendar'), 'tooltip' => esc_html__('Show Google Map by default on imported event and venues', 'the-events-calendar'), 'size' => 'medium', 'validation_type' => 'options', 'default' => 'no', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, 'options' => $origin_show_map_options));
}
$internal = array_merge($change_authority, $global, $csv, $ical, $ics, $facebook, $gcal, $meetup);
$internal = apply_filters('tribe_aggregator_fields', $internal);
if (Tribe__Events__Aggregator::instance()->is_service_active()) {
    ob_start();
    ?>
	<p>
		<?php 
    printf(esc_html__('Use the options below to configure your imports. Global Import Settings apply to all imports, but you can also override the global settings by adjusting the origin-specific options. Check your Event Aggregator Service Status on the %1$s.', 'the-events-calendar'), '<a href="' . Tribe__Settings::instance()->get_url(array('page' => 'tribe-help')) . '#tribe-tribe-aggregator-status">' . esc_html__('Help page', 'the-events-calendar') . '</a>');
Пример #2
0
<?php

$has_license_key = Tribe__Events__Aggregator::is_service_active();
if ('edit' === $aggregator_action) {
    $default_post_status = get_post_meta($record->post->ID, Tribe__Events__Aggregator__Record__Abstract::$meta_key_prefix . 'post_status', true);
    $default_category = get_post_meta($record->post->ID, Tribe__Events__Aggregator__Record__Abstract::$meta_key_prefix . 'category', true);
}
$default_post_status = empty($default_post_status) ? tribe_get_option('tribe_aggregator_default_post_status', 'draft') : $default_post_status;
$default_category = empty($default_category) ? tribe_get_option('tribe_aggregator_default_category', '') : $default_category;
$post_statuses = get_post_statuses(array());
$category_dropdown = array();
$category_dropdown = wp_dropdown_categories(array('echo' => false, 'name' => 'aggregator[category]', 'id' => 'tribe-ea-field-category', 'hide_empty' => false, 'class' => 'tribe-ea-field tribe-ea-dropdown tribe-ea-size-large', 'orderby' => 'post_title', 'taxonomy' => Tribe__Events__Main::TAXONOMY));
$category_dropdown = preg_replace('!\\<select!', '<select data-hide-search', $category_dropdown);
$category_dropdown = preg_replace('!(\\<select[^\\>]*\\>)!', '$1<option value="">' . __('No Additional Categories', 'the-events-calendar') . '</option>', $category_dropdown);
$category_dropdown = preg_replace('!(value="' . $default_category . '")!', '$1 selected', $category_dropdown);
wp_nonce_field('tribe-aggregator-save-import', 'tribe_aggregator_nonce');
?>
<input type="hidden" name="aggregator[action]" id="tribe-action" value="<?php 
echo esc_attr($aggregator_action);
?>
">
<input type="hidden" name="aggregator[import_id]" id="tribe-import_id" value="<?php 
echo esc_attr(empty($record->meta['import_id']) ? '' : $record->meta['import_id']);
?>
">
<table class="form-table">
	<tbody>

		<?php 
$field = (object) array();
$field->source = 'origins';
Пример #3
0
 /**
  * Get's all products from the API
  *
  * @return array|WP_Error
  */
 private function get_all_products()
 {
     $products = array((object) array('title' => __('Event Aggregator', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/event-aggregator/?utm_campaign=in-app&utm_source=addonspage&utm_medium=event-aggregator&utm_content=appstoreembedded-1', 'description' => __('Importing events from multiple sources has never been easier! Event Aggregator helps you curate and manage event import feeds from Facebook, Meetup, Google Calendar, iCalendar, CSV, and ICS. Schedule automatic imports or manually import events when you’re ready. Event Aggregator provides a convenient dashboard to manage bulk imports, filters, one-way sync, import history, and more.', 'tribe-common'), 'image' => 'images/app-shop-ical.jpg', 'is_installed' => Tribe__Events__Aggregator::is_service_active()), (object) array('title' => __('Events Calendar PRO', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/wordpress-events-calendar-pro/?utm_campaign=in-app&utm_source=addonspage&utm_medium=wordpress-events-calendar-pro&utm_content=appstoreembedded-1', 'description' => sprintf(__('The Events Calendar PRO is a paid Add-On to our open source WordPress plugin %1$sThe Events Calendar%2$s. PRO offers a whole host of calendar features including recurring events, custom event attributes, saved venues and organizers, venue pages, advanced event admin and lots more.', 'tribe-common'), '<a href="http://m.tri.be/18vc">', '</a>'), 'image' => 'images/app-shop-pro.jpg', 'is_installed' => class_exists('Tribe__Events__Pro__Main')), (object) array('title' => __('Event Tickets Plus', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/wordpress-event-tickets-plus/?utm_campaign=in-app&utm_source=addonspage&utm_medium=wordpress-event-tickets-plus&utm_content=appstoreembedded-1', 'description' => sprintf(__('Event Tickets Plus allows you to sell tickets to your events using WooCommerce, Shopp, WP eCommerce, or Easy Digital Downloads. Use it on your posts and pages, or add %1$sThe Events Calendar%2$s and sell tickets from your events listings.', 'tribe-common'), '<a href="http://m.tri.be/18vc">', '</a>'), 'image' => 'images/app-shop-tickets-plus.jpg', 'is_installed' => class_exists('Tribe__Tickets_Plus__Main')), (object) array('title' => __('Filter Bar', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/wordpress-events-filterbar/?utm_campaign=in-app&utm_source=addonspage&utm_medium=wordpress-events-filterbar&utm_content=appstoreembedded-1', 'description' => __('It is awesome that your calendar is <em>THE PLACE</em> to get hooked up with prime choice ways to spend time. You have more events than Jabba the Hutt has rolls. Too bad visitors are hiring a personal assistant to go through all the choices. Ever wish you could just filter the calendar to only show events in walking distance, on a weekend, that are free? BOOM. Now you can. Introducing… the Filter Bar.', 'tribe-common'), 'image' => 'images/app-shop-filter-bar.jpg', 'is_installed' => class_exists('Tribe__Events__Filterbar__View')), (object) array('title' => __('Community Events', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/wordpress-community-events/?utm_campaign=in-app&utm_source=addonspage&utm_medium=wordpress-community-events&utm_content=appstoreembedded-1', 'description' => __('Enable users to submit events to your calendar with Community Events. You can require user accounts or allow visitors to submit without an account. Want to make sure that nothing fishy is going on? Just turn on moderation. Decide if users can edit and manage their own events, or simply submit. Plus, no scary form setup! Just activate, configure the options & off you go.', 'tribe-common'), 'image' => 'images/app-shop-community.jpg', 'is_installed' => class_exists('Tribe__Events__Community__Main')), (object) array('title' => __('Community Tickets', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/community-tickets/?utm_campaign=in-app&utm_source=addonspage&utm_medium=community-tickets&utm_content=appstoreembedded-1', 'description' => __('Enable Community Events organizers to offer tickets to their events. You can set flexible payment and fee options. They can even check-in attendees to their events! All of this managed from the front-end of your site without ever needing to grant access to your admin', 'tribe-common'), 'requires' => _x('Event Tickets Plus and Community Events', 'Names of required plugins for Community Tickets', 'tribe-common'), 'image' => 'images/app-shop-community-tickets.jpg', 'is_installed' => class_exists('Tribe__Events__Community__Tickets__Main')), (object) array('title' => __('Eventbrite Tickets', 'tribe-common'), 'link' => 'https://theeventscalendar.com/product/wordpress-eventbrite-tickets/?utm_campaign=in-app&utm_source=addonspage&utm_medium=wordpress-eventbrite-tickets&utm_content=appstoreembedded-1', 'description' => sprintf(__('The Eventbrite Tickets add-on allows you to create & sell tickets through The Events Calendar using the power of %1$sEventbrite%2$s. Whether you’re creating your ticket on the WordPress dashboard or importing the details of an already-existing event from %1$sEventbrite.com%2$s, this add-on brings the power of the Eventbrite API to your calendar.', 'tribe-common'), '<a href="http://www.eventbrite.com/r/etp">', '</a>'), 'image' => 'images/app-shop-eventbrite.jpg', 'is_installed' => class_exists('Tribe__Events__Tickets__Eventbrite__Main')));
     return $products;
 }