-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from contao-estatemanager/develop
Merge dev-master
- Loading branch information
Showing
106 changed files
with
7,164 additions
and
3,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
$header = <<<EOF | ||
This file is part of Contao EstateManager. | ||
@link https://www.contao-estatemanager.com/ | ||
@source https://github.com/contao-estatemanager/core | ||
@copyright Copyright (c) 2020 Oveleon GbR (https://www.oveleon.de) | ||
EOF; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('Resources') | ||
->in([__DIR__.'/src', __DIR__.'/tests']) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
'align_multiline_comment' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'combine_consecutive_issets' => true, | ||
'combine_consecutive_unsets' => true, | ||
'compact_nullable_typehint' => true, | ||
'general_phpdoc_annotation_remove' => [ | ||
'expectedException', | ||
'expectedExceptionMessage', | ||
], | ||
'header_comment' => ['header' => $header], | ||
'heredoc_to_nowdoc' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'native_function_invocation' => [ | ||
'include' => ['@compiler_optimized'], | ||
], | ||
'no_null_property_initialization' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_unreachable_default_argument_value' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'php_unit_strict' => true, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_types_order' => [ | ||
'null_adjustment' => 'always_last', | ||
'sort_algorithm' => 'none', | ||
], | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
]) | ||
->setFinder($finder) | ||
->setRiskyAllowed(true) | ||
->setUsingCache(false) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
<br/> | ||
<p align="center"><img src="https://www.contao-estatemanager.com/files/theme/images/logo/logo_dunkel.png"></p> | ||
<br/> | ||
<p align="center"> | ||
<small>The Contao EstateManager is an open source extension for Contao CMS that allows you to import real estate assets from existing ecosystems, display them extensively or manage properties directly in Contao. Visit the <a href="https://www.contao-estatemanager.com" target="_blank">project website</a> for more information.</small> | ||
</p> | ||
<br/> | ||
<p align="center"> | ||
<a href="https://www.oveleon.de"><img src="https://img.shields.io/badge/oveleon-maintained-83aa0e?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAUCAYAAABvVQZ0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA/xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuM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Puedouq5rilG40JPxAuUmeX84tGTkwyXsghOWYQmKoFazExzVDXFIgEeazcPV9TCnzGplRiHMl7KgCWYghy9vQAasMEfkTqQarJ9JFWw0YlhJFv2rUv8tdKiDhTib0eiHQyhOsR2xyjlp0BF5MBELdr6WohE++X6raBOz6PwWCfiCOLzDN8sRGICYyfdrgBA8Q2kmfnzQJirghlw+XZANUQ5qFmHY52R9/9lWCXjBpbRPcaubDhtHsRoOuN1reAO/1H/PpzfdaqrggzOLK7YFD6zPMqeL9at0gwWZuKa0i3hkuZf1E6tteqEZnmCRbZVwxPIOn3V83litaogzbrPuhDOIwbyUd8q8SavBOpl0rnxROadFugkFVoOJAx1h4rRJvw9e2b9u3ACrY9ENAZaD/L/E0aiHMbbfQc3v7bFxWAchqptHAAqN3HQrM0JcsXFohzzexWPYk5N+BBgAix5VyvzRZbwAAAAASUVORK5CYII=" alt="Oveleon"></a> | ||
<a href="https://github.com/contao-estatemanager/core"><img src="https://img.shields.io/github/license/contao-estatemanager/core?color=1268cc&style=flat-square"/></a> | ||
<!--<a href="https://github.com/contao-estatemanager/core"><img src="https://img.shields.io/github/package-json/v/contao-estatemanager/core?style=flat-square"/></a> | ||
<a href="https://github.com/contao-estatemanager/core"><img src="https://img.shields.io/packagist/dt/contao-estatemanager/core?style=flat-square"/></a>--> | ||
</p> | ||
|
||
## Extensions | ||
- [Extension catalogue][4] | ||
|
||
# About | ||
EstateManager is an Open Source Extension for Contao CMS, which allows you to import and extensively display real estate assets from existing ecosystems. Visit the [project website][1] for more information. | ||
## Documentation | ||
- [Documentation][2] | ||
- [Help with documentation][3] | ||
|
||
[1]: https://www.contao-estatemanager.com | ||
## Support | ||
- [Help with translation][5] | ||
- [Report an issue][6] | ||
|
||
[2]: https://docs.contao-estatemanager.com | ||
[3]: https://github.com/contao-estatemanager/docs/pulls | ||
[4]: https://www.contao-estatemanager.com/store.html | ||
[5]: https://www.transifex.com/oveleon/contao-estatemanager/ | ||
[6]: https://github.com/contao-estatemanager/core/issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.0/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true"> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
<testsuites> | ||
<testsuite name="Contao EstateManager"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory>./src</directory> | ||
<exclude> | ||
<directory>./src/Resources</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of Contao EstateManager. | ||
* | ||
* @link https://www.contao-estatemanager.com/ | ||
* @source https://github.com/contao-estatemanager/core | ||
* @copyright Copyright (c) 2019 Oveleon GbR (https://www.oveleon.de) | ||
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html | ||
*/ | ||
|
||
namespace ContaoEstateManager\EstateManager\DependencyInjection; | ||
|
||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Extension\Extension; | ||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | ||
|
||
class EstateManagerExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new YamlFileLoader( | ||
$container, | ||
new FileLocator(__DIR__ . '/../Resources/config') | ||
); | ||
|
||
$loader->load('listener.yml'); | ||
$loader->load('services.yml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of Contao EstateManager. | ||
* | ||
* @link https://www.contao-estatemanager.com/ | ||
* @source https://github.com/contao-estatemanager/core | ||
* @copyright Copyright (c) 2019 Oveleon GbR (https://www.oveleon.de) | ||
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html | ||
*/ | ||
|
||
namespace ContaoEstateManager\EstateManager\EventListener; | ||
|
||
use Contao\CoreBundle\Framework\ContaoFramework; | ||
use Contao\Input; | ||
use ContaoEstateManager\RealEstate; | ||
use ContaoEstateManager\RealEstateModel; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class InsertTagsListener | ||
{ | ||
private const SUPPORTED_TAGS = [ | ||
'realestate' | ||
]; | ||
|
||
/** | ||
* @var ContaoFramework | ||
*/ | ||
private $framework; | ||
|
||
public function __construct(ContaoFramework $framework) | ||
{ | ||
$this->framework = $framework; | ||
} | ||
|
||
/** | ||
* @return string|false | ||
*/ | ||
public function onReplaceInsertTags(string $tag, bool $useCache, $cacheValue, array $flags) | ||
{ | ||
$elements = explode('::', $tag); | ||
$key = strtolower($elements[0]); | ||
|
||
if (\in_array($key, self::SUPPORTED_TAGS, true)) { | ||
return $this->replaceRealEstateInsertTags($key, $elements, $flags); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
private function replaceRealEstateInsertTags(string $insertTag, array $elements, array $flags): string | ||
{ | ||
$this->framework->initialize(); | ||
|
||
/** @var RealEstateModel $adapter */ | ||
$adapter = $this->framework->getAdapter(RealEstateModel::class); | ||
|
||
if (is_numeric($elements[1])) | ||
{ | ||
if (null !== ($model = $adapter->findPublishedByIdOrAlias($elements[1]))) | ||
{ | ||
$elements[1] = $elements[2]; | ||
} | ||
} | ||
elseif (Input::get('items')) | ||
{ | ||
$model = $adapter->findPublishedByIdOrAlias(Input::get('items')); | ||
} | ||
|
||
if ($model === null) | ||
{ | ||
return ''; | ||
} | ||
|
||
$realEstate = new RealEstate($model); | ||
|
||
switch ($insertTag) { | ||
case 'realestate': | ||
return $realEstate->{$elements[1]} ?: ''; | ||
} | ||
|
||
return ''; | ||
} | ||
} |
Oops, something went wrong.