| @@ -29,8 +29,9 @@ | ||
| 29 | 29 | \Elementor\Controls_Manager::add_tab( |
| 30 | 30 | 'tab_conf', |
| 31 | 31 | esc_html__('Settings', 'wpdirectorykit') |
| 32 | 32 | ); |
| 33 | + | |
| 33 | 34 | |
| 34 | 35 | \Elementor\Controls_Manager::add_tab( |
| 35 | 36 | 'tab_layout', |
| 36 | 37 | esc_html__('Layout', 'wpdirectorykit') |
| @@ -131,9 +132,9 @@ | ||
| 131 | 132 | |
| 132 | 133 | $locations_ids = array(); |
| 133 | 134 | foreach($this->data['settings']['conf_custom_results'] as $location) { |
| 134 | 135 | if(isset($location['location_id']) && !empty($location['location_id'])) { |
| 135 | - $locations_ids [] = $location['location_id']; | |
| 136 | + $locations_ids [] = (int)$location['location_id']; | |
| 136 | 137 | } |
| 137 | 138 | } |
| 138 | 139 | |
| 139 | 140 | /* where in */ |
| @@ -150,16 +151,14 @@ | ||
| 150 | 151 | |
| 151 | 152 | } else { |
| 152 | 153 | $order_by = NULL; |
| 153 | 154 | if(!empty($this->data['settings']['conf_order_by'])) |
| 154 | - $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']; | |
| 155 | - | |
| 155 | + $order_by = wdk_esc_sql_order_by($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], $this->WMVC->{$controller.'_m'}->getAllowedOrderBy()); | |
| 156 | 156 | $where = array(); |
| 157 | 157 | if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') { |
| 158 | 158 | $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL; |
| 159 | 159 | } |
| 160 | - $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], NULL, $where, $order_by); | |
| 161 | - | |
| 160 | + $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination((!empty($this->data['settings']['conf_limit'])) ? $this->data['settings']['conf_limit'] : NULL, NULL, $where, $order_by); | |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | $this->data['is_edit_mode']= false; |
| 165 | 164 | if(Plugin::$instance->editor->is_edit_mode()) |
| @@ -164,9 +163,9 @@ | ||
| 164 | 163 | $this->data['is_edit_mode']= false; |
| 165 | 164 | if(Plugin::$instance->editor->is_edit_mode()) |
| 166 | 165 | $this->data['is_edit_mode']= true; |
| 167 | 166 | |
| 168 | - echo $this->view('wdk-locations-grid', $this->data); | |
| 167 | + $this->view('wdk-locations-grid', $this->data, true); | |
| 169 | 168 | } |
| 170 | 169 | |
| 171 | 170 | |
| 172 | 171 | private function generate_controls_conf() { |
| @@ -187,9 +186,9 @@ | ||
| 187 | 186 | $this->add_control( |
| 188 | 187 | 'conf_link', |
| 189 | 188 | [ |
| 190 | 189 | 'label' => __( 'Open results on page', 'wpdirectorykit' ), |
| 191 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 190 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 192 | 191 | 'default' => '', |
| 193 | 192 | 'options' => $pages |
| 194 | 193 | ] |
| 195 | 194 | ); |
| @@ -212,8 +211,9 @@ | ||
| 212 | 211 | 'important_note', |
| 213 | 212 | [ |
| 214 | 213 | 'label' => '', |
| 215 | 214 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 215 | + /* translators: 1: URL. */ | |
| 216 | 216 | 'raw' => wdk_sprintf(__( 'Edit Locations <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_location')), |
| 217 | 217 | 'content_classes' => 'wdk_elementor_hint', |
| 218 | 218 | ] |
| 219 | 219 | ); |
| @@ -232,11 +232,12 @@ | ||
| 232 | 232 | $this->add_control( |
| 233 | 233 | 'conf_limit', |
| 234 | 234 | [ |
| 235 | 235 | 'label' => __( 'Limit Locations', 'wpdirectorykit' ), |
| 236 | + 'description' => __( 'Set 0 for unlimit', 'wpdirectorykit' ), | |
| 236 | 237 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 237 | - 'min' => 1, | |
| 238 | - 'max' => 50, | |
| 238 | + 'min' => 0, | |
| 239 | + 'max' => 500, | |
| 239 | 240 | 'step' => 1, |
| 240 | 241 | 'default' => 6, |
| 241 | 242 | 'separator' => 'before', |
| 242 | 243 | 'conditions' => [ |
| @@ -487,9 +488,9 @@ | ||
| 487 | 488 | 'min' => 0, |
| 488 | 489 | 'max' => 100, |
| 489 | 490 | ], |
| 490 | 491 | ], |
| 491 | - 'size_units' => [ 'px', 'vw' ], | |
| 492 | + 'size_units' => [ 'px','em', 'vw', '%', 'custom' ], | |
| 492 | 493 | 'default' => [ |
| 493 | 494 | 'size' => 350, |
| 494 | 495 | 'unit' => 'px', |
| 495 | 496 | ], |