vendor/fritzmg/contao-sharebuttons/system/modules/sharebuttons/dca/tl_news_archive.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * Contao Open Source CMS
  4.  *
  5.  * simple extension to provide a share buttons module
  6.  * 
  7.  * @copyright inspiredminds 2014-2019-2017
  8.  * @package   sharebuttons
  9.  * @link      http://www.inspiredminds.at
  10.  * @author    Fritz Michael Gschwantner <fmg@inspiredminds.at>
  11.  * @license   LGPL-3.0-or-later
  12.  */
  13. use Contao\NewsBundle\ContaoNewsBundle;
  14.  
  15. if (class_exists(Contao\ModuleLoader::class)) {
  16.     $add = \in_array('news', Contao\ModuleLoader::getActive());
  17. } else {
  18.     $add = class_exists(ContaoNewsBundle::class);
  19. }
  20. if ($add) {
  21.     /**
  22.      * Add palettes to tl_news_archive
  23.      */
  24.     $GLOBALS['TL_DCA']['tl_news_archive']['palettes']['default'] .= ';{sharebuttons_legend},sharebuttons_networks,sharebuttons_theme,sharebuttons_template';
  25.     /**
  26.      * Add fields to tl_news_archive
  27.      */
  28.     $GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_networks'] = array(
  29.         'label'            => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_networks'],
  30.         'exclude'          => true,
  31.         'inputType'        => 'checkboxWizard',
  32.         'options_callback' => array('ShareButtons','getNetworks'),
  33.         'eval'             => array('multiple'=>true,'tl_class'=>'w50', 'tl_style'=>'height:auto;'),
  34.         'sql'              => "blob NULL"
  35.     );
  36.     $GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_theme'] = array(
  37.         'label'            => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_theme'],
  38.         'exclude'          => true,
  39.         'inputType'        => 'select',
  40.         'options_callback' => array('ShareButtons','getButtonThemes'),
  41.         'eval'             => array('tl_class'=>'w50'),
  42.         'sql'              => "varchar(32) NOT NULL default ''"
  43.     );
  44.     $GLOBALS['TL_DCA']['tl_news_archive']['fields']['sharebuttons_template'] = array(
  45.         'label'            => &$GLOBALS['TL_LANG']['sharebuttons']['sharebuttons_template'],
  46.         'exclude'          => true,
  47.         'inputType'        => 'select',
  48.         'options_callback' => array('ShareButtons','getSharebuttonsTemplates'),
  49.         'eval'             => array('tl_class'=>'w50'),
  50.         'sql'              => "varchar(64) NOT NULL default ''"
  51.     );
  52. }