• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP EM_Locations类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中EM_Locations的典型用法代码示例。如果您正苦于以下问题:PHP EM_Locations类的具体用法?PHP EM_Locations怎么用?PHP EM_Locations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了EM_Locations类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     $instance = array_merge($this->defaults, $instance);
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'];
         echo apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
         echo $args['after_title'];
     }
     $instance['owner'] = false;
     $locations = EM_Locations::get(apply_filters('em_widget_locations_get_args', $instance));
     echo "<ul>";
     $li_wrap = !preg_match('/^<li>/i', trim($instance['format']));
     if (count($locations) > 0) {
         foreach ($locations as $location) {
             if ($li_wrap) {
                 echo '<li>' . $location->output($instance['format']) . '</li>';
             } else {
                 echo $location->output($instance['format']);
             }
         }
     } else {
         echo '<li>' . __('No locations', 'dbem') . '</li>';
     }
     echo "</ul>";
     echo $args['after_widget'];
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:28,代码来源:em-locations.php


示例2: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     $instance = array_merge($this->defaults, $instance);
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'];
         echo apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
         echo $args['after_title'];
     }
     //make sure no owner searches are being run
     $instance['owner'] = false;
     //legacy sanitization
     if (!preg_match('/^<li/i', trim($instance['format']))) {
         $instance['format'] = '<li>' . $instance['format'] . '</li>';
     }
     //get locations
     $locations = EM_Locations::get(apply_filters('em_widget_locations_get_args', $instance));
     //output locations
     echo "<ul>";
     if (count($locations) > 0) {
         foreach ($locations as $location) {
             echo $location->output($instance['format']);
         }
     } else {
         echo $instance['no_locations_text'];
     }
     echo "</ul>";
     echo $args['after_widget'];
 }
开发者ID:sajjadalisiddiqui,项目名称:cms,代码行数:30,代码来源:em-locations.php


示例3: em_get_locations

/**
 * Returns a html list of locations filtered by the array or query-string of arguments supplied. 
 * @param array|string $args
 * @return string
 */
function em_get_locations($args = array())
{
    if (strpos($args, "=")) {
        // allows the use of arguments without breaking the legacy code
        $defaults = EM_Locations::get_default_search();
        $args = wp_parse_args($args, $defaults);
    }
    return EM_Locations::output($args);
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:14,代码来源:em-template-tags.php


示例4: em_get_locations_list_shortcode

/**
 * Returns list of locations according to given specifications. Accepts any location query attribute.
 */
function em_get_locations_list_shortcode($atts, $format = '')
{
    $atts = (array) $atts;
    $atts['format'] = $format != '' || empty($atts['format']) ? $format : $atts['format'];
    $atts['format'] = html_entity_decode($atts['format']);
    //shorcode doesn't accept html
    $atts['page'] = !empty($atts['page']) && is_numeric($atts['page']) ? $atts['page'] : 1;
    $atts['page'] = !empty($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : $atts['page'];
    return EM_Locations::output($atts);
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:13,代码来源:em-shortcode.php


示例5: convert_to_se_event

 /**
  * Convert from Events Manager event to a event format defined
  * by ShoutEm Data Exchange Protocol @link http://fiveminutes.jira.com/wiki/display/SE/Data+Exchange+Protocol
  */
 private function convert_to_se_event($event)
 {
     $new_em_plugin = property_exists($event, 'event_id');
     if (!$new_em_plugin) {
         $remaped_event = self::convert_old_em_event_to_se_event($event);
     } else {
         //new event manager
         $remaped_event = array('post_id' => $event->event_id, 'start_time' => $event->event_start_date . ' ' . $event->event_start_time, 'end_time' => $event->event_end_date . ' ' . $event->event_end_time, 'name' => $event->name, 'description' => $event->post_content, 'image_url' => $event->image_url);
         $user_id = $event->event_owner;
         if ($user_id > 0) {
             $user = get_userdata($user_id);
             $remaped_event['owner'] = array('id' => $user_id, 'name' => $user->user_nicename);
         }
         $venue = array();
         $location = EM_Locations::get(array($event->location_id));
         if (is_array($location) && count($location) > 0) {
             $location = $location[$event->location_id];
             $venue = array('id' => '', 'name' => $location->location_name, 'street' => $location->location_address, 'city' => $location->location_town, 'state' => $location->location_state, 'country' => $location->location_country, 'latitude' => $location->location_latitude, 'longitude' => $location->location_longitude);
         }
         $remaped_event['place'] = $venue;
     }
     $striped_attachments = array();
     $remaped_event['description'] = sanitize_html($remaped_event['description'], $striped_attachments);
     if (property_exists($event, 'post_id')) {
         $this->include_leading_image_in_attachments($striped_attachments, $event->post_id);
     }
     $remaped_event['body'] = $remaped_event['description'];
     $remaped_event['summary'] = html_to_text($remaped_event['description']);
     $remaped_event['attachments'] = $striped_attachments;
     return $remaped_event;
 }
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:35,代码来源:class-shoutem-events-manager-dao.php


示例6: em_admin_options_page


//.........这里部分代码省略.........
    ?>
</h4>
							</td>
						</tr>
						<?php 
    em_options_radio_binary(__('Enable recurrence?', 'dbem'), 'dbem_recurrence_enabled', __('Select yes to enable the recurrence features feature', 'dbem'));
    em_options_radio_binary(__('Enable bookings?', 'dbem'), 'dbem_rsvp_enabled', __('Select yes to allow bookings and tickets for events.', 'dbem'));
    em_options_radio_binary(__('Enable tags?', 'dbem'), 'dbem_tags_enabled', __('Select yes to enable the tag features', 'dbem'));
    if (!(EM_MS_GLOBAL && !is_main_site())) {
        em_options_radio_binary(__('Enable categories?', 'dbem'), 'dbem_categories_enabled', __('Select yes to enable the category features', 'dbem'));
        if (get_option('dbem_categories_enabled')) {
            /*default category*/
            $category_options = array();
            $category_options[0] = __('no default category', 'dbem');
            $EM_Categories = EM_Categories::get();
            foreach ($EM_Categories as $EM_Category) {
                $category_options[$EM_Category->id] = $EM_Category->name;
            }
            echo "<tr><td>" . __('Default Category', 'dbem') . "</td><td>";
            wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'dbem_default_category', 'hierarchical' => true, 'taxonomy' => EM_TAXONOMY_CATEGORY, 'selected' => get_option('dbem_default_category'), 'show_option_none' => __('None', 'dbem'), 'class' => ''));
            echo "</br><em>" . __('This option allows you to select the default category when adding an event.', 'dbem') . ' ' . __('If an event does not have a category assigned when editing, this one will be assigned automatically.', 'dbem') . "</em>";
            echo "</td></tr>";
        }
    }
    em_options_radio_binary(sprintf(__('Enable %s attributes?', 'dbem'), __('event', 'dbem')), 'dbem_attributes_enabled', __('Select yes to enable the attributes feature', 'dbem'));
    em_options_radio_binary(sprintf(__('Enable %s custom fields?', 'dbem'), __('event', 'dbem')), 'dbem_cp_events_custom_fields', __('Custom fields are the same as attributes, except you cannot restrict specific values, users can add any kind of custom field name/value pair. Only available in the WordPress admin area.', 'dbem'));
    if (get_option('dbem_attributes_enabled')) {
        em_options_textarea(sprintf(__('%s Attributes', 'dbem'), __('Event', 'dbem')), 'dbem_placeholders_custom', sprintf(__("You can also add event attributes here, one per line in this format <code>#_ATT{key}</code>. They will not appear on event pages unless you insert them into another template below, but you may want to store extra information about an event for other uses. <a href='%s'>More information on placeholders.</a>", 'dbem'), EM_ADMIN_URL . '&amp;page=events-manager-help'));
    }
    if (get_option('dbem_locations_enabled')) {
        /*default location*/
        $location_options = array();
        $location_options[0] = __('no default location', 'dbem');
        $EM_Locations = EM_Locations::get();
        foreach ($EM_Locations as $EM_Location) {
            $location_options[$EM_Location->location_id] = $EM_Location->location_name;
        }
        em_options_select(__('Default Location', 'dbem'), 'dbem_default_location', $location_options, __('This option allows you to select the default location when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
        /*default location country*/
        em_options_select(__('Default Location Country', 'dbem'), 'dbem_location_default_country', em_get_countries(__('no default country', 'dbem')), __('If you select a default country, that will be pre-selected when creating a new location.', 'dbem'));
    }
    ?>
						<tr>
							<td colspan="2">
								<h4><?php 
    echo sprintf(__('%s Settings', 'dbem'), __('Location', 'dbem'));
    ?>
</h4>
							</td>
						</tr>
						<?php 
    em_options_radio_binary(__('Enable locations?', 'dbem'), 'dbem_locations_enabled', __('If you disable locations, bear in mind that you should remove your location page, shortcodes and related placeholders from your <a href="#formats" class="nav-tab-link" rel="#em-menu-formats">formats</a>.', 'dbem'));
    if (get_option('dbem_locations_enabled')) {
        em_options_radio_binary(__('Require locations for events?', 'dbem'), 'dbem_require_location', __('Setting this to no will allow you to submit events without locations. You can use the <code>{no_location}...{/no_location}</code> or <code>{has_location}..{/has_location}</code> conditional placeholder to selectively display location information.', 'dbem'));
        em_options_radio_binary(__('Use dropdown for locations?', 'dbem'), 'dbem_use_select_for_locations', __('Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events', 'dbem'));
        em_options_radio_binary(sprintf(__('Enable %s attributes?', 'dbem'), __('location', 'dbem')), 'dbem_location_attributes_enabled', __('Select yes to enable the attributes feature', 'dbem'));
        em_options_radio_binary(sprintf(__('Enable %s custom fields?', 'dbem'), __('location', 'dbem')), 'dbem_cp_locations_custom_fields', __('Custom fields are the same as attributes, except you cannot restrict specific values, users can add any kind of custom field name/value pair. Only available in the WordPress admin area.', 'dbem'));
        if (get_option('dbem_location_attributes_enabled')) {
            em_options_textarea(sprintf(__('%s Attributes', 'dbem'), __('Location', 'dbem')), 'dbem_location_placeholders_custom', sprintf(__("You can also add location attributes here, one per line in this format <code>#_LATT{key}</code>. They will not appear on location pages unless you insert them into another template below, but you may want to store extra information about an event for other uses. <a href='%s'>More information on placeholders.</a>", 'dbem'), EM_ADMIN_URL . '&amp;page=events-manager-help'));
        }
    }
    ?>
						<tr>
							<td colspan="2">
								<h4><?php 
    echo sprintf(__('%s Settings', 'dbem'), __('Other', 'dbem'));
开发者ID:Blueprint-Marketing,项目名称:interoccupy.net,代码行数:67,代码来源:em-options.php


示例7: em_admin_options_page

function em_admin_options_page()
{
    global $wpdb, $EM_Notices;
    //Check for uninstall/reset request
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'uninstall') {
        em_admin_options_uninstall_page();
        return;
    }
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'reset') {
        em_admin_options_reset_page();
        return;
    }
    //substitute dropdowns with input boxes for some situations to improve speed, e.g. if there 1000s of locations or users
    $total_users = $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->users};");
    if ($total_users > 100 && !defined('EM_OPTIMIZE_SETTINGS_PAGE_USERS')) {
        define('EM_OPTIMIZE_SETTINGS_PAGE_USERS', true);
    }
    $total_locations = EM_Locations::count();
    if ($total_locations > 100 && !defined('EM_OPTIMIZE_SETTINGS_PAGE_LOCATIONS')) {
        define('EM_OPTIMIZE_SETTINGS_PAGE_LOCATIONS', true);
    }
    //TODO place all options into an array
    global $events_placeholder_tip, $locations_placeholder_tip, $categories_placeholder_tip, $bookings_placeholder_tip;
    $events_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;page=events-manager-help#event-placeholders">' . __('Event Related Placeholders', 'dbem') . '</a>';
    $locations_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;page=events-manager-help#location-placeholders">' . __('Location Related Placeholders', 'dbem') . '</a>';
    $bookings_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;page=events-manager-help#booking-placeholders">' . __('Booking Related Placeholders', 'dbem') . '</a>';
    $categories_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;page=events-manager-help#category-placeholders">' . __('Category Related Placeholders', 'dbem') . '</a>';
    $events_placeholder_tip = " " . sprintf(__('This accepts %s and %s placeholders.', 'dbem'), $events_placeholders, $locations_placeholders);
    $locations_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $locations_placeholders);
    $categories_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $categories_placeholders);
    $bookings_placeholder_tip = " " . sprintf(__('This accepts %s, %s and %s placeholders.', 'dbem'), $bookings_placeholders, $events_placeholders, $locations_placeholders);
    global $save_button;
    $save_button = '<tr><th>&nbsp;</th><td><p class="submit" style="margin:0px; padding:0px; text-align:right;"><input type="submit" class="button-primary" id="dbem_options_submit" name="Submit" value="' . __('Save Changes', 'dbem') . ' (' . __('All', 'dbem') . ')" /></p></ts></td></tr>';
    if (defined('EM_SETTINGS_TABS') && EM_SETTINGS_TABS) {
        $tabs_enabled = true;
        $general_tab_link = esc_url(add_query_arg(array('em_tab' => 'general')));
        $pages_tab_link = esc_url(add_query_arg(array('em_tab' => 'pages')));
        $formats_tab_link = esc_url(add_query_arg(array('em_tab' => 'formats')));
        $bookings_tab_link = esc_url(add_query_arg(array('em_tab' => 'bookings')));
        $emails_tab_link = esc_url(add_query_arg(array('em_tab' => 'emails')));
    } else {
        $general_tab_link = $pages_tab_link = $formats_tab_link = $bookings_tab_link = $emails_tab_link = '';
    }
    ?>
	<script type="text/javascript" charset="utf-8"><?php 
    include EM_DIR . '/includes/js/admin-settings.js';
    ?>
</script>
	<style type="text/css">.postbox h3 { cursor:pointer; }</style>
	<div class="wrap <?php 
    if (empty($tabs_enabled)) {
        echo 'tabs-active';
    }
    ?>
">		
		<div id='icon-options-general' class='icon32'><br /></div>
		<h2 class="nav-tab-wrapper">
			<a href="<?php 
    echo $general_tab_link;
    ?>
#general" id="em-menu-general" class="nav-tab nav-tab-active"><?php 
    _e('General', 'dbem');
    ?>
</a>
			<a href="<?php 
    echo $pages_tab_link;
    ?>
#pages" id="em-menu-pages" class="nav-tab"><?php 
    _e('Pages', 'dbem');
    ?>
</a>
			<a href="<?php 
    echo $formats_tab_link;
    ?>
#formats" id="em-menu-formats" class="nav-tab"><?php 
    _e('Formatting', 'dbem');
    ?>
</a>
			<?php 
    if (get_option('dbem_rsvp_enabled')) {
        ?>
			<a href="<?php 
        echo $bookings_tab_link;
        ?>
#bookings" id="em-menu-bookings" class="nav-tab"><?php 
        _e('Bookings', 'dbem');
        ?>
</a>
			<?php 
    }
    ?>
			<a href="<?php 
    echo $emails_tab_link;
    ?>
#emails" id="em-menu-emails" class="nav-tab"><?php 
    _e('Emails', 'dbem');
    ?>
</a>
		</h2>
		<h3 id="em-options-title"><?php 
//.........这里部分代码省略.........
开发者ID:rolka,项目名称:events-manager,代码行数:101,代码来源:em-options.php


示例8: em_admin_options_page

function em_admin_options_page()
{
    //TODO place all options into an array
    $events_placeholders = '<a href="admin.php?page=events-manager-help#event-placeholders">' . __('Event Related Placeholders', 'dbem') . '</a>';
    $locations_placeholders = '<a href="admin.php?page=events-manager-help#location-placeholders">' . __('Location Related Placeholders', 'dbem') . '</a>';
    $bookings_placeholders = '<a href="admin.php?page=events-manager-help#booking-placeholders">' . __('Booking Related Placeholders', 'dbem') . '</a>';
    $events_placeholder_tip = " " . sprintf(__('This accepts %s and %s placeholders.', 'dbem'), $events_placeholders, $locations_placeholders);
    $locations_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $locations_placeholders);
    $bookings_placeholder_tip = " " . sprintf(__('This accepts %s, %s and %s placeholders.', 'dbem'), $bookings_placeholders, $events_placeholders, $locations_placeholders);
    $save_button = '<tr><th>&nbsp;</th><td><p class="submit" style="margin:0px; padding:0px; text-align:right;"><input type="submit" id="dbem_options_submit" name="Submit" value="' . __('Save Changes') . ' (' . __('All', 'dbem') . ')" /></p></ts></td></tr>';
    ?>
	
	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($){
			var close_text = '<?php 
    _e('Collapse All', 'dbem');
    ?>
';
			var open_text = '<?php 
    _e('Expand All', 'dbem');
    ?>
';
			var open_close = $('<a href="#" style="display:block; float:right; clear:right; margin:10px;">'+close_text+'</a>');
			$('#icon-options-general').after(open_close);
			open_close.click( function(e){
				e.preventDefault();
				if($(this).text() == close_text){
					$(".postbox").addClass('closed');
					$(this).text(open_text);
				}else{
					$(".postbox").removeClass('closed');
					$(this).text(close_text);
				} 
			});
			//For rewrite titles
			$('input:radio[name=dbem_disable_title_rewrites]').live('change',function(){
				checked_check = $('input:radio[name=dbem_disable_title_rewrites]:checked');
				if( checked_check.val() == 1 ){
					$('#dbem_title_html_row').show();
				}else{
					$('#dbem_title_html_row').hide();					
				}
			});
			$('input:radio[name=dbem_disable_title_rewrites]').trigger('change');
			
		});
	</script>
	<div class="wrap">
		<div id='icon-options-general' class='icon32'><br />
		</div>		
		<h2><?php 
    _e('Event Manager Options', 'dbem');
    ?>
</h2>
		
		<form id="dbem_options_form" method="post" action="">          

			<div class="metabox-holder">         
			<!-- // TODO Move style in css -->
			<div class='postbox-container' style='width: 99.5%'>
			<div id="" class="meta-box-sortables" >
		  
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('General options', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
	            <table class="form-table">
					<?php 
    em_options_radio_binary(__('Use dropdown for locations?'), 'dbem_use_select_for_locations', __('Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events', 'dbem'));
    em_options_radio_binary(__('Use recurrence?'), 'dbem_recurrence_enabled', __('Select yes to enable the recurrence features feature', 'dbem'));
    em_options_radio_binary(__('Use RSVP?'), 'dbem_rsvp_enabled', __('Select yes to enable the RSVP feature', 'dbem'));
    em_options_radio_binary(__('Use categories?'), 'dbem_categories_enabled', __('Select yes to enable the category features', 'dbem'));
    em_options_radio_binary(__('Use attributes?'), 'dbem_attributes_enabled', __('Select yes to enable the attributes feature', 'dbem'));
    /*default category*/
    $category_options = array();
    $category_options[0] = __('no default category', 'dbem');
    $EM_Categories = EM_Categories::get();
    foreach ($EM_Categories as $EM_Category) {
        $category_options[$EM_Category->id] = $EM_Category->name;
    }
    em_options_select(__('Default Category'), 'dbem_default_category', $category_options, __('This option allows you to select the default category when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    /*default location*/
    $location_options = array();
    $location_options[0] = __('no default location', 'dbem');
    $EM_Locations = EM_Locations::get();
    foreach ($EM_Locations as $EM_Location) {
        $location_options[$EM_Location->id] = $EM_Location->name;
    }
    em_options_select(__('Default Location'), 'dbem_default_location', $location_options, __('This option allows you to select the default location when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    em_options_textarea(__('Custom Placeholders', 'dbem'), 'dbem_placeholders_custom', sprintf(__("You can add custom placeholders here, one per line in this format <code>#_ATT{key}</code>. They will not appear on event pages unless you insert them into another template below, but you may want to store extra information about an event for other uses. <a href='%s'>More information on placeholders.</a>", 'dbem'), 'wp-events-plugin.com/documentation/the-em-templates-syntax/'));
    echo $save_button;
    ?>
				</table>
				    
			</div> <!-- . inside --> 
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-options.php


示例9: em_ajax_actions

function em_ajax_actions()
{
    //TODO Clean this up.... use a uniformed way of calling EM Ajax actions
    if (!empty($_REQUEST['em_ajax']) || !empty($_REQUEST['em_ajax_action'])) {
        if (isset($_REQUEST['dbem_ajax_action']) && $_REQUEST['dbem_ajax_action'] == 'booking_data') {
            if (isset($_REQUEST['id'])) {
                $EM_Event = new EM_Event($_REQUEST['id']);
                echo "[{bookedSeats:" . $EM_Event->get_bookings()->get_booked_seats() . ", availableSeats:" . $EM_Event->get_bookings()->get_available_seats() . "}]";
            }
            die;
        }
        if (isset($_REQUEST['em_ajax_action']) && $_REQUEST['em_ajax_action'] == 'get_location') {
            if (isset($_REQUEST['id'])) {
                $EM_Location = new EM_Location($_REQUEST['id']);
                $location_array = $EM_Location->to_array();
                $location_array['location_balloon'] = $EM_Location->output(get_option('dbem_location_baloon_format'));
                echo EM_Object::json_encode($location_array);
            }
            die;
        }
        if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'GlobalMapData') {
            $locations = EM_Locations::get($_REQUEST);
            $json_locations = array();
            foreach ($locations as $location_key => $location) {
                $json_locations[$location_key] = $location->to_array();
                $json_locations[$location_key]['location_balloon'] = $location->output(get_option('dbem_map_text_format'));
            }
            echo EM_Object::json_encode($json_locations);
            die;
        }
        if (isset($_REQUEST['ajaxCalendar']) && $_REQUEST['ajaxCalendar']) {
            //FIXME if long events enabled originally, this won't show up on ajax call
            echo EM_Calendar::output($_REQUEST);
            die;
        }
        //EM Ajax requests require this flag.
        if (is_admin()) {
            //Admin operations
            //Booking Actions
            global $EM_Booking;
            if (!empty($_REQUEST['bookings']) || is_object($EM_Booking)) {
                if (is_object($EM_Booking)) {
                    $_REQUEST['bookings'] = $EM_Booking;
                    //small hack to prevent unecessary db reads
                }
                $EM_Bookings = new EM_Bookings();
                //Empty, not bound to event.
                if ($_REQUEST['action'] == 'bookings_approve') {
                    $EM_Bookings->approve($_REQUEST['bookings']);
                    echo $EM_Bookings->feedback_message;
                    die;
                } elseif ($_REQUEST['action'] == 'bookings_reject') {
                    $EM_Bookings->reject($_REQUEST['bookings']);
                    echo $EM_Bookings->feedback_message;
                    die;
                } elseif ($_REQUEST['action'] == 'bookings_unapprove') {
                    $EM_Bookings->unapprove($_REQUEST['bookings']);
                    echo $EM_Bookings->feedback_message;
                    die;
                } elseif ($_REQUEST['action'] == 'bookings_delete') {
                    //Just do it here, since we may be deleting bookings of different events.
                    $result = false;
                    if (EM_Object::array_is_numeric($_REQUEST['bookings'])) {
                        $results = array();
                        foreach ($_REQUEST['bookings'] as $booking_id) {
                            $EM_Booking = new EM_Booking($booking_id);
                            $results[] = $EM_Booking->delete();
                        }
                        $result = !in_array(false, $results);
                    } elseif (is_numeric($_REQUEST['bookings'])) {
                        $EM_Booking = new EM_Booking($_REQUEST['bookings']);
                        $result = $EM_Booking->delete();
                    } elseif (is_object($EM_Booking)) {
                        $result = $EM_Booking->delete();
                    }
                    if ($result) {
                        echo __('Booking Deleted', 'dbem');
                    } else {
                        echo '<span style="color:red">' . __('Booking deletion unsuccessful', 'dbem') . '</span>';
                    }
                    die;
                }
            }
            //Specific Oject Ajax
            if (!empty($_REQUEST['em_obj'])) {
                switch ($_REQUEST['em_obj']) {
                    case 'em_bookings_events_table':
                    case 'em_bookings_pending_table':
                    case 'em_bookings_confirmed_table':
                        call_user_func($_REQUEST['em_obj']);
                        break;
                }
                die;
            }
        }
    }
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:97,代码来源:em-ajax.php


示例10: dbem_get_locations

function dbem_get_locations($eventful = false)
{
    $EM_Locations = EM_Locations::get(array('eventful' => $eventful));
    foreach ($EM_Locations as $key => $EM_Location) {
        $EM_Locations[$key] = $EM_Location->to_array();
    }
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:7,代码来源:em-template-tags-depreciated.php


示例11: em_locations_admin

/**
 * Outputs table of locations belonging to user
 * @param array $args
 */
function em_locations_admin($args = array())
{
    global $EM_Location;
    if (is_user_logged_in() && current_user_can('edit_locations')) {
        if (!empty($_GET['action']) && $_GET['action'] == 'edit') {
            if (empty($_REQUEST['redirect_to'])) {
                $_REQUEST['redirect_to'] = em_add_get_params($_SERVER['REQUEST_URI'], array('action' => null, 'location_id' => null));
            }
            em_location_form();
        } else {
            $url = empty($url) ? $_SERVER['REQUEST_URI'] : $url;
            //url to this page
            $limit = !empty($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
            //Default limit
            $page = !empty($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
            $offset = $page > 1 ? ($page - 1) * $limit : 0;
            $args = array('limit' => $limit, 'offset' => $offset, 'status' => false, 'blog' => false);
            if (!empty($_REQUEST['view']) && $_REQUEST['view'] == 'others' && current_user_can('read_others_locations')) {
                $locations = EM_Locations::get($args);
                $locations_count = EM_Locations::count(array('status' => false, 'blog' => false, 'owner' => false));
            } else {
                $locations = EM_Locations::get(array_merge($args, array('owner' => get_current_user_id())));
                $locations_count = EM_Locations::count(array('status' => false, 'blog' => false, 'owner' => get_current_user_id()));
            }
            $locations_mine_count = EM_Locations::count(array('owner' => get_current_user_id(), 'blog' => false, 'status' => false));
            $locations_all_count = current_user_can('read_others_locations') ? EM_Locations::count(array('blog' => false, 'status' => false)) : 0;
            em_locate_template('tables/locations.php', true, array('args' => $args, 'locations' => $locations, 'locations_count' => $locations_count, 'locations_mine_count' => $locations_mine_count, 'locations_all_count' => $locations_all_count, 'url' => $url, 'page' => $page, 'limit' => $limit, 'offset' => $offset, 'show_add_new' => true));
        }
    } else {
        echo __("You must log in to view and manage your locations.", 'dbem');
    }
}
开发者ID:rajankz,项目名称:webspace,代码行数:36,代码来源:em-template-tags.php


示例12: em_admin_locations

function em_admin_locations($message = '', $fill_fields = false)
{
    $limit = !empty($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
    //Default limit
    $page = !empty($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
    $offset = $page > 1 ? ($page - 1) * $limit : 0;
    $locations = EM_Locations::get();
    $locations_count = count($locations);
    ?>
		<div class='wrap'>
			<div id='icon-edit' class='icon32'>
				<br/>
			</div>
 	 		<h2>
 	 			<?php 
    _e('Locations', 'dbem');
    ?>
 	 			<a href="admin.php?page=events-manager-locations&action=add" class="button add-new-h2"><?php 
    _e('Add New');
    ?>
</a>
 	 		</h2>  

			<?php 
    if ($message != "") {
        ?>
				<div id='message' class='updated fade below-h2'>
					<p><?php 
        echo $message;
        ?>
</p>
				</div>
			<?php 
    }
    ?>
  
			  
		 	 <form id='bookings-filter' method='post' action=''>
				<input type='hidden' name='page' value='locations'/>
				<input type='hidden' name='limit' value='<?php 
    echo $limit;
    ?>
' />	
				<input type='hidden' name='p' value='<?php 
    echo $page;
    ?>
' />								
				<?php 
    if ($locations_count > 0) {
        ?>
				<div class='tablenav'>					
					<div class="alignleft actions">
						<select name="action">
							<option value="" selected="selected"><?php 
        _e('Bulk Actions');
        ?>
</option>
							<option value="delete"><?php 
        _e('Delete selected', 'dbem');
        ?>
</option>
						</select> 
						<input type="submit" value="<?php 
        _e('Apply');
        ?>
" id="doaction2" class="button-secondary action" /> 
						<?php 
        //Pagination (if needed/requested)
        if ($locations_count >= $limit) {
            //Show the pagination links (unless there's less than 10 events
            $page_link_template = preg_replace('/(&|\\?)p=\\d+/i', '', $_SERVER['REQUEST_URI']);
            $page_link_template = em_add_get_params($page_link_template, array('pno' => '%PAGE%'));
            $locations_nav = em_paginate($page_link_template, $locations_count, $limit, $page);
            echo $locations_nav;
        }
        ?>
					</div>
				</div>
				<table class='widefat'>
					<thead>
						<tr>
							<th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>
							<th><?php 
        _e('Name', 'dbem');
        ?>
</th>
							<th><?php 
        _e('Address', 'dbem');
        ?>
</th>
							<th><?php 
        _e('Town', 'dbem');
        ?>
</th>                
						</tr> 
					</thead>
					<tfoot>
						<tr>
							<th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>
							<th><?php 
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-locations.php


示例13: _e

}
?>
			
			
			<h4><?php 
_e('Where', 'dbem');
?>
</h4>
			<div class="inside">
				<table id="dbem-location-data">     
					<tr>
						<td style="padding-right:20px; vertical-align:top;">
							<?php 
$args = array();
$args['owner'] = current_user_can('read_others_locations') ? false : get_current_user_id();
$locations = EM_Locations::get($args);
?>
							<?php 
if (count($locations) > 0) {
    ?>
							<select name="location_id" id='location-select-id' size="1">  
								<?php 
    foreach ($locations as $location) {
        $selected = "";
        if (is_object($EM_Event->location)) {
            if ($EM_Event->location->id == $location->id) {
                $selected = "selected='selected' ";
            }
        }
        ?>
          
开发者ID:hypenotic,项目名称:slowfood,代码行数:30,代码来源:event-editor.php


示例14: em_admin_locations

function em_admin_locations($message = '', $fill_fields = false)
{
    global $EM_Notices;
    $limit = !empty($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
    //Default limit
    $page = !empty($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
    $offset = $page > 1 ? ($page - 1) * $limit : 0;
    if (!empty($_REQUEST['owner']) && current_user_can('read_others_locations')) {
        $locations = EM_Locations::get(array('owner' => false));
        $locations_mine_count = EM_Locations::count(array('owner' => get_current_user_id()));
        $locations_all_count = count($locations);
    } else {
        $locations = EM_Locations::get(array('owner' => get_current_user_id(), 'blog' => false));
        $locations_mine_count = count($locations);
        $locations_all_count = current_user_can('read_others_locations') ? EM_Locations::count(array('blog' => false)) : 0;
    }
    $locations_count = count($locations);
    ?>
		<div class='wrap'>
			<div id='icon-edit' class='icon32'>
				<br/>
			</div>
 	 		<h2>
 	 			<?php 
    _e('Locations', 'dbem');
    ?>
 	 			<a href="admin.php?page=events-manager-locations&action=add" class="button add-new-h2"><?php 
    _e('Add New', 'dbem');
    ?>
</a>
 	 		</h2>  

			<?php 
    echo $EM_Notices;
    ?>
  
			  
		 	 <form id='locations-filter' method='post' action=''>
				<input type='hidden' name='page' value='locations'/>
				<input type='hidden' name='limit' value='<?php 
    echo $limit;
    ?>
' />	
				<input type='hidden' name='p' value='<?php 
    echo $page;
    ?>
' />	
				<div class="subsubsub">
					<a href='admin.php?page=events-manager-locations' <?php 
    echo empty($_REQUEST['owner']) ? 'class="current"' : '';
    ?>
><?php 
    echo sprintf(__('My %s', 'dbem'), __('Locations', 'dbem'));
    ?>
 <span class="count">(<?php 
    echo $locations_mine_count;
    ?>
)</span></a>
					<?php 
    if (current_user_can('read_others_locations')) {
        ?>
					&nbsp;|&nbsp;
					<a href='admin.php?page=events-manager-locations&amp;owner=all' <?php 
        echo !empty($_REQUEST['owner']) ? 'class="current"' : '';
        ?>
><?php 
        echo sprintf(__('All %s', 'dbem'), __('Locations', 'dbem'));
        ?>
 <span class="count">(<?php 
        echo $locations_all_count;
        ?>
)</span></a>
					<?php 
    }
    ?>
				</div>										
				<?php 
    if ($locations_count > 0) {
        ?>
				<div class='tablenav'>					
					<div class="alignleft actions">
						<select name="action">
							<option value="" selected="selected"><?php 
        _e('Bulk Actions');
        ?>
</option>
							<option value="location_delete"><?php 
        _e('Delete selected', 'dbem');
        ?>
</option>
						</select> 
						<input type="submit" value="<?php 
        _e('Apply');
        ?>
" id="doaction2" class="button-secondary action" /> 
					</div>
						<?php 
        if ($locations_count >= $limit) {
            $locations_nav = em_admin_paginate($locations_count, $limit, $page);
            echo $locations_nav;
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-locations.php


示例15: em_admin_event_page


//.........这里部分代码省略.........
    echo $EM_Event->latitude;
    ?>
' size='15' />
								-
								<input id='location-longitude' name='location_longitude' type='text' value='<?php 
    echo $EM_Event->longitude;
    ?>
' size='15' />
							</div>
						</div>
						<div id="location_info" class="stuffbox">
							<h3>
								<?php 
    _e('Location', 'dbem');
    ?>
							</h3>
							<div class="inside">
								<table id="dbem-location-data">     
									<tr>
										<td style="padding-right:20px">
											<table>
												<?php 
    if ($use_select_for_locations) {
        ?>
 
												<tr>
													<th><?php 
        _e('Location:', 'dbem');
        ?>
</th>
													<td> 
														<select name="location-select-id" id='location-select-id' size="1">  
															<?php 
        $locations = EM_Locations::get();
        foreach ($locations as $location) {
            $selected = "";
            if (is_object($EM_Event->location)) {
                if ($EM_Event->location->id == $location->id) {
                    $selected = "selected='selected' ";
                }
            }
            ?>
          
														    	<option value="<?php 
            echo $location->id;
            ?>
" title="<?php 
            echo "{$location->latitude},{$location->longitude}";
            ?>
" <?php 
            echo $selected;
            ?>
><?php 
            echo $location->name;
            ?>
</option>
														    	<?php 
        }
        ?>
														</select>
														<p><?php 
        _e('The name of the location where the event takes place. You can use the name of a venue, a square, etc', 'dbem');
        ?>
</p>
													</td>
												</tr>
开发者ID:hypenotic,项目名称:slowfood,代码行数:67,代码来源:em-event.php


示例16: em_admin_event_page


//.........这里部分代码省略.........
    echo $EM_Event->get_location()->latitude;
    ?>
' size='15' />
								-
								<input id='location-longitude' name='location_longitude' type='text' value='<?php 
    echo $EM_Event->get_location()->longitude;
    ?>
' size='15' />
							</div>
						</div>
						<div id="location_info" class="stuffbox">
							<h3>
								<?php 
    _e('Location', 'dbem');
    ?>
							</h3>
							<div class="inside">
								<table id="dbem-location-data">     
									<tr>
										<td style="padding-right:20px; width:100%;">
											<table>
												<?php 
    if ($use_select_for_locations) {
        ?>
 
												<tr>
													<th><?php 
        _e('Location:', 'dbem');
     

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP EM_Object类代码示例发布时间:2022-05-23
下一篇:
PHP EM_Events类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap