Skip to content

Commit

Permalink
Merge pull request #11 from oveleon/develop
Browse files Browse the repository at this point in the history
Contao 5.1 support
  • Loading branch information
zoglo authored Jun 1, 2023
2 parents 0f1b8d5 + 73d6ff1 commit d245050
Show file tree
Hide file tree
Showing 64 changed files with 1,808 additions and 2,086 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Composer
/composer.lock
/vendor/

# PhpUnit
/.phpunit.result.cache
/phpunit.xml

# IDE
/.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

---

> Working with **Contao 4.9** and up to **Contao 4.13** (PHP ^7.4 and PHP 8)
> Working with **Contao 4.13** and **Contao 5.1** (PHP ^8.1)
---

Expand Down
106 changes: 67 additions & 39 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
{
"name": "oveleon/contao-recommendation-bundle",
"type": "contao-bundle",
"description": "Recommendation integration for Contao 4 Open Source CMS",
"keywords": ["contao","recommendation-bundle"],
"homepage": "https://www.oveleon.de/",
"license": "MIT",
"authors": [
{
"name": "Oveleon",
"homepage": "https://oveleon.de/",
"role": "Developer"
}
],
"require": {
"php": "^7.4 || ^8.0",
"contao/core-bundle":"^4.9"
"name": "oveleon/contao-recommendation-bundle",
"type": "contao-bundle",
"description": "Recommendation integration for Contao Open Source CMS",
"keywords": [
"contao",
"recommendation-bundle",
"recommendation",
"reviews"
],
"homepage": "https://www.oveleon.de/",
"license": "MIT",
"authors": [
{
"name": "Oveleon",
"homepage": "https://oveleon.de/",
"role": "Developer"
},
"require-dev": {
"contao/manager-plugin": "^2.0"
{
"name": "Sebastian Zoglowek",
"homepage": "https://github.com/zoglo",
"role": "Developer"
},
"conflict": {
"contao/core": "*",
"contao/manager-plugin": "<2.0 || >=3.0"
{
"name": "Fabian Ekert",
"homepage": "https://github.com/eki89",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"contao/core-bundle": "^4.13 || ^5.1"
},
"require-dev": {
"contao/manager-plugin": "^2.3.1",
"contao/test-case": "^5.1",
"phpunit/phpunit": "^9.5",
"symfony/http-client": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0"
},
"conflict": {
"contao/core": "*",
"contao/manager-plugin": "<2.0 || >=3.0"
},
"suggest": {
"oveleon/contao-google-recommendation-bundle": "This bundle imports Google reviews into the contao-recommendation-bundle"
},
"autoload": {
"psr-4": {
"Oveleon\\ContaoRecommendationBundle\\": "src/"
},
"autoload": {
"psr-4": {
"Oveleon\\ContaoRecommendationBundle\\": "src/"
},
"classmap": [
"src/Resources/contao/"
],
"exclude-from-classmap": [
"src/Resources/contao/config/",
"src/Resources/contao/dca/",
"src/Resources/contao/languages/",
"src/Resources/contao/templates/"
]
"classmap": [
"contao/"
],
"exclude-from-classmap": [
"contao/config/",
"contao/dca/",
"contao/languages/",
"contao/templates/"
]
},
"extra": {
"branch-alias": {
"dev-main": "1.3.x-dev"
},
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
},
"contao-manager-plugin": "Oveleon\\ContaoRecommendationBundle\\ContaoManager\\Plugin"
"contao-manager-plugin": "Oveleon\\ContaoRecommendationBundle\\ContaoManager\\Plugin"
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"contao/manager-plugin": true
}
}
}
9 changes: 9 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: true

Oveleon\ContaoRecommendationBundle\:
resource: '../src/'
exclude: '../src/{Model,DependencyInjection,Resources}'
41 changes: 41 additions & 0 deletions contao/config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

use Contao\ArrayUtil;
use Oveleon\ContaoRecommendationBundle\ModuleRecommendationForm;
use Oveleon\ContaoRecommendationBundle\ModuleRecommendationList;
use Oveleon\ContaoRecommendationBundle\ModuleRecommendationReader;
use Oveleon\ContaoRecommendationBundle\Model\RecommendationArchiveModel;
use Oveleon\ContaoRecommendationBundle\Model\RecommendationModel;

// Back end modules
ArrayUtil::arrayInsert($GLOBALS['BE_MOD']['content'], 5, [
'recommendation' => [
'tables' => ['tl_recommendation_archive', 'tl_recommendation']
]
]);

ArrayUtil::arrayInsert($GLOBALS['BE_MOD']['system'], 3, [
'recommendation_settings' => [
'tables' => ['tl_recommendation_settings'],
'hideInNavigation' => true
]
]);

// Front end modules
ArrayUtil::arrayInsert($GLOBALS['FE_MOD'], 2, [
'recommendation' => [
'recommendationform' => ModuleRecommendationForm::class,
'recommendationlist' => ModuleRecommendationList::class,
'recommendationreader' => ModuleRecommendationReader::class
]
]);

// Add permissions
$GLOBALS['TL_PERMISSIONS'][] = 'recommendations';
$GLOBALS['TL_PERMISSIONS'][] = 'recommendationp';

// Models
$GLOBALS['TL_MODELS']['tl_recommendation'] = RecommendationModel::class;
$GLOBALS['TL_MODELS']['tl_recommendation_archive'] = RecommendationArchiveModel::class;
Loading

0 comments on commit d245050

Please sign in to comment.