Skip to content

Commit

Permalink
[Update] Extended expose-modules with a second headline and the possi…
Browse files Browse the repository at this point in the history
…bility to change their styles
  • Loading branch information
zoglo committed May 25, 2021
1 parent c75b47f commit 46b2daa
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/Resources/contao/dca/tl_expose_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
$palette->applyToPalette($key, 'tl_expose_module');
}

// Adding more headline options
$GLOBALS['TL_DCA']['tl_expose_module']['fields']['headline']['options'] = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div');

// Extend fields
$GLOBALS['TL_DCA']['tl_expose_module']['fields']['styleManager'] = array
(
Expand All @@ -29,5 +32,37 @@
'sql' => "blob NULL"
);

$GLOBALS['TL_DCA']['tl_expose_module']['fields']['headlineStyle'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_expose_module']['headlineStyle'],
'exclude' => true,
'inputType' => 'select',
'options' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),
'eval' => array('includeBlankOption'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(2) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_expose_module']['fields']['headline2'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_expose_module']['headline2'],
'exclude' => true,
'search' => true,
'inputType' => 'inputUnit',
'options' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div'),
'eval' => array('tl_class'=>'w50 clr'),
'sql' => "mediumtext NULL"
);

$GLOBALS['TL_DCA']['tl_expose_module']['fields']['headline2Style'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_expose_module']['headline2Style'],
'exclude' => true,
'inputType' => 'select',
'options' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),
'eval' => array('includeBlankOption'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(2) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_expose_module']['fields']['cssID']['load_callback'][] = array('\\Oveleon\\ContaoComponentStyleManager\\StyleManager', 'onLoad');
$GLOBALS['TL_DCA']['tl_expose_module']['fields']['cssID']['save_callback'][] = array('\\Oveleon\\ContaoComponentStyleManager\\StyleManager', 'onSave');
$GLOBALS['TL_DCA']['tl_expose_module']['config']['onload_callback'][] = array('ContaoThemeManager\Core\ThemeManager', 'extendHeadlineField');
24 changes: 24 additions & 0 deletions src/Resources/contao/languages/de/tl_expose_module.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@
<source>Style Manager</source>
<target>Style Manager</target>
</trans-unit>
<trans-unit id="tl_expose_module.headlineStyle.0">
<source>Class (Headline)</source>
<target>Klasse (Überschrift)</target>
</trans-unit>
<trans-unit id="tl_expose_module.headlineStyle.1">
<source>Here you can add a class for headline.</source>
<target>Hier können Sie der Überschrift eine Klasse hinzufügen.</target>
</trans-unit>
<trans-unit id="tl_expose_module.headline2.0">
<source>Headline 2</source>
<target>Überschrift 2</target>
</trans-unit>
<trans-unit id="tl_expose_module.headline2.1">
<source>Here you can add a second headline to the module.</source>
<target>Hier können Sie dem Modul eine zweite Überschrift hinzufügen.</target>
</trans-unit>
<trans-unit id="tl_expose_module.headline2Style.0">
<source>Class (Headline 2)</source>
<target>Klasse (Überschrift 2)</target>
</trans-unit>
<trans-unit id="tl_expose_module.headline2Style.1">
<source>Here you can add a class for headline 2.</source>
<target>Hier können Sie der Überschrift 2 eine Klasse hinzufügen.</target>
</trans-unit>
</body>
</file>
</xliff>
18 changes: 18 additions & 0 deletions src/Resources/contao/languages/en/tl_expose_module.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
<trans-unit id="tl_expose_module.styleManager.0">
<source>Style Manager</source>
</trans-unit>
<trans-unit id="tl_expose_module.headlineStyle.0">
<source>Class (Headline)</source>
</trans-unit>
<trans-unit id="tl_expose_module.headlineStyle.1">
<source>Here you can add a class for headline.</source>
</trans-unit>
<trans-unit id="tl_expose_module.headline2.0">
<source>Headline 2</source>
</trans-unit>
<trans-unit id="tl_expose_module.headline2.1">
<source>Here you can add a second headline to the module.</source>
</trans-unit>
<trans-unit id="tl_expose_module.headline2Style.0">
<source>Class (Headline 2)</source>
</trans-unit>
<trans-unit id="tl_expose_module.headline2Style.1">
<source>Here you can add a class for headline 2.</source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 46b2daa

Please sign in to comment.