Skip to content

Commit

Permalink
fix #35
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Nov 1, 2018
1 parent c7492b4 commit 950bff1
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 63 deletions.
66 changes: 34 additions & 32 deletions system/modules/sharebuttons/dca/tl_calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,41 @@
* @author Fritz Michael Gschwantner <[email protected]>
* @license GPL-2.0
*/


/**
* Add palettes to tl_calendar
*/
$GLOBALS['TL_DCA']['tl_calendar']['palettes']['default'] .= ';{sharebuttons_legend},sharebuttons_networks,sharebuttons_theme,sharebuttons_template';

/**
* Add fields to tl_calendar
*/
$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_networks'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_networks'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options_callback' => array('ShareButtons','getNetworks'),
'eval' => array('multiple'=>true,'tl_class'=>'w50'),
'sql' => "blob NULL"
);
if (\in_array('calendar', \ModuleLoader::getActive())) {
/**
* Add palettes to tl_calendar
*/
$GLOBALS['TL_DCA']['tl_calendar']['palettes']['default'] .= ';{sharebuttons_legend},sharebuttons_networks,sharebuttons_theme,sharebuttons_template';

/**
* Add fields to tl_calendar
*/
$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_networks'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_networks'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options_callback' => array('ShareButtons','getNetworks'),
'eval' => array('multiple'=>true,'tl_class'=>'w50'),
'sql' => "blob NULL"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_theme'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_theme'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getButtonThemes'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(32) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_theme'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_theme'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getButtonThemes'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(32) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_template'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_template'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getSharebuttonsTemplates'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar']['fields']['sharebuttons_template'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_template'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getSharebuttonsTemplates'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
}
64 changes: 33 additions & 31 deletions system/modules/sharebuttons/dca/tl_news_archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,39 @@
*/


/**
* Add palettes to tl_news_archive
*/
$GLOBALS['TL_DCA']['tl_news_archive']['palettes']['default'] .= ';{sharebuttons_legend},sharebuttons_networks,sharebuttons_theme,sharebuttons_template';
if (\in_array('news', \ModuleLoader::getActive())) {
/**
* Add palettes to tl_news_archive
*/
$GLOBALS['TL_DCA']['tl_news_archive']['palettes']['default'] .= ';{sharebuttons_legend},sharebuttons_networks,sharebuttons_theme,sharebuttons_template';

/**
* Add fields to tl_news_archive
*/
$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_networks'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_networks'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options_callback' => array('ShareButtons','getNetworks'),
'eval' => array('multiple'=>true,'tl_class'=>'w50', 'tl_style'=>'height:auto;'),
'sql' => "blob NULL"
);
/**
* Add fields to tl_news_archive
*/
$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_networks'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_networks'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options_callback' => array('ShareButtons','getNetworks'),
'eval' => array('multiple'=>true,'tl_class'=>'w50', 'tl_style'=>'height:auto;'),
'sql' => "blob NULL"
);

$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_theme'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_theme'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getButtonThemes'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(32) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_theme'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_theme'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getButtonThemes'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(32) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_template'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_template'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getSharebuttonsTemplates'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_template'] = array(
'label' => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_template'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('ShareButtons','getSharebuttonsTemplates'),
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
}

0 comments on commit 950bff1

Please sign in to comment.