From c10f4ce86b9c037410639e946519eb24933834d6 Mon Sep 17 00:00:00 2001 From: Andreas Rudolph Date: Tue, 25 Nov 2014 19:26:09 +0100 Subject: [PATCH] version 0.2.4 imported --- README.md | 7 ++- src/openestate-php-wrapper.php | 89 ++++++++++++++++++++-------------- src/readme.txt | 8 ++- 3 files changed, 65 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 038f74f..4a969a7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -A WordPress plugin for the OpenEstate-PHP-Export 0.2.3 +A WordPress plugin for the OpenEstate-PHP-Export 0.2.4 ====================================================== This plugin integrates [OpenEstate-PHP-Export](https://github.com/OpenEstate/OpenEstate-PHP-Export) @@ -94,6 +94,11 @@ Screenshots Changelog --------- +### 0.2.4 + +- Predefined filters / orderings is handled incorrectly under certain circumstances. +- Show all available ordering-options within administration dashboard. + ### 0.2.3 - Filters are not correctly cleared, if the user switches between different property pages. diff --git a/src/openestate-php-wrapper.php b/src/openestate-php-wrapper.php index 09c92d8..df1d8f2 100644 --- a/src/openestate-php-wrapper.php +++ b/src/openestate-php-wrapper.php @@ -3,11 +3,11 @@ Plugin Name: OpenEstate PHP-Wrapper Plugin URI: http://wiki.openestate.org/PHP-Wrapper_-_Wordpress Description: This plugin integrates PHP-exported properties from OpenEstate-ImmoTool into WordPress. -Version: 0.2.3 +Version: 0.2.4 Author: Andreas Rudolph, Walter Wagner (OpenEstate.org) Author URI: http://openestate.org/ License: GPL3 -Id: $Id: openestate-php-wrapper.php 1113 2011-10-21 19:11:06Z andy $ +Id: $Id: openestate-php-wrapper.php 1620 2012-07-03 08:13:59Z andy $ */ add_action('init', 'openestate_wrapper_init'); @@ -64,12 +64,16 @@ function openestate_wrapper_setup() { // Wenn eine gültige ImmoTool-Umgebung konfiguriert ist, können weitere Einstellungen vorgenommen werden $setupIndex = null; - $setupExpose = null; + //$setupExpose = null; $setupTranslations = null; $setupLang = null; if ($environmentIsValid) { $setupIndex = new immotool_setup_index(); - $setupExpose = new immotool_setup_expose(); + //$setupExpose = new immotool_setup_expose(); + if (is_callable(array('immotool_functions', 'init_config'))) { + immotool_functions::init_config($setupIndex, 'load_config_index'); + //immotool_functions::init_config($setupExpose, 'load_config_expose'); + } $setupLang = immotool_functions::init_language( $setupIndex->DefaultLanguage, $setupIndex->DefaultLanguage, $setupTranslations ); if (!is_array($setupTranslations)) { $environmentErrors[] = __('error_no_translation_found', 'openestate-php-wrapper'); @@ -82,7 +86,7 @@ function openestate_wrapper_setup() {

OpenEstate PHP-Wrapper
- 0.2.2 + 0.2.4

@@ -281,7 +285,18 @@ function build_tag() OrderOptions as $key) { + $orderNames = array(); + if (!is_callable(array('immotool_functions', 'list_available_orders'))) { + // Mechanismus für ältere PHP-Exporte, um die registrierten Sortierungen zu verwenden + if (is_array($setupIndex->OrderOptions)) { + $orderNames = $setupIndex->OrderOptions; + } + } + else { + // alle verfügbaren Sortierungen verwenden + $orderNames = immotool_functions::list_available_orders(); + } + foreach ($orderNames as $key) { $orderObj = immotool_functions::get_order($key); //$by = $orderObj->getName(); $by = $orderObj->getTitle( $setupTranslations, $setupLang ); @@ -460,20 +475,10 @@ function openestate_wrapper_post_callback( $matches ) { if ($wrap=='expose') { $wrap = 'expose'; $script = 'expose.php'; + //echo '
' . print_r($_REQUEST, true) . '
'; return; - // Standard-Parameter ggf. setzen - //echo '
';
-    //print_r($_REQUEST);
-    //echo '
'; - $params = array( 'wrap', IMMOTOOL_PARAM_LANG, IMMOTOOL_PARAM_EXPOSE_ID, IMMOTOOL_PARAM_EXPOSE_VIEW ); - $useDefaultParams = true; - foreach ($params as $param) { - if (isset($_REQUEST[ $param ])) { - $useDefaultParams = false; - break; - } - } - if ($useDefaultParams) { + // Standard-Konfigurationswerte beim ersten Aufruf setzen + if (!isset($_REQUEST[ 'wrap' ])) { if (isset($settings['lang'])) $_REQUEST[ IMMOTOOL_PARAM_LANG ] = $settings['lang']; if (isset($settings['id'])) @@ -485,20 +490,10 @@ function openestate_wrapper_post_callback( $matches ) { else { $wrap = 'index'; $script = 'index.php'; + //echo '
' . print_r($_REQUEST, true) . '
'; return; - // Standard-Parameter ggf. setzen - //echo '
';
-    //print_r($_REQUEST);
-    //echo '
'; - $params = array( 'wrap', IMMOTOOL_PARAM_LANG, IMMOTOOL_PARAM_INDEX_VIEW, IMMOTOOL_PARAM_INDEX_MODE, IMMOTOOL_PARAM_INDEX_ORDER, IMMOTOOL_PARAM_INDEX_FILTER ); - $useDefaultParams = true; - foreach ($params as $param) { - if (isset($_REQUEST[ $param ])) { - $useDefaultParams = false; - break; - } - } - if ($useDefaultParams) { + // Standard-Konfigurationswerte beim ersten Aufruf setzen + if (!isset($_REQUEST[ 'wrap' ])) { $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER_CLEAR ] = '1'; if (isset($settings['lang'])) $_REQUEST[ IMMOTOOL_PARAM_LANG ] = $settings['lang']; @@ -506,10 +501,32 @@ function openestate_wrapper_post_callback( $matches ) { $_REQUEST[ IMMOTOOL_PARAM_INDEX_VIEW ] = $settings['view']; if (isset($settings['mode'])) $_REQUEST[ IMMOTOOL_PARAM_INDEX_MODE ] = $settings['mode']; - if (isset($settings['order_by']) && isset($settings['order_dir'])) - $_REQUEST[ IMMOTOOL_PARAM_INDEX_ORDER ] = $settings['order_by'].'-'.$settings['order_dir']; - if (isset($settings['filter'])) - $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ] = $settings['filter']; + if (isset($settings['order_by'])) { + $order = $settings['order_by']; + if (isset($settings['order_dir'])) $order .= '-' . $settings['order_dir']; + else $order .= '-asc'; + $_REQUEST[ IMMOTOOL_PARAM_INDEX_ORDER ] = $order; + } + } + + // Zurücksetzen der gewählten Filter + if (isset($_REQUEST[IMMOTOOL_PARAM_INDEX_RESET])) { + unset($_REQUEST[IMMOTOOL_PARAM_INDEX_RESET]); + $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ] = array(); + $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER_CLEAR ] = '1'; + } + + // vorgegebene Filter-Kriterien mit der Anfrage zusammenführen + if (!isset($_REQUEST[ 'wrap' ]) || isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) { + $filters = $settings['filter']; + foreach ($filters as $filter=>$value) { + if (!is_array($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) { + $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ] = array(); + } + if (!isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ][$filter])) { + $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ][$filter] = $value; + } + } } } diff --git a/src/readme.txt b/src/readme.txt index 1b01f9b..d25ca79 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -3,8 +3,8 @@ Contributors: OpenEstate Donate link: http://en.openestate.org/sponsors/ Tags: homes, listings, openestate, promote, properties, property, real estate, realestate, real-estate, realty, wrapper Requires at least: 3.0.0 -Tested up to: 3.2 -Stable tag: 0.2.3 +Tested up to: 3.4 +Stable tag: 0.2.4 This plugin integrates your properties from OpenEstate-ImmoTool into your WordPress blog. @@ -76,6 +76,10 @@ This plugin is focused on users of the freeware real-estate software [OpenEstate == Changelog == += 0.2.4 = +* Predefined filters / orderings is handled incorrectly under certain circumstances. +* Show all available ordering-options within administration dashboard. + = 0.2.3 = * Filters are not correctly cleared, if the user switches between different property pages.