Skip to content

Commit

Permalink
Merge pull request #1 from menatwork-ia/feature/contao4
Browse files Browse the repository at this point in the history
Feature/contao4
  • Loading branch information
adziemba authored Jan 16, 2018
2 parents a5f2516 + 71fe43d commit 6b10da6
Show file tree
Hide file tree
Showing 20 changed files with 217 additions and 124 deletions.
File renamed without changes.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ExtendedEditors
===============

About
-----

extendedEditors provides additional Insert Tags for external URLs and current language

Following additional Tags are available:

- HTTP
- cache_http
- https
- cache_https
- anchor
- anchor_open
- anchor_close
- comments
- download

Troubleshooting
---------------

If you are having problems using syncCto, please visit the issue tracker at https://github.com/menatwork-ia/extendedEditors/issues
28 changes: 17 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"menatwork/extendededitors",
"description":"New inserttags for external URLs and current language",
"keywords":["editors", "inserttag", "language"],
"type":"contao-module",
"type":"contao-bundle",
"license":"LGPL-3.0+",
"authors":[
{
Expand All @@ -13,27 +13,33 @@
},
{
"name":"Stefan Heimes",
"email":"[email protected]",
"email":"[email protected]",
"homepage":"http://www.men-at-work.de",
"role":"Developer"
},
{
"name":"Andreas Dziemba",
"email":"[email protected]",
"homepage":"http://www.men-at-work.de",
"role":"Developer"
}
],
"require":{
"php":">=5.3",
"contao/core":">=2.11,<4",
"contao-community-alliance/composer-installer":"*"
"php":"^7.0",
"contao/core-bundle":"^4.4.0"
},

"autoload":{
"classmap":["system/"]
"psr-4": {
"MenAtWork\\ExtendedEditorsBundle\\": "src"
}
},

"replace":{
"contao-legacy/extendededitors":"*"
},

"extra":{
"contao":{
"sources":{
"system/modules/x-editors":"system/modules/x-editors"
}
}
"contao-manager-plugin": "MenAtWork\\ExtendedEditorsBundle\\ContaoManager\\Plugin"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* @license GNU/LGPL
* @filesource
*/

namespace MenAtWork\ExtendedEditorsBundle\Contao;
/**
* Class mawExtendedInsertTags
*
* @copyright MEN AT WORK 2014
* @copyright MEN AT WORK 2018
* @package Frontend
*/
class mawExtendedInsertTags
class InsertTags
{
public function mawReplaceInsertTags($strTag)
public function ReplaceInsertTags($strTag)
{
$arrSplit = explode('::', $strTag);

Expand Down Expand Up @@ -79,7 +79,7 @@ protected function countComments($strParentTable, $intParentId)
return $objResult->mycount;
}

public function mawReplaceLanguageTags($strTag)
public function ReplaceLanguageTags($strTag)
{
if ($strTag == 'actlang') {
return $GLOBALS['TL_LANGUAGE'];
Expand Down
61 changes: 61 additions & 0 deletions src/Contao/table/FormField.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Created by PhpStorm.
* User: Andreas.Dziemba
* Date: 15.01.2018
* Time: 17:08
*/

namespace MenAtWork\ExtendedEditorsBundle\Contao\Table;

use Contao\FormHidden;

/**
* Class maw_tl_form_field
*
* Provide miscellaneous methods that are used by the data configuration array.
* @copyright MEN AT WORK 2011
* @author MEN AT WORK <[email protected]>
* @package Controller
*/
class FormField
{

/**
* Add the type of input field
* @param array
* @return string
*/
public function listFormFields($arrRow)
{
$key = $arrRow['invisible'] ? 'unpublished' : 'published';

$strType = '
<div class="cte_type ' . $key . '">' . $GLOBALS['TL_LANG']['FFL'][$arrRow['type']][0] . ($arrRow['mandatory'] ? ' * ' : ''). ($arrRow['name'] ? ' (' . $arrRow['name'] . ')' : '') . ($arrRow['class'] ? ' [' . $arrRow['class'] . ']' : '') . '</div>
<div class="limit_height' . (!$GLOBALS['TL_CONFIG']['doNotCollapse'] ? ' h32' : '') . ' block">';

$strClass = $GLOBALS['TL_FFL'][$arrRow['type']];

if (!class_exists($strClass))
{
return '';
}

$objWidget = new $strClass($arrRow);

$strWidget = $objWidget->parse();
$strWidget = preg_replace('/ name="[^"]+"/i', '', $strWidget);
$strWidget = str_replace('type="submit"', 'type="button"', $strWidget);

if ($objWidget instanceof FormHidden)
{
return $strType . "\n" . $objWidget->value . "\n</div>\n";
}

return $strType . '
<table cellspacing="0" cellpadding="0" class="tl_form_field_preview" summary="Table holds a form input field">
'.$strWidget.'</table>
</div>' . "\n";
}

}
28 changes: 28 additions & 0 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @copyright MEN AT WORK 2018
* @package extendedEditors
* @license GNU/LGPL
*/

namespace MenAtWork\ExtendedEditorsBundle\ContaoManager;

use MenAtWork\ExtendedEditorsBundle\ExtendedEditorsBundle;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;

class Plugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(ExtendedEditorsBundle::class)
->setLoadAfter([ContaoCoreBundle::class]),
];
}
}
34 changes: 34 additions & 0 deletions src/DependencyInjection/ExtendedEditorsExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* @copyright MEN AT WORK 2018
* @package extendedEditors
* @license GNU/LGPL
*/

namespace MenAtWork\ExtendedEditorsBundle\DependencyInjection;

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

/**
* Adds the bundle services to the container.
*
* @copyright MEN AT WORK 2018
*/
class ExtendedEditorsExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $mergedConfig, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);

$loader->load('services.yml');
}
}
14 changes: 14 additions & 0 deletions src/ExtendedEditorsBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* @copyright MEN AT WORK 2018
* @package extendedEditors
* @license GNU/LGPL
*/

namespace MenAtWork\ExtendedEditorsBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class ExtendedEditorsBundle extends Bundle
{
}
3 changes: 3 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
services:
maw.extendededitorsbundle.listener.replaceInsertTags:
class: MenAtWork\ExtendedEditorsBundle\Contao\InsertTags
16 changes: 16 additions & 0 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* Contao Open Source CMS
*
* @copyright MEN AT WORK 2014
* @package extendedEditors
* @license GNU/LGPL
* @filesource
*/

/**
* Hooks
*/
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('maw.extendededitorsbundle.listener.replaceInsertTags', 'ReplaceInsertTags');
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('maw.extendededitorsbundle.listener.replaceInsertTags', 'ReplaceLanguageTags');
15 changes: 15 additions & 0 deletions src/Resources/contao/dca/tl_form_field.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* Contao Open Source CMS
*
* @copyright MEN AT WORK 2014
* @package extendedEditors
* @license GNU/LGPL
* @filesource
*/

/**
* Table maw_tl_form_field
*/
$GLOBALS['TL_DCA']['tl_form_field']['list']['sorting']['child_record_callback'] = array('MenAtWork\ExtendedEditorsBundle\Contao\Table\FormField', 'listFormFields');
2 changes: 0 additions & 2 deletions system/modules/x-editors/config/.htaccess

This file was deleted.

18 changes: 0 additions & 18 deletions system/modules/x-editors/config/autoload.php

This file was deleted.

16 changes: 0 additions & 16 deletions system/modules/x-editors/config/config.php

This file was deleted.

2 changes: 0 additions & 2 deletions system/modules/x-editors/dca/.htaccess

This file was deleted.

Loading

0 comments on commit 6b10da6

Please sign in to comment.