Skip to content

Commit

Permalink
version 0.1.7 / 0.2.7 imported
Browse files Browse the repository at this point in the history
  • Loading branch information
pinhead84 committed Nov 27, 2014
1 parent 056f6d0 commit 735964a
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 56 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OpenEstate-PHP-Wrapper for Joomla 0.1.6 / 0.2.6
OpenEstate-PHP-Wrapper for Joomla 0.1.7 / 0.2.7
===============================================

This extension integrates [OpenEstate-PHP-Export](https://github.com/OpenEstate/OpenEstate-PHP-Export)
Expand Down Expand Up @@ -34,6 +34,12 @@ Webseite integriert werden.
Changelog
---------

### 0.1.7 / 0.2.7

- make use of meta elements, that were specified for the menu entry
- put the configured `$MetaDescriptionTexts` from `myconfig.php` into the meta
`description` element of property listing pages

### 0.1.6 / 0.2.6

- Some smaller fixes
Expand Down
4 changes: 2 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

NAME="com_openestate"
VERSION15="0.1.6"
VERSION25="0.2.6"
VERSION15="0.1.7"
VERSION25="0.2.7"
PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

rm -Rf $PROJECT_DIR/release
Expand Down
4 changes: 2 additions & 2 deletions src/joomla-1.5/com_openestate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<!DOCTYPE install SYSTEM "http://dev.joomla.org/xml/1.5/component-install.dtd">
<install type="component" version="1.5">
<name>OpenEstate</name>
<creationDate>January 2012</creationDate>
<creationDate>October 2012</creationDate>
<author>Andreas Rudolph, Walter Wagner</author>
<authorEmail>info@openindex.de</authorEmail>
<authorUrl>http://openestate.org</authorUrl>
<copyright>(C) 2010-2012 All rights reserved.</copyright>
<license>GNU/GPL3</license>
<version>0.1.6</version>
<version>0.1.7</version>
<description><![CDATA[<h2>OpenEstate-PHP-Wrapper</h2><p>This component integrates PHP-exported properties from OpenEstate-ImmoTool into Joomla. You can find further informations at <a href="http://openestate.org" target="_blank">OpenEstate.org</a></p>]]></description>

<!-- Site Main File Copy Section -->
Expand Down
83 changes: 55 additions & 28 deletions src/joomla-1.5/openestate.wrapper.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php
/**
* OpenEstate-PHP-Wrapper für Joomla.
* $Id: openestate.wrapper.php 1709 2012-08-15 15:00:58Z andy $
* $Id: openestate.wrapper.php 1873 2012-10-24 20:29:04Z andy $
*
* @package OpenEstate
* @author Andreas Rudolph & Walter Wagner
* @copyright 2010-2012, OpenEstate.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

//error_reporting( E_ALL );
//ini_set('display_errors','1');

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

Expand Down Expand Up @@ -126,6 +129,8 @@ function parseValuesFromTxt( &$txt ) {
}

function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
$document =& JFactory::getDocument();

// Script ermitteln
$wrap = (isset($_REQUEST['wrap']) && is_string($_REQUEST['wrap']))?
$_REQUEST['wrap']: $defaultView;
Expand Down Expand Up @@ -172,14 +177,12 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
// vorgegebene Filter-Kriterien mit der Anfrage zusammenführen
if (!isset($_REQUEST[ 'wrap' ]) || isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) {
$filters = OpenEstateWrapper::parseValuesFromTxt( $params->get( 'filter' ) );
if (is_array($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;
}
foreach ($filters as $filter=>$value) {
if (!isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ]) || !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 @@ -193,32 +196,43 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
//ob_clean();
ob_end_clean();

// Stylesheets
$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)
$stylesheets[] = $setup->AdditionalStylesheet;
// Konfiguration ermitteln
$setup = null;
if ($wrap=='expose') {
$setup = new immotool_setup_expose();
if (is_callable(array('immotool_myconfig', 'load_config_expose'))) immotool_myconfig::load_config_expose( $setup );
}
else {
$setup = new immotool_setup_index();
if (is_callable(array('immotool_myconfig', 'load_config_index'))) immotool_myconfig::load_config_index( $setup );
}

// Nachträgliche Bearbeitung am Dokument
$document = &JFactory::getDocument();
$lang = (isset($_REQUEST[ IMMOTOOL_PARAM_LANG ]))? $_REQUEST[ IMMOTOOL_PARAM_LANG ]: $params->get( 'lang' );
if (is_string($lang)) {
$document->setLanguage( $lang );
$document->setMetaData( 'language', $lang );
}

// Stylesheets registrieren
$stylesheets = array( IMMOTOOL_BASE_URL . 'style.php?wrapped=1' );
if (is_string($setup->AdditionalStylesheet) && strlen($setup->AdditionalStylesheet)>0) {
$stylesheets[] = $setup->AdditionalStylesheet;
}
foreach ($stylesheets as $stylesheet) {
$document->addStyleSheet( $stylesheet );
}

// Nachträgliche Bearbeitung am Dokument, Exposéansicht
$metaDescription = null;
$metaKeywords = null;
if ($wrap=='expose') {
$exposeId = (isset($_REQUEST[ IMMOTOOL_PARAM_EXPOSE_ID ]))? $_REQUEST[ IMMOTOOL_PARAM_EXPOSE_ID ]: null;
$exposeObj = (is_string($exposeId))? immotool_functions::get_object( $exposeId ): null;
$exposeTxt = (is_string($exposeId))? immotool_functions::get_text( $exposeId ): null;
if (is_array($exposeObj)) {

// Titel aus Immobilie übernehmen
// Titel der Immobilie ins Dokument übernehmen
$title = (is_string($lang) && isset($exposeObj['title'][$lang]))? $exposeObj['title'][$lang]: null;
if (is_string($title)) {
$title = trim( strip_tags( html_entity_decode( $title, ENT_NOQUOTES, $setup->Charset ) ) );
Expand All @@ -228,24 +242,37 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
if (is_array($exposeTxt)) {

// Keywords aus Immobilie übernehmen
$keywords = (is_string($lang) && isset($exposeTxt['keywords'][$lang]))? $exposeTxt['keywords'][$lang]: null;
if (is_string($keywords)) {
$keywords = trim( strip_tags( html_entity_decode( $keywords, ENT_NOQUOTES, $setup->Charset ) ) );
$document->setMetaData( 'keywords', $keywords );
$txt = (is_string($lang) && isset($exposeTxt['keywords'][$lang]))? $exposeTxt['keywords'][$lang]: null;
if (is_string($txt)) {
$metaKeywords = trim( strip_tags( html_entity_decode( $txt, ENT_NOQUOTES, $setup->Charset ) ) );
}

// Description aus Immobilie übernehmen
$description = (is_string($lang) && isset($exposeTxt['short_description'][$lang]))? $exposeTxt['short_description'][$lang]: null;
if (is_null($description)) {
$description = (is_string($lang) && isset($exposeTxt['kurz_beschr'][$lang]))? $exposeTxt['kurz_beschr'][$lang]: null;
}
if (is_string($description)) {
$description = trim( strip_tags( html_entity_decode( $description, ENT_NOQUOTES, $setup->Charset ) ) );
$document->setMetaData( 'description', $description );
if (is_array($setup->MetaDescriptionTexts)) {
foreach ($setup->MetaDescriptionTexts as $attrib) {
$txt = (isset($objectTexts[$attrib][$lang])) ? $objectTexts[$attrib][$lang] : null;
if (is_string($txt) && strlen(trim($txt))>0) {
$metaDescription = trim( strip_tags( html_entity_decode( $txt, ENT_NOQUOTES, $setup->Charset ) ) );
break;
}
else {
$txt = null;
}
}
}
}
}

// Meta-Description ggf. ins Dokument übernehmen
if (is_string($metaDescription) && strlen(trim($metaDescription))>0) {
$document->setMetaData( 'description', trim($metaDescription) );
}

// Meta-Keywords ggf. ins Dokument übernehmen
if (is_string($metaKeywords) && strlen(trim($metaKeywords))>0) {
$document->setMetaData( 'keywords', trim($metaKeywords) );
}

// Ausgabe erzeugen
return immotool_functions::wrap_page( $page, $wrap, $scriptName, IMMOTOOL_BASE_URL, array(), $hiddenParams );
}
Expand Down
4 changes: 2 additions & 2 deletions src/joomla-2.5/openestate.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="1.6.0" method="upgrade" client="site">
<name>COM_OPENESTATE</name>
<creationDate>January 2012</creationDate>
<creationDate>October 2012</creationDate>
<author>Andreas Rudolph, Walter Wagner</author>
<authorEmail>info@openindex.de</authorEmail>
<authorUrl>http://openestate.org</authorUrl>
<copyright>(C) 2010-2012 All rights reserved.</copyright>
<license>GNU/GPL3</license>
<version>0.2.6</version>
<version>0.2.7</version>
<description>COM_OPENESTATE_DESCRIPTION</description>
<updateservers>
<server type="extension" priority="1" name="openestate.org">http://wiki.openestate.org/mediawiki/images/e/e9/Joomla25_extension.xml</server>
Expand Down
78 changes: 57 additions & 21 deletions src/joomla-2.5/site/openestate.wrapper.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php
/**
* OpenEstate-PHP-Wrapper für Joomla.
* $Id: openestate.wrapper.php 1708 2012-08-15 15:00:41Z andy $
* $Id: openestate.wrapper.php 1872 2012-10-24 20:27:48Z andy $
*
* @package OpenEstate
* @author Andreas Rudolph & Walter Wagner
* @copyright 2010-2012, OpenEstate.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

//error_reporting( E_ALL );
//ini_set('display_errors','1');

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

Expand Down Expand Up @@ -138,6 +141,11 @@ function parseValuesFromTxt( &$txt ) {
}

function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
$document =& JFactory::getDocument();
$app =& JFactory::getApplication();
$menus = (is_object($app))? $app->getMenu(): null;
$menu = (is_object($menus))? $menus->getActive(): null;

// Script ermitteln
$wrap = (isset($_REQUEST['wrap']) && is_string($_REQUEST['wrap']))?
$_REQUEST['wrap']: $defaultView;
Expand Down Expand Up @@ -186,7 +194,7 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
$filters = OpenEstateWrapper::parseValuesFromTxt( $params->get( 'filter' ) );
if (is_array($filters)) {
foreach ($filters as $filter=>$value) {
if (!is_array($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) {
if (!isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ]) || !is_array($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ])) {
$_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ] = array();
}
if (!isset($_REQUEST[ IMMOTOOL_PARAM_INDEX_FILTER ][$filter])) {
Expand All @@ -205,32 +213,47 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
//ob_clean();
ob_end_clean();

// Stylesheets
$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)
$stylesheets[] = $setup->AdditionalStylesheet;
// Konfiguration ermitteln
$setup = null;
if ($wrap=='expose') {
$setup = new immotool_setup_expose();
if (is_callable(array('immotool_myconfig', 'load_config_expose'))) immotool_myconfig::load_config_expose( $setup );
}
else {
$setup = new immotool_setup_index();
if (is_callable(array('immotool_myconfig', 'load_config_index'))) immotool_myconfig::load_config_index( $setup );
}

// Nachträgliche Bearbeitung am Dokument
$document = &JFactory::getDocument();
$lang = (isset($_REQUEST[ IMMOTOOL_PARAM_LANG ]))? $_REQUEST[ IMMOTOOL_PARAM_LANG ]: $params->get( 'lang' );
if (is_string($lang)) {
$document->setLanguage( $lang );
$document->setMetaData( 'language', $lang );
}

// Stylesheets registrieren
$stylesheets = array( IMMOTOOL_BASE_URL . 'style.php?wrapped=1' );
if (is_string($setup->AdditionalStylesheet) && strlen($setup->AdditionalStylesheet)>0) {
$stylesheets[] = $setup->AdditionalStylesheet;
}
foreach ($stylesheets as $stylesheet) {
$document->addStyleSheet( $stylesheet );
}

// Meta-Description des Menü-Eintrages ermitteln
$metaDescription = (is_object($menu))? $menu->params->get('menu-meta_description'): null;

// Meta-Keywords des Menü-Eintrages ermitteln
$metaKeywords = (is_object($menu))? $menu->params->get('menu-meta_keywords'): null;

// Nachträgliche Bearbeitung am Dokument, Exposéansicht
if ($wrap=='expose') {
$exposeId = (isset($_REQUEST[ IMMOTOOL_PARAM_EXPOSE_ID ]))? $_REQUEST[ IMMOTOOL_PARAM_EXPOSE_ID ]: null;
$exposeObj = (is_string($exposeId))? immotool_functions::get_object( $exposeId ): null;
$exposeTxt = (is_string($exposeId))? immotool_functions::get_text( $exposeId ): null;
if (is_array($exposeObj)) {

// Titel aus Immobilie übernehmen
// Titel der Immobilie ins Dokument übernehmen
$title = (is_string($lang) && isset($exposeObj['title'][$lang]))? $exposeObj['title'][$lang]: null;
if (is_string($title)) {
$title = trim( strip_tags( html_entity_decode( $title, ENT_NOQUOTES, $setup->Charset ) ) );
Expand All @@ -240,24 +263,37 @@ function wrap( $defaultView, $scriptName, &$params, &$hiddenParams ) {
if (is_array($exposeTxt)) {

// Keywords aus Immobilie übernehmen
$keywords = (is_string($lang) && isset($exposeTxt['keywords'][$lang]))? $exposeTxt['keywords'][$lang]: null;
if (is_string($keywords)) {
$keywords = trim( strip_tags( html_entity_decode( $keywords, ENT_NOQUOTES, $setup->Charset ) ) );
$document->setMetaData( 'keywords', $keywords );
$txt = (is_string($lang) && isset($exposeTxt['keywords'][$lang]))? $exposeTxt['keywords'][$lang]: null;
if (is_string($txt)) {
$metaKeywords = trim( strip_tags( html_entity_decode( $txt, ENT_NOQUOTES, $setup->Charset ) ) );
}

// Description aus Immobilie übernehmen
$description = (is_string($lang) && isset($exposeTxt['short_description'][$lang]))? $exposeTxt['short_description'][$lang]: null;
if (is_null($description)) {
$description = (is_string($lang) && isset($exposeTxt['kurz_beschr'][$lang]))? $exposeTxt['kurz_beschr'][$lang]: null;
}
if (is_string($description)) {
$description = trim( strip_tags( html_entity_decode( $description, ENT_NOQUOTES, $setup->Charset ) ) );
$document->setMetaData( 'description', $description );
if (is_array($setup->MetaDescriptionTexts)) {
foreach ($setup->MetaDescriptionTexts as $attrib) {
$txt = (isset($objectTexts[$attrib][$lang])) ? $objectTexts[$attrib][$lang] : null;
if (is_string($txt) && strlen(trim($txt))>0) {
$metaDescription = trim( strip_tags( html_entity_decode( $txt, ENT_NOQUOTES, $setup->Charset ) ) );
break;
}
else {
$txt = null;
}
}
}
}
}

// Meta-Description ggf. ins Dokument übernehmen
if (is_string($metaDescription) && strlen(trim($metaDescription))>0) {
$document->setMetaData( 'description', trim($metaDescription) );
}

// Meta-Keywords ggf. ins Dokument übernehmen
if (is_string($metaKeywords) && strlen(trim($metaKeywords))>0) {
$document->setMetaData( 'keywords', trim($metaKeywords) );
}

// Ausgabe erzeugen
return immotool_functions::wrap_page( $page, $wrap, $scriptName, IMMOTOOL_BASE_URL, array(), $hiddenParams );
}
Expand Down

0 comments on commit 735964a

Please sign in to comment.