Skip to content

Commit

Permalink
Initial commit for Contao 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hschottm committed Nov 30, 2018
1 parent f4cccd2 commit 669f3bd
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 58 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
.DS_Store
.svn
.svn
.git/
.settings/
.buildpath
.project
composer.lock
vendor
# Transifex
/.tx/
58 changes: 58 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

$header = <<<EOF
@copyright Helmut Schottmüller 2008-2018 <http://github.com/hschottm>
@author Helmut Schottmüller (hschottm)
@package contao-textwizard
@license LGPL-3.0+, CC-BY-NC-3.0
@see https://github.com/hschottm/textwizard
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,
'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,
// Remove when https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3222 has been merged
'LeoFeyer/optimize_native_functions' => true,
])
->registerCustomFixers([
new LeoFeyer\PhpCsFixer\OptimizeNativeFunctionsFixer()
])
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(false)
;
7 changes: 0 additions & 7 deletions assets/.htaccess

This file was deleted.

54 changes: 54 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name":"hschottm/contao-textwizard",
"description":"Contao widget to enter multiple lines of text",
"keywords":["contao", "widget", "extension", "input", "bundle", "wizard"],
"type":"contao-bundle",
"license":"LGPL-3.0+, CC-BY-NC-3.0",
"authors":[
{
"name":"Helmut Schottmüller",
"homepage":"https://github.com/hschottm"
}
],
"require":{
"php": ">=5.6.0",
"contao/core-bundle":"~4.4",
"contao/faq-bundle": "^4.4",
"symfony/framework-bundle": "^3.3"
},
"require-dev": {
"contao/manager-plugin": "^2.0",
"doctrine/doctrine-cache-bundle": "^1.3",
"friendsofphp/php-cs-fixer": "^2.6",
"leofeyer/optimize-native-functions-fixer": "^1.1",
"php-http/guzzle6-adapter": "^1.1",
"php-http/message-factory": "^1.0.2",
"phpunit/phpunit": "^5.7.26",
"symfony/phpunit-bridge": "^3.2"
},
"conflict": {
"contao/manager-plugin": "<2.0 || >=3.0"
},
"autoload": {
"psr-4": {
"Hschottm\\TextWizardBundle\\": "src/"
},
"classmap": [
"src/Resources/contao/"
],
"exclude-from-classmap": [
"src/Resources/contao/config/",
"src/Resources/contao/dca/",
"src/Resources/contao/languages/",
"src/Resources/contao/templates/"
]
},
"autoload-dev": {
"psr-4": {
"Hschottm\\TextWizardBundle\\Tests\\": "tests/"
}
},
"extra":{
"contao-manager-plugin": "Hschottm\\TextWizardBundle\\ContaoManager\\Plugin"
}
}
7 changes: 0 additions & 7 deletions config/autoload.ini

This file was deleted.

21 changes: 0 additions & 21 deletions config/autoload.php

This file was deleted.

18 changes: 0 additions & 18 deletions config/config.php

This file was deleted.

5 changes: 5 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<testsuites>
<testsuite name="TextWizard Bundle">
<directory>./tests</directory>
</testsuite>
</testsuites>
31 changes: 31 additions & 0 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace Hschottm\TextWizardBundle\ContaoManager;

use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Hschottm\TextWizardBundle\HschottmTextWizardBundle;

/**
* Plugin for the Contao Manager.
*
* @author Helmut Schottmüller (hschottm)
*/
class Plugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(HschottmTextWizardBundle::class)
->setLoadAfter([ContaoCoreBundle::class])
->setReplace(['textwizard']),
];
}
}
25 changes: 25 additions & 0 deletions src/DependencyInjection/TextWizardExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Hschottm\TextWizardBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

class TextWizardExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $mergedConfig, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);

//$loader->load('listener.yml');
$loader->load('services.yml');
}
}
16 changes: 16 additions & 0 deletions src/HschottmTextWizardBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Hschottm\TextWizardBundle;

use Hschottm\TextWizardBundle\DependencyInjection\TextWizardExtension;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class HschottmTextWizardBundle extends Bundle
{
public function getContainerExtension()
{
return new TextWizardExtension();
}
}
9 changes: 9 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
_instanceof:
Contao\CoreBundle\Framework\FrameworkAwareInterface:
calls:
- ["setFramework", ["@contao.framework"]]

Symfony\Component\DependencyInjection\ContainerAwareInterface:
calls:
- ["setContainer", ["@service_container"]]
8 changes: 8 additions & 0 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use Hschottm\TextWizardBundle\TextWizard;

array_insert($GLOBALS['BE_FFL'], 15, array
(
'textwizard' => TextWizard::class
));
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

/**
* @copyright Helmut Schottmüller 2008-2013
Expand All @@ -7,7 +7,7 @@
* @license LGPL
*/

namespace Contao;
namespace Hschottm\TextWizardBundle;

/**
* Class TextWizard
Expand Down Expand Up @@ -64,11 +64,11 @@ public function generate()
{
if (is_array($GLOBALS['TL_JAVASCRIPT']))
{
array_insert($GLOBALS['TL_JAVASCRIPT'], 1, 'system/modules/textwizard/assets/textwizard.js');
array_insert($GLOBALS['TL_JAVASCRIPT'], 1, 'bundle/hschottmtextwizardbundle/js/textwizard.js');
}
else
{
$GLOBALS['TL_JAVASCRIPT'] = array('system/modules/textwizard/assets/textwizard.js');
$GLOBALS['TL_JAVASCRIPT'] = array('bundle/hschottmtextwizardbundle/js/textwizard.js');
}

$arrButtons = array('new','copy', 'up', 'down', 'delete');
Expand Down
File renamed without changes.

0 comments on commit 669f3bd

Please sign in to comment.