Ejemplo n.º 1
0
function javo_map_brief_callback()
{
    global $javo_tso, $javo_custom_item_label, $javo_custom_item_tab;
    $javo_query = new javo_ARRAY($_POST);
    if ((int) $javo_query->get('post_id', 0) <= 0) {
        return false;
    }
    $javo_meta_query = new javo_GET_META($javo_query->get('post_id'));
    $javo_this_author_avatar_id = get_the_author_meta('avatar');
    $javo_this_author_name = sprintf('%s %s', get_the_author_meta('first_name'), get_the_author_meta('last_name'));
    ob_start();
    ?>

	<div class="row">
		<div class="col-md-12 text-center">
			<a href="<?php 
    echo get_permalink($javo_query->get('post_id'));
    ?>
">
				<?php 
    echo $javo_meta_query->image('thumbnail', array('class' => 'img-circle img-inner-shadow'));
    ?>
			</a>
		</div><!-- /.col-md-4 -->
	</div><!-- /.row -->
	<div class="row">
		<div class="col-md-12 text-center">
			<a href="<?php 
    echo get_permalink($javo_query->get('post_id'));
    ?>
">
				<h1><?php 
    echo $javo_meta_query->post_title;
    ?>
</h1>
			</a>
		</div>
	</div><!-- /.row -->
	<div class="row">
		<div class="col-md-6 text-right">
			<ul class="list-unstyled">
				<li><?php 
    printf('%s : %s', __('Category', 'javo_fr'), $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')));
    ?>
</li>
				<li><?php 
    printf('%s : %s', __('Location', 'javo_fr'), $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')));
    ?>
</li>
				<?php 
    if ($javo_custom_item_tab->get('ratings', '') == '') {
        ?>
					<li><?php 
        printf('%s : %.1f /%d', __($javo_custom_item_label->get('ratings', 'Ratings'), 'javo_fr'), (double) $javo_meta_query->_get('rating_average'), (int) $javo_meta_query->get_child_count('ratings', 'rating_parent_post_id', $javo_query->get('post_id')));
        ?>
</li>
				<?php 
    }
    ?>
				<?php 
    if ($javo_custom_item_tab->get('reviews', '') == '') {
        ?>
					<li><?php 
        printf('%s : %d', __($javo_custom_item_label->get('reviews', 'Reviews'), 'javo_fr'), (int) $javo_meta_query->get_child_count('reviews', 'parent_post_id', $javo_query->get('post_id')));
        ?>
</li>
				<?php 
    }
    ?>
			</ul>
		</div><!-- /.col-md-6 -->
		<div class="col-md-6">
			<ul class="list-unstyled">
				<li><?php 
    printf('%s : %s', __('Phone', 'javo_fr'), $javo_meta_query->get('phone'));
    ?>
</li>
				<li><?php 
    printf('%s : %s', __('Email', 'javo_fr'), $javo_meta_query->get('email'));
    ?>
</li>
				<li><?php 
    printf('%s : %s', __('Website', 'javo_fr'), $javo_meta_query->get('website'));
    ?>
</li>
			</ul>
		</div><!-- /.col-md-6 -->
	</div><!-- /.row -->
	<div class="row">
		<div class="col-md-12 text-center alert alert-light-gray">
			<?php 
    echo $javo_meta_query->excerpt(400);
    ?>
		</div><!-- /.col-md-12 -->
	</div><!-- /.row -->

	<?php 
    $javo_bf_output = ob_get_clean();
    echo json_encode(array("html" => $javo_bf_output));
    exit;
}