vendor/terminal42/contao-easy_themes/config/config.php line 65

Open in your IDE?
  1. <?php
  2. /**
  3.  * Extension for Contao Open Source CMS
  4.  *
  5.  * Copyright (C) 2009 - 2016 terminal42 gmbh
  6.  *
  7.  * @package    easy_themes
  8.  * @link       http://www.terminal42.ch
  9.  * @license    http://opensource.org/licenses/lgpl-3.0.html LGPL
  10.  */
  11. /**
  12.  * Theme modules
  13.  * EXAMPLE OF HOW YOU COULD EXTEND EASY_THEMES WITH YOUR OWN EXTENSION USING THE FOLLOWING GLOBALS ARRAY
  14.  * $GLOBALS['TL_EASY_THEMES_MODULES']['my_module'] = array
  15.  * (
  16.  *     'title'         => 'My Module',
  17.  *     'label'         => 'My Module',
  18.  *     'href'          => 'main.php?do=my_module&theme=%s',
  19.  *     'href_fragment' => 'table=tl_additional_source',
  20.  *     'icon'          => 'system/modules/my_module/html/my_module_icon.png',
  21.  *     'appendRT'      => true,
  22.  *     'appendIf'      => function($intThemeId) {}
  23.  * );
  24.  *
  25.  * title:            optional, otherwise easy_themes uses $GLOBALS['TL_LANG']['tl_theme']['...'][1]
  26.  * label:            optional, otherwise easy_themes uses $GLOBALS['TL_LANG']['tl_theme']['...'][0]
  27.  * href:             optional, alternative to href_fragment, overwrites href_fragment!
  28.  * href_fragment:    alternative to href, will be added to the url like this: main.php?do=themes&id=<theme id>
  29.  * icon:             optional, if not given, easy_themes will try to load an icon using Controller::generateImage('my_module.gif', ...)
  30.  * appendRT:         boolean, optional, if set to true, easy_themes will append the request token (&rt=<REQUEST_TOKEN>)
  31.  * appendIf:         Closure, optional, the module will only be appended if the closure returns true
  32.  */
  33. $GLOBALS['TL_EASY_THEMES_MODULES'] = array_merge
  34. (
  35.     array
  36.     (
  37.         'edit' => array
  38.         (
  39.             'href_fragment' => 'act=edit',
  40.             'appendRT' => true
  41.         ),
  42.         'css' => array
  43.         (
  44.             'href_fragment' => 'table=tl_style_sheet'
  45.         ),
  46.         'modules' => array
  47.         (
  48.             'href_fragment' => 'table=tl_module'
  49.         ),
  50.         'layout' => array
  51.         (
  52.             'href_fragment' => 'table=tl_layout'
  53.         ),
  54.         'imageSizes' => array
  55.         (
  56.             'href_fragment' => 'table=tl_image_size',
  57.             'icon'          => 'system/themes/##backend_theme##/images/sizes.gif',
  58.             'appendIf'      => function($themeId) {
  59.                 return version_compare(VERSION'3.4''>=');
  60.             }
  61.         )
  62.     ),
  63.     is_array($GLOBALS['TL_EASY_THEMES_MODULES']) ? $GLOBALS['TL_EASY_THEMES_MODULES'] : array()
  64. );
  65. if (version_compare(VERSION'4.8''>=')) {
  66.     $GLOBALS['TL_EASY_THEMES_MODULES']['edit']['label'] = &$GLOBALS['TL_LANG']['EASY_THEMES']['edit'];
  67. }
  68. /**
  69.  * Hooks
  70.  */
  71. // fix uninstall exception - see #756
  72. // fix database error - see #822
  73. // fix install exception - see #4
  74. $repositoryManager $_GET['do'] == 'repository_manager' && $_GET['update'] == 'database';
  75. $installTool strpos($_SERVER['PHP_SELF'], 'contao/install.php') !== false;
  76. $composer $_GET['do'] == 'composer' && $_GET['update'] == 'database';
  77. $beMode TL_MODE == 'BE';
  78. if ($beMode
  79.     && !$repositoryManager
  80.     && !$installTool
  81.     && !$composer
  82. ) {
  83.     $GLOBALS['TL_HOOKS']['parseBackendTemplate'][] = array('EasyThemes''addContainer');
  84.     $GLOBALS['TL_HOOKS']['getUserNavigation'][] = array('EasyThemes''modifyUserNavigation');
  85.     $GLOBALS['TL_HOOKS']['loadDataContainer'][] = array('EasyThemes''setUser');
  86.     $GLOBALS['TL_HOOKS']['parseTemplate'][] = array('EasyThemes''addContaoVersionCssClass');
  87. }
  88. /**
  89.  * Backend form fields
  90.  */
  91. $GLOBALS['BE_FFL']['checkbox_minOne'] = 'CheckBoxChooseAtLeastOne';