Example #1
0
 private function infowindow()
 {
     $wpl_property = new wpl_property();
     $listing_fields = $wpl_property->get_plisting_fields();
     $select = $wpl_property->generate_select($listing_fields, 'p');
     $property_ids = wpl_request::getVar('property_ids', '');
     $query = "SELECT " . $select . " FROM `#__wpl_properties` AS p WHERE 1 AND p.`deleted`='0' AND p.`finalized`='1' AND p.`confirmed`='1' AND p.`expired`='0' AND p.`id` IN (" . $property_ids . ")";
     $properties = $wpl_property->search($query);
     /** plisting fields **/
     $plisting_fields = $wpl_property->get_plisting_fields();
     $this->wpl_properties = array();
     foreach ($properties as $property) {
         $this->wpl_properties[$property->id] = $wpl_property->full_render($property->id, $plisting_fields, $property);
     }
     parent::render($this->tpl_path, 'infowindow');
     exit;
 }
Example #2
0
 /**
  * How to display the widget on the screen.
  */
 public function widget($args, $instance)
 {
     $this->instance = $instance;
     $this->widget_id = $this->number;
     if ($this->widget_id < 0) {
         $this->widget_id = abs($this->widget_id) + 1000;
     }
     $this->widget_uq_name = 'wplc' . $this->widget_id;
     $widget_id = $this->widget_id;
     $this->css_class = isset($instance['data']['css_class']) ? $instance['data']['css_class'] : '';
     /** add main scripts **/
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-slider');
     /** render properties **/
     $query = self::query($instance);
     $model = new wpl_property();
     $properties = $model->search($query);
     /** return if no property found **/
     if (!count($properties)) {
         return;
     }
     $plisting_fields = $model->get_plisting_fields();
     $wpl_properties = array();
     $render_params['wpltarget'] = isset($instance['wpltarget']) ? $instance['wpltarget'] : 0;
     foreach ($properties as $property) {
         $wpl_properties[$property->id] = $model->full_render($property->id, $plisting_fields, $property, $render_params);
     }
     echo $args['before_widget'];
     $title = apply_filters('widget_title', $instance['title']);
     if (trim($title) != '') {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     $layout = 'widgets.carousel.tmpl.' . $instance['layout'];
     $layout = _wpl_import($layout, true, true);
     if (!wpl_file::exists($layout)) {
         $layout = _wpl_import('widgets.carousel.tmpl.default', true, true);
     } elseif (wpl_file::exists($layout)) {
         require $layout;
     } else {
         echo __('Widget Layout Not Found!', WPL_TEXTDOMAIN);
     }
     echo $args['after_widget'];
 }