diff --git a/README.md b/README.md index 8014ac1..aa4ee3e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -OpenEstate-PHP-Wrapper for CMSms 0.4.2 +OpenEstate-PHP-Wrapper for CMSms 0.4.3 ====================================== This module integrates [OpenEstate-PHP-Export](https://github.com/OpenEstate/OpenEstate-PHP-Export) @@ -73,6 +73,15 @@ Webseite integriert werden. Changelog --------- +### 0.4.3 + +- Configured options of a smarty tag are not taken into account under certain + conditions. + (see [Forum](http://board.openestate.org/viewtopic.php?f=7&t=8698)) +- Provide all available order options in the `Integration` tab on the module + administration page. + (see [Forum](http://board.openestate.org/viewtopic.php?f=7&t=8763#p12562)) + ### 0.4.2 - Reset filter selection, if a property page is accessed for the first time or diff --git a/src/OpenEstatePhpWrapper.module.php b/src/OpenEstatePhpWrapper.module.php index e6c140d..e0f5ed2 100644 --- a/src/OpenEstatePhpWrapper.module.php +++ b/src/OpenEstatePhpWrapper.module.php @@ -2,7 +2,7 @@ /** * PHP-Wrapper für CMSms. * Modul-Klasse, siehe http://www.cmsmadesimple.org/api/class_cms_module.html - * $Id: OpenEstatePhpWrapper.module.php 1111 2011-10-21 19:09:58Z andy $ + * $Id: OpenEstatePhpWrapper.module.php 1616 2012-07-03 08:11:12Z andy $ * * @author Andreas Rudolph & Walter Wagner * @copyright 2009-2011, OpenEstate.org @@ -61,7 +61,7 @@ function GetFriendlyName() { * @return string version number (can be something like 1.4rc1) */ function GetVersion() { - return '0.4.2'; + return '0.4.3'; } /** @@ -381,7 +381,7 @@ function SetParameters() { /* // Don't allow parameters other than the ones you've explicitly defined $this->RestrictUnknownParams(); - + // syntax for creating a parameter is parameter name, default value, description $this->CreateParameter('skeleton_id', -1, $this->Lang('help_skeleton_id')); // skeleton_id must be an integer @@ -399,7 +399,7 @@ function SetParameters() { /* * 4. Event Handling * - + Typical example: specify the originator, the event name, and whether or not the event is removable (used for one-time events) diff --git a/src/action.default.php b/src/action.default.php index 347f574..8b0cc9d 100644 --- a/src/action.default.php +++ b/src/action.default.php @@ -2,7 +2,7 @@ /** * PHP-Wrapper für CMSms. * Darstellung der Wrapper-Ausgabe auf der Webseite. - * $Id: action.default.php 1111 2011-10-21 19:09:58Z andy $ + * $Id: action.default.php 1616 2012-07-03 08:11:12Z andy $ * * @author Andreas Rudolph & Walter Wagner * @copyright 2009-2011, OpenEstate.org @@ -64,21 +64,10 @@ if ($wrap=='expose') { $wrap = 'expose'; $script = 'expose.php'; + //echo '
' . print_r($_REQUEST, true) . '
'; return; - // Standard-Parameter ggf. setzen - //echo '
';
-  //print_r($_REQUEST);
-  //echo '
'; - $defaultParams = array( 'wrap', IMMOTOOL_PARAM_LANG, IMMOTOOL_PARAM_EXPOSE_ID, IMMOTOOL_PARAM_EXPOSE_VIEW ); - $useDefaultParams = true; - foreach ($defaultParams as $param) { - if (isset($_REQUEST[ $param ])) { - $useDefaultParams = false; - break; - } - } - - if ($useDefaultParams) { + // Standard-Konfigurationswerte beim ersten Aufruf setzen + if (!isset($_REQUEST[ 'wrap' ])) { if (isset($params['lang'])) $_REQUEST[ IMMOTOOL_PARAM_LANG ] = $params['lang']; if (isset($params['id'])) @@ -90,20 +79,10 @@ else { $wrap = 'index'; $script = 'index.php'; + //echo '
' . print_r($_REQUEST, true) . '
'; return; - // Standard-Parameter ggf. setzen - //echo '
';
-  //print_r($_REQUEST);
-  //echo '
'; - $defaultParams = array( 'wrap', IMMOTOOL_PARAM_LANG, IMMOTOOL_PARAM_INDEX_VIEW, IMMOTOOL_PARAM_INDEX_MODE, IMMOTOOL_PARAM_INDEX_ORDER, IMMOTOOL_PARAM_INDEX_FILTER ); - $useDefaultParams = true; - foreach ($defaultParams 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($params['lang'])) $_REQUEST[ IMMOTOOL_PARAM_LANG ] = $params['lang']; @@ -119,20 +98,30 @@ 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'; + } - // Standard-Filter + // vorgegebene Filter-Kriterien mit der Anfrage zusammenführen + if (!isset($_REQUEST[ 'wrap' ]) || isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) { $filters = array(); foreach (array_keys($params) as $param) { - //echo $param . ' => ' . if (strtolower(substr($param, 0, strlen('filter_')))!='filter_') continue; $filterName = substr($param, strlen('filter_')); $filters[$filterName] = $params[$param]; } - //echo '
';
-    //print_r( $filters );
-    //echo '
'; - if (is_array($filters) && count($filters)>0) { - $_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ] = $filters; + 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; + } } } } @@ -148,7 +137,7 @@ $setup = new immotool_setup(); if (is_callable(array('immotool_myconfig', 'load_config_default'))) immotool_myconfig::load_config_default( $setup ); $stylesheets = array( IMMOTOOL_BASE_URL . 'style.php' ); -if (is_string($setup->AdditionalStylesheet) && strlen($setup->AdditionalStylesheet)>0) +if (is_string($setup->AdditionalStylesheet) && strlen($setup->AdditionalStylesheet)>0) $stylesheets[] = $setup->AdditionalStylesheet; // Ausgabe erzeugen diff --git a/src/action.defaultadmin.php b/src/action.defaultadmin.php index 50ff485..e56f0cb 100644 --- a/src/action.defaultadmin.php +++ b/src/action.defaultadmin.php @@ -2,7 +2,7 @@ /** * PHP-Wrapper für CMSms. * Darstellung des Formulars im Administrationsbereich. - * $Id: action.defaultadmin.php 897 2011-06-15 23:54:58Z andy $ + * $Id: action.defaultadmin.php 1616 2012-07-03 08:11:12Z andy $ * * @author Andreas Rudolph & Walter Wagner * @copyright 2009-2011, OpenEstate.org @@ -26,7 +26,7 @@ $tab_header = $this->StartTabHeaders(); -// general tab +// general tab $tab_header .= $this->SetTabHeader('general',$this->Lang('title_general'),('general' == $tab)?true:false); $this->smarty->assign('start_general_tab',$this->StartTab('general', $params)); @@ -69,7 +69,11 @@ $testResult .= 'version ' . IMMOTOOL_SCRIPT_VERSION . ''; $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'); + } $translations = null; $lang = immotool_functions::init_language( $setupIndex->DefaultLanguage, $setupIndex->DefaultLanguage, $translations ); if (!is_array($translations)) { @@ -136,7 +140,18 @@ // index, order, by $orders = array(); $defaultOrder = null; - foreach ($setupIndex->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) { if (is_null($defaultOrder)) $defaultOrder = $key; $orderObj = immotool_functions::get_order($key); $by = $orderObj->getTitle( $translations, $lang ); @@ -179,10 +194,9 @@ $filters[] = $filterWidget; $filterIds[] = '\'filter_' . $key . '\''; } - if (count($filters)>0) $this->smarty->assign('input_index_filters', implode( ' ', $filters ) ); + if (count($filters)>0) $this->smarty->assign('input_index_filters', implode( '
', $filters ) ); if (count($filterIds)>0) $this->smarty->assign('filter_ids', implode( ', ', $filterIds ) ); - // expose, view $views = array( $this->Lang('view_details') => 'details', @@ -230,7 +244,7 @@ //$smarty->assign('input_allow_add',$this->CreateInputCheckbox($id, 'allow_add', 1, // $this->GetPreference('allow_add','0')). $this->Lang('title_allow_add_help')); -$smarty->assign('input_wrap_path',$this->CreateInputTextWithLabel( +$smarty->assign('input_wrap_path',$this->CreateInputTextWithLabel( $id, 'wrap_path', $this->GetPreference('wrap_path',''), @@ -238,7 +252,7 @@ 255, 'style="width:75%;"', $this->Lang('title_wrap_path_help') . '
' ) ); -$smarty->assign('input_wrap_url',$this->CreateInputTextWithLabel( +$smarty->assign('input_wrap_url',$this->CreateInputTextWithLabel( $id, 'wrap_url', $this->GetPreference('wrap_url',''),