Skip to content

Commit

Permalink
version 0.4.3 imported
Browse files Browse the repository at this point in the history
  • Loading branch information
pinhead84 committed Nov 26, 2014
1 parent ca5349c commit 6c10cd6
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 49 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/OpenEstatePhpWrapper.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
}

/**
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
61 changes: 25 additions & 36 deletions src/action.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,21 +64,10 @@
if ($wrap=='expose') {
$wrap = 'expose';
$script = 'expose.php';
//echo '<pre>' . print_r($_REQUEST, true) . '</pre>'; return;

// Standard-Parameter ggf. setzen
//echo '<pre>';
//print_r($_REQUEST);
//echo '</pre>';
$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']))
Expand All @@ -90,20 +79,10 @@
else {
$wrap = 'index';
$script = 'index.php';
//echo '<pre>' . print_r($_REQUEST, true) . '</pre>'; return;

// Standard-Parameter ggf. setzen
//echo '<pre>';
//print_r($_REQUEST);
//echo '</pre>';
$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'];
Expand All @@ -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 '<pre>';
//print_r( $filters );
//echo '</pre>';
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;
}
}
}
}
Expand All @@ -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
Expand Down
30 changes: 22 additions & 8 deletions src/action.defaultadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));

Expand Down Expand Up @@ -69,7 +69,11 @@
$testResult .= '<span style="color:green;">version ' . IMMOTOOL_SCRIPT_VERSION . '</span>';

$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)) {
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -179,10 +194,9 @@
$filters[] = $filterWidget;
$filterIds[] = '\'filter_' . $key . '\'';
}
if (count($filters)>0) $this->smarty->assign('input_index_filters', implode( '&nbsp;', $filters ) );
if (count($filters)>0) $this->smarty->assign('input_index_filters', implode( '<br/>', $filters ) );
if (count($filterIds)>0) $this->smarty->assign('filter_ids', implode( ', ', $filterIds ) );


// expose, view
$views = array(
$this->Lang('view_details') => 'details',
Expand Down Expand Up @@ -230,15 +244,15 @@
//$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',''),
50,
255,
'style="width:75%;"',
$this->Lang('title_wrap_path_help') . '<br/>' ) );
$smarty->assign('input_wrap_url',$this->CreateInputTextWithLabel(
$smarty->assign('input_wrap_url',$this->CreateInputTextWithLabel(
$id,
'wrap_url',
$this->GetPreference('wrap_url',''),
Expand Down

0 comments on commit 6c10cd6

Please sign in to comment.