/**
  * Currency switcher
  *
  * @access public
  * @return void|bool|string
  */
 public static function currencies($atts)
 {
     $atts = shortcode_atts(array(), $atts, 'realia_currencies');
     if (!current_theme_supports('realia-currencies')) {
         return;
     }
     $currencies = get_theme_mod('realia_currencies');
     if ($currencies == false) {
         $currencies = array(array('symbol' => '$', 'code' => 'USD', 'show_after' => false, 'money_decimals' => 2, 'money_dec_point' => '.', 'money_thousands_separator' => ','));
     } elseif (!is_array($currencies)) {
         return false;
     }
     array_splice($currencies, get_theme_mod('realia_currencies_other', 0) + 1);
     $result = '';
     if (!empty($currencies) && is_array($currencies)) {
         ksort($currencies);
         $currency_code = Realia_Currencies::get_current_currency_code();
         $result = '';
         ob_start();
         include Realia_Template_Loader::locate('misc/currencies');
         $result = ob_get_contents();
         ob_end_clean();
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Get review form and reviews template
  *
  * @access public
  * @param $template
  * @return string
  */
 public static function get_reviews_template($template)
 {
     if (!in_array(get_post_type(), Realia_Reviews::$allowed_post_types)) {
         return $template;
     }
     return Realia_Template_Loader::locate('reviews/review-list');
 }
Exemplo n.º 3
0
 /**
  * Cookie policy page
  *
  * @access public
  * @return void
  */
 public static function cookie_policy()
 {
     $cookie_policy_page_id = get_theme_mod('realia_general_cookie_policy_page', null);
     $under_construction = get_theme_mod('realia_general_enable_under_construction', false);
     if ($under_construction) {
         return;
     }
     if (!empty($_COOKIE['cookie-policy']) && $_COOKIE['cookie-policy'] == true) {
         return;
     }
     if (!empty($cookie_policy_page_id)) {
         include Realia_Template_Loader::locate('cookie-policy');
     }
 }
 /**
  * Backend
  *
  * @access public
  * @param array $instance
  * @return void
  */
 function form($instance)
 {
     include Realia_Template_Loader::locate('widgets/cover-admin');
 }
Exemplo n.º 5
0
                $index++;
                ?>
					<?php 
            }
            ?>
				</div><!-- /.row -->
			<?php 
        } elseif ($instance['display'] == 'small') {
            ?>
				<?php 
            while (have_posts()) {
                the_post();
                ?>
				
					<?php 
                include Realia_Template_Loader::locate('properties/small');
                ?>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
		</div>
	<?php 
    } else {
        ?>
		<div class="alert alert-warning">
			<?php 
        echo __('No se encontraron inmuebles.', 'realia');
        ?>
Exemplo n.º 6
0
			
			</div><!-- /.row -->
		<?php 
        } elseif ($instance['display'] == 'large') {
            ?>
			<?php 
            while (have_posts()) {
                the_post();
                ?>
			
				<div class="col-sm-<?php 
                echo 12 / $instance['per_row'];
                ?>
">
					<?php 
                include Realia_Template_Loader::locate('agents/simple');
                ?>
				</div><!-- /.col-* -->
			<?php 
            }
            ?>
			
		<?php 
        }
        ?>
		
	<?php 
    } else {
        ?>
		<div class="alert alert-warning">
			<?php 
Exemplo n.º 7
0
<?php 
$agent = Realia_Query::get_property_agent();
if (!empty($agent)) {
    ?>
    <?php 
    query_posts(array('post_type' => 'agent', 'post__in' => array($agent->ID)));
    ?>
    <?php 
    if (have_posts()) {
        ?>
        <?php 
        while (have_posts()) {
            the_post();
            ?>
            <?php 
            include Realia_Template_Loader::locate('agents/small');
            ?>
        <?php 
        }
        ?>
    <?php 
    }
    ?>
    <?php 
    wp_reset_query();
}
?>

<?php 
echo wp_kses($args['after_widget'], wp_kses_allowed_html('post'));
 /**
  * Backend
  *
  * @access public
  * @param array $instance
  * @return void
  */
 function form($instance)
 {
     include Realia_Template_Loader::locate('widgets/horizontal-filter-admin');
 }
 /**
  * Catch template and render JSON output
  *
  * @access public
  * @return string
  */
 public static function catch_template()
 {
     if (get_query_var('properties-feed')) {
         header('HTTP/1.0 200 OK');
         header('Content-Type: application/json');
         $property_groups = array();
         $data = array();
         Realia_Query::loop_properties_all();
         Realia_Query::loop_properties_filter();
         if (have_posts()) {
             while (have_posts()) {
                 the_post();
                 // Property GPS positions. We will use these values
                 // for genearating unique md5 hash for property groups.
                 $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true);
                 $latitude = $location['latitude'];
                 $longitude = $location['longitude'];
                 // Build on array of property groups. We need to know how
                 // many and which properties are at the same position.
                 if (!empty($latitude) && !empty($longitude)) {
                     $hash = sha1($latitude . $longitude);
                     $property_groups[$hash][] = get_the_ID();
                 }
             }
         }
         wp_reset_query();
         foreach ($property_groups as $group) {
             $args = array('post_type' => 'property', 'posts_per_page' => -1, 'post_status' => 'publish', 'post__in' => $group);
             query_posts($args);
             if (have_posts()) {
                 // Group of properties at the same position so we will process
                 // property loop inside the template.
                 if (count($group) > 1) {
                     $location = get_post_meta($group[0], REALIA_PROPERTY_PREFIX . 'map_location', true);
                     $latitude = $location['latitude'];
                     $longitude = $location['longitude'];
                     // Marker
                     ob_start();
                     $template = Realia_Template_Loader::locate('google-map-infowindow-group');
                     include $template;
                     $output = ob_get_contents();
                     ob_end_clean();
                     $content = str_replace(array("\r\n", "\n", "\t"), '', $output);
                     // Infowindow
                     ob_start();
                     $template = Realia_Template_Loader::locate('google-map-marker-group');
                     include $template;
                     $output = ob_get_contents();
                     ob_end_clean();
                     $marker_content = str_replace(array("\r\n", "\n", "\t"), '', $output);
                     // Just one property. We can get current post here.
                 } else {
                     the_post();
                     $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true);
                     $latitude = $location['latitude'];
                     $longitude = $location['longitude'];
                     $content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-infowindow'));
                     $marker_content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-marker'));
                 }
                 // Array of values passed into markers[] array in jquery-google-map.js library
                 $data[] = array('latitude' => $latitude, 'longitude' => $longitude, 'content' => $content, 'marker_content' => $marker_content);
             }
             wp_reset_query();
         }
         echo json_encode($data);
         exit;
     }
 }
 /**
  * Backend
  *
  * @access public
  * @param array $instance
  * @return void
  */
 function form($instance)
 {
     include Realia_Template_Loader::locate('widgets/properties-map-admin');
 }
 /**
  * Backend
  *
  * @access public
  * @param array $instance
  * @return void
  */
 function form($instance)
 {
     include Realia_Template_Loader::locate('widgets/agent-assigned-admin');
 }
 /**
  * Backend
  *
  * @access public
  * @param array $instance
  * @return void
  */
 function form($instance)
 {
     include Realia_Template_Loader::locate('widgets/carousel-small-admin');
 }
Exemplo n.º 13
0
				<header class="entry-header">
					<h2 class="property-row-title entry-title">
						<a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a>

			            <span class="property-row-title-actions">
			                <?php 
include Realia_Template_Loader::locate('favorites-action');
?>
			                <?php 
include Realia_Template_Loader::locate('compare-action');
?>
			            </span><!-- /.property-row-title-actions -->
					</h2>
				</header>

				<div class="entry-content">
					<div class="property-row-location">
						<?php 
echo Realia_Query::get_property_location_name();
?>
					</div>

					<div class="property-row-body">
						<p><?php 
the_excerpt();