Skip to content
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"require": {
"php": "^7.4 || ^8.0",
"contao/core-bundle": "^4.9",
"contao/core-bundle": "^4.13 || ^5.2",
"contao-community-alliance/composer-plugin": "~2.4 || ~3.0",
"menatwork/contao-multicolumnwizard-bundle": "^3.3.7"
},
Expand Down
393 changes: 192 additions & 201 deletions config/config.php

Large diffs are not rendered by default.

54 changes: 25 additions & 29 deletions dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@


/**
* Table tl_content
* Table tl_content
*/

use Contao\DataContainer;
use Contao\System;
use HeimrichHannot\Subcolumns\SubcolumnTypes;

$GLOBALS['TL_DCA']['tl_content']['fields']['sc_name'] = array
Expand Down Expand Up @@ -136,24 +137,11 @@
$GLOBALS['TL_DCA']['tl_content']['config']['oncopy_callback'][] = array('tl_content_sc','scCopy');

/**
* Operations
**/
$arrModules = $this->Config->getActiveModules();
if(!in_array('ce-access',$arrModules))
{
$GLOBALS['TL_DCA']['tl_content']['list']['operations']['edit']['button_callback'] = array('tl_content_sc','showEditOperation');
$GLOBALS['TL_DCA']['tl_content']['list']['operations']['copy']['button_callback'] = array('tl_content_sc','showCopyOperation');
#$GLOBALS['TL_DCA']['tl_content']['list']['operations']['delete']['button_callback'] = array('tl_content_sc','showDeleteOperation');
#$GLOBALS['TL_DCA']['tl_content']['list']['operations']['toggle']['button_callback'] = array('tl_content_sc','toggleIcons');
}


/**
* Erweiterung für die tl_conten-Klasse
* Erweiterung für die tl_content-Klasse
*/
class tl_content_sc extends tl_content
{
/*
/*
* Get the colsets depending on the selection from the settings
*/
public function getAllTypes()
Expand All @@ -166,17 +154,26 @@ public function getAllTypes()
* Create the palette for the startelement
*/
public function createPalette(DataContainer $dc)
{
{
$strSet = SubcolumnTypes::compatSetType();

$strGap = $GLOBALS['TL_SUBCL'][$strSet]['gap'] ? ',sc_gapdefault,sc_gap' : '';
$strEquilize = isset($GLOBALS['TL_SUBCL'][$strSet]['equalize']) && $GLOBALS['TL_SUBCL'][$strSet]['equalize'] ? '{colheight_legend:hide},sc_equalize;' : '';


if (empty($GLOBALS['TL_SUBCL'][$strSet])) {
dump("Subcolumns profile '$strSet' not found. Please check your settings.");
return;
}

$strGap = !empty($GLOBALS['TL_SUBCL'][$strSet]['gap']) ? ',sc_gapdefault,sc_gap' : '';

$strEquilize = '';
if (!empty($GLOBALS['TL_SUBCL'][$strSet]['equalize']))
{
$strEquilize = '{colheight_legend:hide},sc_equalize;';
}

$GLOBALS['TL_DCA']['tl_content']['palettes']['colsetStart'] = '{type_legend},type;{colset_legend},sc_name,sc_type,sc_color'.$strGap.';'.$strEquilize.'{protected_legend:hide},protected;{expert_legend:hide},guests,invisible,cssID,space';

}


/**
* Autogenerate an name for the colset if it has not been set yet
* @param mixed
Expand Down Expand Up @@ -590,7 +587,7 @@ public function showEditOperation($arrRow, $href, $label, $title, $icon, $attrib
if($arrRow['type'] != 'colsetPart' && $arrRow['type'] != 'colsetEnd')
{
$href .= '&id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.\Contao\StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand All @@ -602,7 +599,7 @@ public function showCopyOperation($arrRow, $href, $label, $title, $icon, $attrib
if($arrRow['type'] != 'colsetPart' && $arrRow['type'] != 'colsetEnd')
{
$href .= '&id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.\Contao\StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand All @@ -614,7 +611,7 @@ public function showDeleteOperation($arrRow, $href, $label, $title, $icon, $attr
if($arrRow['type'] != 'colsetPart' && $arrRow['type'] != 'colsetEnd')
{
$href .= '&id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.\Contao\StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand Down Expand Up @@ -797,5 +794,4 @@ public function clipboardCopy($intId, DataContainer $dc, $isGrouped)
}

}
}
?>
}
4 changes: 1 addition & 3 deletions dca/tl_form.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand All @@ -22,5 +22,3 @@
*/

$GLOBALS['TL_DCA']['tl_form']['config']['oncopy_callback'][] = array('tl_subcolumnsCallback','formCheck');

?>
9 changes: 4 additions & 5 deletions dca/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @filesource
*/

use Contao\StringUtil;

/**
* Table tl_form_field
Expand Down Expand Up @@ -471,7 +472,7 @@ public function showEditOperation($arrRow, $href, $label, $title, $icon, $attrib
if($arrRow['type'] != 'formcolpart' && $arrRow['type'] != 'formcolend')
{
$href .= '&amp;id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand All @@ -483,7 +484,7 @@ public function showCopyOperation($arrRow, $href, $label, $title, $icon, $attrib
if($arrRow['type'] != 'formcolpart' && $arrRow['type'] != 'formcolend')
{
$href .= '&amp;id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand All @@ -495,7 +496,7 @@ public function showDeleteOperation($arrRow, $href, $label, $title, $icon, $attr
if($arrRow['type'] != 'formcolpart' && $arrRow['type'] != 'formcolend')
{
$href .= '&amp;id='.$arrRow['id'];
return '<a href="'.$this->addToUrl($href).'" title="'.specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.$this->generateImage($icon, $label).'</a> ';
}

}
Expand Down Expand Up @@ -620,5 +621,3 @@ public function scCopy($intId,DataContainer $dc)
}

}

?>
4 changes: 1 addition & 3 deletions dca/tl_page.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand All @@ -22,5 +22,3 @@
*/

$GLOBALS['TL_DCA']['tl_page']['config']['oncopy_callback'][] = array('tl_subcolumnsCallback','pageCheck');

?>
4 changes: 1 addition & 3 deletions dca/tl_settings.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand Down Expand Up @@ -46,5 +46,3 @@
);

$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{subcolumns_legend:hide},subcolumns,subcolumns_gapdefault;';

?>
4 changes: 1 addition & 3 deletions languages/de/default.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand Down Expand Up @@ -42,5 +42,3 @@

$GLOBALS['TL_LANG']['MSC']['sets']['yaml3'] = 'YAML3';
$GLOBALS['TL_LANG']['MSC']['sets']['yaml4'] = 'YAML4';

?>
5 changes: 1 addition & 4 deletions languages/de/modules.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
<?php

/**
* Contao Open Source CMS
Expand Down Expand Up @@ -32,6 +32,3 @@
* Frontend modules
*/
$GLOBALS['TL_LANG']['FMD']['subcolumns'] = array('Spaltenset', 'Ordnen Sie mehrere Module in mehreren Spalten an. Die Zuweisung erfolgt wie im Seitenlayout.');


?>
8 changes: 1 addition & 7 deletions languages/de/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand All @@ -21,7 +21,6 @@
* @filesource
*/


/**
* Fields
*/
Expand All @@ -35,13 +34,8 @@
$GLOBALS['TL_LANG']['tl_content']['sc_childs'] = array('Kindelemente', '');
$GLOBALS['TL_LANG']['tl_content']['sc_sortid'] = array('Sortierung im Spaltenset', '');


/**
* Legends
*/
$GLOBALS['TL_LANG']['tl_content']['colset_legend'] = 'Spaltenset Einstellungen';
$GLOBALS['TL_LANG']['tl_content']['colheight_legend'] = 'Spaltenhöhe';



?>
2 changes: 1 addition & 1 deletion languages/de/tl_form_field.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight Open Source CMS
Expand Down
5 changes: 1 addition & 4 deletions languages/de/tl_module.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight Open Source CMS
Expand Down Expand Up @@ -26,7 +26,6 @@
* @filesource
*/


/**
* Fields
*/
Expand All @@ -36,12 +35,10 @@
$GLOBALS['TL_LANG']['tl_module']['sc_type'] = array('Spaltenset Typ', 'Wieviele Spalten, mit welchen Breiten soll es geben?<br />Die Zahlen geben die Breite in % an: 25x75 => erste Spalte 25%, zweit Spalte 75% des umschliessenden Containers.');
$GLOBALS['TL_LANG']['tl_module']['sc_equalize'] = array('gleiche Spaltenhöhe', 'Diese Option setzt alle Spalten auf die Höhe der längsten Spalte. Dies kann sinnvoll genutzt werden, wenn man z.B. Hintergrundgrafiken nutzen möchte.<br />Ein Beispiel findet man auf den Seiten des <a href="http://www.yaml.de/fileadmin/examples/06_layouts_advanced/equal_height_boxes.html" onclick="window.open(this.href); return false;" title="YAML-Framework">YAML-Frameworks</a>.');


/**
* Reference
*/
$GLOBALS['TL_LANG']['tl_module']['subcolumns_legend'] = 'Spaltenset Auswahl';
$GLOBALS['TL_LANG']['tl_module']['subcolumns_settings_legend'] = 'Spaltenset Einstellungen';
$GLOBALS['TL_LANG']['tl_module']['module'] = array('Modul','');
$GLOBALS['TL_LANG']['tl_module']['column'] = array('Spalte','');
?>
6 changes: 1 addition & 5 deletions languages/de/tl_settings.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand All @@ -21,17 +21,13 @@
* @filesource
*/


/**
* Fields
*/
$GLOBALS['TL_LANG']['tl_settings']['subcolumns'] = array('Spaltenset', 'Wählen Sie die Spaltenset-Konfiguration, die Sie verwenden möchten.');
$GLOBALS['TL_LANG']['tl_settings']['subcolumns_gapdefault'] = array('Spaltenset Standardabstand', 'Geben Sie einen Standardabstand für alle Spaltensets auf der Seite ein.');


/**
* Legends
*/
$GLOBALS['TL_LANG']['tl_settings']['subcolumns_legend'] = 'Spaltenset Einstellungen';

?>
5 changes: 1 addition & 4 deletions languages/en/default.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand All @@ -21,8 +21,6 @@
* @filesource
*/



/**
* Miscellaneous
*/
Expand All @@ -39,4 +37,3 @@
$GLOBALS['TL_LANG']['MSC']['sc_third'] = 'third';
$GLOBALS['TL_LANG']['MSC']['sc_fourth'] = 'fourth';
$GLOBALS['TL_LANG']['MSC']['sc_fifth'] = 'fifth';
?>
6 changes: 1 addition & 5 deletions languages/en/modules.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
<?php

/**
* Contao Open Source CMS
Expand Down Expand Up @@ -28,11 +28,7 @@
* @filesource
*/


/**
* Front end modules
*/
$GLOBALS['TL_LANG']['FMD']['subcolumns'] = array('Column Set', 'Put front end modules inside columns. The allocation is made similar to a page layout.');


?>
4 changes: 1 addition & 3 deletions languages/en/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight webCMS
Expand Down Expand Up @@ -37,5 +37,3 @@
*/
$GLOBALS['TL_LANG']['tl_content']['colset_legend'] = 'Columnset settings';
$GLOBALS['TL_LANG']['tl_content']['colheight_legend'] = 'Column height';

?>
6 changes: 1 addition & 5 deletions languages/en/tl_form_field.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
<?php

/**
* TYPOlight Open Source CMS
Expand Down Expand Up @@ -26,15 +26,13 @@
* @filesource
*/


/**
* Form fields
*/
$GLOBALS['TL_LANG']['FFL']['formcolstart'] = array('Column set start', 'The opening element of a column set');
$GLOBALS['TL_LANG']['FFL']['formcolpart'] = array('Column set part element', 'The element between two columns.');
$GLOBALS['TL_LANG']['FFL']['formcolend'] = array('Column set end element', 'The last element of a column set.');


/**
* Fields
*/
Expand All @@ -48,5 +46,3 @@
* Legend
**/
$GLOBALS['TL_LANG']['tl_form_field']['colsettings_legend'] = 'Columns Settings';

?>
Loading