/**
  * Get all templates for the sections block.
  *
  * @return array
  */
 public function getSectionTemplates()
 {
     $templates = \Controller::getTemplateGroup('block_section');
     unset($templates['block_section']);
     unset($templates['block_sections']);
     return $templates;
 }
 /**
  * Retrieve all templates for the leaflet map template list.
  *
  * @param GetPropertyOptionsEvent $event The event.
  *
  * @return void
  */
 public function getMapTemplates(GetPropertyOptionsEvent $event)
 {
     if ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_rendersetting' || $event->getPropertyName() !== 'leaflet_template') {
         return;
     }
     $event->setOptions(\Controller::getTemplateGroup('leaflet_map_'));
 }
Example #3
0
 /**
  * Return all module summarize templates as array
  * @param DataContainer
  * @return array
  */
 public function getModuleSummarizeTemplates(DataContainer $dc)
 {
     $intPid = $dc->activeRecord->pid;
     if (\Input::get('act') == 'overrideAll') {
         $intPid = \Input::get('id');
     }
     return \Controller::getTemplateGroup('mod_summarize_', $intPid);
 }
 public static function modifyPalette(\DataContainer $objDc)
 {
     \Controller::loadDataContainer('tl_module');
     \System::loadLanguageFile('tl_module');
     if (($objModule = \ModuleModel::findByPk($objDc->id)) !== null) {
         $arrDca =& $GLOBALS['TL_DCA']['tl_module'];
         if (\HeimrichHannot\Haste\Util\Module::isSubModuleOf($objModule->type, 'HeimrichHannot\\FrontendEdit\\ModuleList')) {
             unset($arrDca['fields']['itemTemplate']['options_callback']);
             $arrDca['fields']['itemTemplate']['options'] = \Controller::getTemplateGroup('frontendedit_list_item_');
             $arrDca['fields']['jumpTo']['eval']['tl_class'] = 'clr w50';
         }
         if (\HeimrichHannot\Haste\Util\Module::isSubModuleOf($objModule->type, 'HeimrichHannot\\FrontendEdit\\ModuleReader')) {
             unset($arrDca['fields']['itemTemplate']['options_callback']);
             $arrDca['fields']['itemTemplate']['options'] = \Controller::getTemplateGroup('frontendedit_item');
             $arrDca['fields']['jumpTo']['eval']['tl_class'] = 'clr w50';
         }
     }
 }
Example #5
0
 /**
  * Get all templates. A templatePrefix can be defined using eval.templatePrefix.
  *
  * @param \DataContainer $dataContainer The data container driver.
  *
  * @return array
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public function getTemplates(\DataContainer $dataContainer)
 {
     $config = array();
     $prefix = '';
     // MCW compatibility
     if ($dataContainer instanceof \MultiColumnWizard) {
         $field = $dataContainer->strField;
         $table = $dataContainer->strTable;
     } else {
         $field = $dataContainer->field;
         $table = $dataContainer->table;
     }
     if (array_key_exists('eval', $GLOBALS['TL_DCA'][$table]['fields'][$field])) {
         $config = $GLOBALS['TL_DCA'][$table]['fields'][$field]['eval'];
     }
     if (array_key_exists('templatePrefix', $config)) {
         $prefix = $config['templatePrefix'];
     }
     return \Controller::getTemplateGroup($prefix);
 }
Example #6
0
    public function compile()
    {
        \System::loadLanguageFile('tl_iso_gallery');
        $strBuffer = '
<table style="width:100%">
<thead>
    <tr>
        <th>' . $GLOBALS['TL_LANG']['tl_iso_gallery']['name'][0] . '</th>
        <th>' . $GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_template'][0] . '<span class="mandatory">*</span></th>
    </tr>
</thead>
<tbody>';
        foreach ($this->objGaleries as $objGallery) {
            $objSelect = new \SelectMenu(\Widget::getAttributesFromDca(array('options' => array_merge(\Controller::getTemplateGroup('moo_'), \Controller::getTemplateGroup('j_')), 'eval' => array('includeBlankOption' => true, 'mandatory' => true)), 'gallery[' . $objGallery->id . ']'));
            if (\Input::post('FORM_SUBMIT') == 'tl_iso_upgrade_20010000') {
                $objSelect->validate();
                if (!$objSelect->hasErrors()) {
                    $objGallery->lightbox_template = serialize(array($objSelect->value));
                    $objGallery->save();
                }
            }
            $strBuffer .= '
    <tr>
        <td>' . $objGallery->name . '</td>
        <td>' . $objSelect->generateWithError() . '</td>
    </tr>';
        }
        $strBuffer .= '
</tbody>
</table>';
        $this->Template->formSubmit = 'tl_iso_upgrade_20010000';
        $this->Template->fields = $strBuffer;
        $this->Template->matter = $GLOBALS['TL_LANG']['UPG']['20010000'];
        if (\Input::post('FORM_SUBMIT') == 'tl_iso_upgrade_20010000') {
            \Controller::reload();
        }
    }
<?php

$GLOBALS['TL_DCA']['tl_entity_template'] = array('config' => array('dataContainer' => 'Table', 'switchToEdit' => true, 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('title'), 'flag' => 1, 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('title', 'formID'), 'format' => '%s <span style="color:#b3b3b3;padding-left:3px">[%s]</span>'), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'generate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['generate'], 'href' => 'key=generate', 'icon' => 'system/modules/entity_generator/assets/img/icon.png', 'button_callback' => array('tl_entity_template', 'generate')))), 'palettes' => array('__selector__' => array('type', 'addOutputDir', 'addDcas', 'addUserPermissions', 'addParentDca', 'addLanguages', 'addModel', 'addConfig', 'addBackendModule', 'moduleGroup', 'addOnLoadCallbacks', 'addOnSubmitCallbacks', 'addSortingFields', 'addHeaderFields', 'addGlobalOperations', 'addOperations'), 'default' => '{general_legend},title,type;', 'module' => '{general_legend},title,type;{module_legend},addOutputDir,moduleName,moduleNamespace,addAssets,addConfig,addDcas;', 'dca' => '{general_legend},title,type;{entity_legend},dcaTemplate,dcaName,childDcaName,addUserPermissions,dataContainer,enableVersioning,addOnLoadCallbacks,addOnSubmitCallbacks,sortingMode,addSortingFields,addHeaderFields,addGlobalOperations,addOperations,addPublish,addTitle,addParentDca;{language_legend},addLanguages;{model_legend},addModel;'), 'subpalettes' => array('addOutputDir' => 'outputDir', 'addConfig' => 'configTemplate,addBackendModule', 'addDcas' => 'dcas', 'addUserPermissions' => 'userTemplate,userGroupTemplate,userLanguageTemplate,userGroupLanguageTemplate', 'addParentDca' => 'parentDca,parentDcaForeignKey', 'addLanguages' => 'dcaLangTemplate,localizedEntityName,localizedEntityNamePlural', 'addModel' => 'modelTemplate,entityClassName', 'addBackendModule' => 'modulesLangTemplate,moduleGroup', 'moduleGroup_new' => 'localizedModuleName', 'moduleGroup_existing' => 'existingModuleGroupName', 'addOnLoadCallbacks' => 'onLoadCallbacks', 'addOnSubmitCallbacks' => 'onSubmitCallbacks', 'addSortingFields' => 'sortingFields', 'addHeaderFields' => 'headerFields', 'addGlobalOperations' => 'globalOperations', 'addOperations' => 'operations'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['type'], 'exclude' => true, 'inputType' => 'select', 'options' => array('module', 'dca'), 'default' => 'module', 'reference' => &$GLOBALS['TL_LANG']['tl_entity_template']['type'], 'eval' => array('mandatory' => true, 'submitOnChange' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default 'module'"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['title'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'addOutputDir' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addOutputDir'], 'exclude' => true, 'inputType' => 'checkbox', 'default' => true, 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default '1'"), 'outputDir' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['outputDir'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "binary(16) NULL"), 'moduleName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['moduleName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'moduleNamespace' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['moduleNamespace'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('decodeEntities' => true, 'mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'addAssets' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addAssets'], 'exclude' => true, 'inputType' => 'checkbox', 'default' => array('css', 'img', 'js', 'htaccess'), 'options' => array('css', 'img', 'js', 'htaccess'), 'reference' => &$GLOBALS['TL_LANG']['tl_entity_template']['addAssets'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 clr'), 'sql' => "blob NULL"), 'addConfig' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addConfig'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'configTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['configTemplate'], 'default' => 'eg_config_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_config_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'addBackendModule' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addBackendModule'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'moduleGroup' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['moduleGroup'], 'exclude' => true, 'default' => 'new', 'inputType' => 'select', 'options' => array('new', 'existing'), 'reference' => &$GLOBALS['TL_LANG']['tl_entity_template']['moduleGroup'], 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'existingModuleGroupName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['existingModuleGroupName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'addDcas' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addDcas'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'dcas' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['dcas'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => array('tl_entity_template', 'getDcaEntityTemplatesAsOptions'), 'eval' => array('mandatory' => true, 'multiple' => true, 'chosen' => true, 'tl_class' => 'long clr', 'style' => 'width: 97%'), 'sql' => "blob NULL"), 'parentDca' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['parentDca'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => array('tl_entity_template', 'getDcaEntityTemplatesAsOptions'), 'eval' => array('mandatory' => true, 'chosen' => true, 'includeBlankOption' => true, 'tl_class' => 'w50 clr'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'addLanguages' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addLanguages'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'addModel' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addModel'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'dcaTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['dcaTemplate'], 'default' => 'eg_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'dcaName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['dcaName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'addParentDca' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addParentDca'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'parentDcaName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['parentDcaName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'parentDcaForeignKey' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['parentDcaForeignKey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'childDcaName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['childDcaName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'addUserPermissions' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addUserPermissions'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'userTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['userTemplate'], 'default' => 'eg_user_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_user_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'userGroupTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['userGroupTemplate'], 'default' => 'eg_user_group_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_user_group_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'userLanguageTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['userLanguageTemplate'], 'default' => 'eg_lang_user_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_lang_user_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'userGroupLanguageTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['userGroupLanguageTemplate'], 'default' => 'eg_lang_user_group_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_lang_user_group_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dataContainer' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['dataContainer'], 'exclude' => true, 'inputType' => 'select', 'options' => array('Table' => 'DC_Table', 'File' => 'DC_File', 'Folder' => 'DC_Folder'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'enableVersioning' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['enableVersioning'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'addOnLoadCallbacks' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addOnLoadCallbacks'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'onLoadCallbacks' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onLoadCallbacks'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr', 'columnFields' => array('class' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onLoadCallbacks']['class'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')), 'method' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onLoadCallbacks']['method'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'addOnSubmitCallbacks' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addOnSubmitCallbacks'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'onSubmitCallbacks' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onSubmitCallbacks'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr', 'columnFields' => array('class' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onSubmitCallbacks']['class'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')), 'method' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['onSubmitCallbacks']['method'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'sortingMode' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['sortingMode'], 'exclude' => true, 'inputType' => 'select', 'options' => array(0, 1, 2, 3, 4, 5, 6), 'reference' => &$GLOBALS['TL_LANG']['tl_entity_template']['sortingMode']['options'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'addSortingFields' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addSortingFields'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'sortingFields' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['sortingFields'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr', 'columnFields' => array('field' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['sortingFields']['field'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')), 'sorting' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['sortingFields']['sorting'], 'exclude' => true, 'inputType' => 'select', 'options' => array('ASC', 'DESC'), 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'addHeaderFields' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addHeaderFields'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'headerFields' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['headerFields'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr', 'columnFields' => array('field' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['headerFields']['field'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'addGlobalOperations' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addGlobalOperations'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'globalOperations' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['globalOperations'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'default' => array(array('act' => 'all')), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr', 'columnFields' => array('act' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['globalOperations']['act'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'addOperations' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addOperations'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'operations' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['operations'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'default' => array(array('act' => 'edit'), array('act' => 'copy'), array('act' => 'delete'), array('act' => 'toggle'), array('act' => 'show')), 'eval' => array('tl_class' => 'w50 clr', 'columnFields' => array('act' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['operations']['act'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('style' => 'width: 180px')))), 'sql' => "blob NULL"), 'addPublish' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addPublish'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 clr'), 'sql' => "char(1) NOT NULL default ''"), 'addTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['addTitle'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'dcaLangTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['dcaLangTemplate'], 'default' => 'eg_lang_dca_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_lang_dca_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'modulesLangTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['modulesLangTemplate'], 'default' => 'eg_lang_modules_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_lang_modules_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'localizedEntityName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['localizedEntityName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'localizedEntityNamePlural' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['localizedEntityNamePlural'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'localizedModuleName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['localizedModuleName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'modelTemplate' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['modelTemplate'], 'default' => 'eg_model_default', 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('eg_model_'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'entityClassName' => array('label' => &$GLOBALS['TL_LANG']['tl_entity_template']['entityClassName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''")));
class tl_entity_template extends \Backend
{
    public function generate($row, $href, $label, $title, $icon, $attributes)
    {
        $href .= '&id=' . $row['id'];
        if ($row['type'] == 'module') {
            return '<a href="' . $this->addToUrl($href) . '" title="' . specialchars($title) . '"' . $attributes . '>' . Image::getHtml($icon, $label) . '</a> ';
        }
    }
    public static function getDcaEntityTemplatesAsOptions()
    {
        return static::getEntityTemplatesAsOptions('dca');
    }
    public static function getEntityTemplatesAsOptions($strType)
    {
        $arrOptions = array();
        if (($objEntityTemplates = \HeimrichHannot\EntityGenerator\EntityTemplateModel::findBy('type', $strType)) !== null) {
            $arrOptions = array_combine($objEntityTemplates->fetchEach('id'), $objEntityTemplates->fetchEach('title'));
            asort($arrOptions);
        }
        return $arrOptions;
    }
}
<?php

$GLOBALS['TL_DCA']['tl_content']['palettes']['hofff_recursive-download-folder'] = '{type_legend},type,headline' . ';{source_legend},folderSRC,useHomeDir' . ';{recursive-download-folder_legend},recursiveDownloadFolderHideEmptyFolders,recursiveDownloadFolderShowAllLevels' . ';{template_legend:hide},recursiveDownloadFolderTpl,customTpl' . ';{protected_legend:hide},protected' . ';{expert_legend:hide},guests,cssID,space' . ';{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['fields']['folderSRC'] = array('label' => &$GLOBALS['TL_LANG']['tl_content']['folderSRC'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'mandatory' => true, 'tl_class' => 'clr'), 'sql' => "binary(16) NULL");
$GLOBALS['TL_DCA']['tl_content']['fields']['recursiveDownloadFolderHideEmptyFolders'] = array('label' => &$GLOBALS['TL_LANG']['tl_content']['recursiveDownloadFolderHideEmptyFolders'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_content']['fields']['recursiveDownloadFolderShowAllLevels'] = array('label' => &$GLOBALS['TL_LANG']['tl_content']['recursiveDownloadFolderShowAllLevels'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_content']['fields']['recursiveDownloadFolderTpl'] = array('label' => &$GLOBALS['TL_LANG']['tl_content']['recursiveDownloadFolderTpl'], 'exclude' => true, 'inputType' => 'select', 'options' => \Controller::getTemplateGroup('recursive-download-folder_'), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''");
 public function getSharebuttonsTemplates(DataContainer $dc)
 {
     $intPid = $dc->activeRecord->pid;
     if (\Input::get('act') == 'overrideAll') {
         $intPid = \Input::get('id');
     }
     return \Controller::getTemplateGroup('sharebuttons_', $intPid);
 }
<?php

/**
 * form_control extension for Contao Open Source CMS
 *
 * @copyright  Copyright (c) 2008-2014, terminal42 gmbh
 * @author     terminal42 gmbh <*****@*****.**>
 * @license    http://opensource.org/licenses/lgpl-3.0.html LGPL
 * @link       http://github.com/terminal42/contao-form_control
 */
/**
 * Extend the tl_form_field palettes
 */
foreach ($GLOBALS['TL_DCA']['tl_form_field']['palettes'] as $k => $v) {
    if ($k == '__selector__') {
        continue;
    }
    $GLOBALS['TL_DCA']['tl_form_field']['palettes'][$k] = $v . ';{formcontrol_legend},formcontrol_template';
}
/**
 * Add fields to tl_form_field
 */
$GLOBALS['TL_DCA']['tl_form_field']['fields']['formcontrol_template'] = array('label' => &$GLOBALS['TL_LANG']['tl_form_field']['formcontrol_template'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function ($dc) {
    return \Controller::getTemplateGroup('form_control_' . $dc->activeRecord->type . '_');
}, 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''");
 /**
  * Collect a template group.
  *
  * @param GetTemplateGroupEvent $event The event.
  *
  * @return void
  */
 public function handleGetTemplateGroup(GetTemplateGroupEvent $event)
 {
     $templatesArray = \Controller::getTemplateGroup($event->getPrefix());
     $templates = $event->getTemplates();
     foreach ($templatesArray as $templateName => $templateLabel) {
         $templates[$templateName] = $templateLabel;
     }
 }
Example #12
0
        {expert_legend:hide},guests,cssID,space
    ', 'anystores_map' => '
        {title_legend},name,headline,type;
        {config_legend:hide},anystores_categories,jumpTo,anystores_latitude,anystores_longitude,anystores_zoom,anystores_maptype,anystores_mapheight,anystores_streetview,anystores_defaultMarker;
        {template_legend:hide},customTpl;
        {expert_legend:hide},guests,cssID,space
    '));
/**
 * Selector
 */
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'anystores_limitDistance';
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'anystores_allowEmptySearch';
/**
 * Subpalettes
 */
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['anystores_allowEmptySearch'] = 'anystores_sortingOrder';
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['anystores_limitDistance'] = 'anystores_maxDistance';
/**
 * Add fields to tl_module
 */
array_insert($GLOBALS['TL_DCA']['tl_module']['fields'], 0, array('anystores_defaultCountry' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_defaultCountry'], 'exclude' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'anystores_categories' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_categories'], 'exclude' => true, 'inputType' => 'checkbox', 'options_callback' => function () {
    $objCategories = AnyStoresCategoryModel::findAll(array('order' => 'title'));
    if ($objCategories === null) {
        return;
    }
    return $objCategories->fetchEach('title');
}, 'eval' => array('mandatory' => true, 'multiple' => true), 'sql' => "text NULL"), 'anystores_listLimit' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_listLimit'], 'exclude' => true, 'inputType' => 'text', 'default' => '10', 'eval' => array('mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "smallint(4) unsigned NOT NULL default '10'"), 'anystores_allowEmptySearch' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_allowEmptySearch'], 'exclude' => true, 'inputType' => 'checkbox', 'default' => true, 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_sortingOrder' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_sortingOrder'], 'exclude' => true, 'inputType' => 'text', 'default' => 'postal', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_limitDistance' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_limitDistance'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 m12 clr'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_maxDistance' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_maxDistance'], 'exclude' => true, 'inputType' => 'text', 'default' => '10', 'eval' => array('mandatory' => true, 'maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default '10'"), 'anystores_detailTpl' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_detailTpl'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \Controller::getTemplateGroup('anystores_');
}, 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_mapTpl' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_mapTpl'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \Controller::getTemplateGroup('map_');
}, 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_latitude' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_latitude'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'default' => 0, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default '0'"), 'anystores_longitude' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_longitude'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'default' => 0, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default '0'"), 'anystores_zoom' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_zoom'], 'inputType' => 'select', 'options' => range(1, 18), 'eval' => array('default' => 6, 'tl_class' => 'w50'), 'sql' => "tinyint(2) unsigned NOT NULL default '6'"), 'anystores_streetview' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_streetview'], 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_maptype' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_maptype'], 'inputType' => 'select', 'options' => array('roadmap', 'satellite', 'hybrid', 'terrain'), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(9) NOT NULL default 'roadmap'"), 'anystores_mapheight' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_mapheight'], 'inputType' => 'text', 'eval' => array('default' => 500, 'maxlength' => 3, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(3) unsigned NOT NULL default '500'"), 'anystores_defaultMarker' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_defaultMarker'], 'inputType' => 'fileTree', 'eval' => array('files' => true, 'fieldType' => 'radio', 'extensions' => Config::get('validImageTypes')), 'sql' => "binary(16) NULL")));
 public static function modifyPalette(\DataContainer $objDc)
 {
     \Controller::loadDataContainer('tl_module');
     \System::loadLanguageFile('tl_module');
     if (($objModule = \ModuleModel::findByPk($objDc->id)) !== null) {
         $arrDca =& $GLOBALS['TL_DCA']['tl_module'];
         if (\HeimrichHannot\Haste\Util\Module::isSubModuleOf($objModule->type, 'HeimrichHannot\\FormHybridList\\ModuleReader')) {
             unset($arrDca['fields']['itemTemplate']['options_callback']);
             $arrDca['fields']['itemTemplate']['options'] = \Controller::getTemplateGroup('formhybrid_reader_');
         }
     }
 }
 public function getFormHybridReadonlyTemplates()
 {
     return \Controller::getTemplateGroup('formhybridreadonly_');
 }
 /**
  * options_callback
  *
  * get all nl_ prefixed templates from the root level
  */
 public function getTemplateOptions($dc)
 {
     $group = Controller::getTemplateGroup('nl_');
     $result = array();
     foreach ($group as $template) {
         if (strpos($template, '(') === false) {
             $result[] = $template;
         }
     }
     return $result;
 }
Example #16
0
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_gallery
 */
$GLOBALS['TL_DCA']['tl_iso_gallery'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'closed' => true, 'onload_callback' => array(array('Isotope\\Backend', 'initializeSetupModule')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'flag' => 1, 'fields' => array('name'), 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('name', 'type'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), 'global_operations' => array('back' => array('label' => &$GLOBALS['TL_LANG']['MSC']['backBT'], 'href' => 'mod=&table=', 'class' => 'header_back', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'new' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['new'], 'href' => 'act=create', 'class' => 'header_new', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type', 'anchor'), 'default' => '{name_legend},name,type', 'standard' => '{name_legend},name,type,anchor,placeholder;{size_legend},main_size,gallery_size;{watermark_legend:hide},main_watermark_image,main_watermark_position,gallery_watermark_image,gallery_watermark_position;{template_legend:hide},customTpl', 'standardlightbox' => '{name_legend},name,type,anchor,placeholder;{size_legend},main_size,gallery_size;{lightbox_legend},lightbox_template,lightbox_size;{watermark_legend:hide},main_watermark_image,main_watermark_position,gallery_watermark_image,gallery_watermark_position,lightbox_watermark_image,lightbox_watermark_position;{template_legend:hide},customTpl', 'inline' => '{name_legend},name,type,placeholder;{size_legend},main_size,gallery_size;{watermark_legend:hide},main_watermark_image,main_watermark_position,gallery_watermark_image,gallery_watermark_position;{template_legend:hide},customTpl'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['type'], 'exclude' => true, 'filter' => true, 'default' => 'standard', 'inputType' => 'select', 'options_callback' => function () {
    return \Isotope\Model\Gallery::getModelTypeOptions();
}, 'eval' => array('helpwizard' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anchor' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['anchor'], 'exclude' => true, 'inputType' => 'radio', 'options' => array('none', 'reader', 'lightbox'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_gallery'], 'eval' => array('mandatory' => true, 'submitOnChange' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "varchar(8) NOT NULL default ''"), 'placeholder' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['placeholder'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => $GLOBALS['TL_CONFIG']['validImageTypes'], 'tl_class' => 'w50 w50h'), 'sql' => "binary(16) NULL"), 'main_size' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['main_size'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => $GLOBALS['TL_CROP'], 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'gallery_size' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['gallery_size'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => $GLOBALS['TL_CROP'], 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'lightbox_template' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_template'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'options_callback' => function () {
    // Do not use \Isotope\Backend::getTemplates() here, as they cannot be selected in a page layout!
    return array_merge(\Controller::getTemplateGroup('moo_'), \Controller::getTemplateGroup('j_'));
}, 'eval' => array('mandatory' => true, 'multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => "blob NULL"), 'lightbox_size' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_size'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => $GLOBALS['TL_CROP'], 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'main_watermark_image' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['main_watermark_image'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => $GLOBALS['TL_CONFIG']['validImageTypes'], 'tl_class' => 'clr w50 w50h'), 'sql' => "binary(16) NULL"), 'main_watermark_position' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['main_watermark_position'], 'exclude' => true, 'inputType' => 'select', 'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'), 'reference' => $GLOBALS['TL_LANG']['MSC'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'gallery_watermark_image' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['gallery_watermark_image'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => $GLOBALS['TL_CONFIG']['validImageTypes'], 'tl_class' => 'clr w50 w50h'), 'sql' => "binary(16) NULL"), 'gallery_watermark_position' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['gallery_watermark_position'], 'exclude' => true, 'inputType' => 'select', 'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'), 'reference' => $GLOBALS['TL_LANG']['MSC'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'lightbox_watermark_image' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_watermark_image'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => $GLOBALS['TL_CONFIG']['validImageTypes'], 'tl_class' => 'clr w50 w50h'), 'sql' => "binary(16) NULL"), 'lightbox_watermark_position' => array('label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_watermark_position'], 'exclude' => true, 'inputType' => 'select', 'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'), 'reference' => $GLOBALS['TL_LANG']['MSC'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'customTpl' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_gallery']['customTpl'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \Isotope\Backend::getTemplates('iso_gallery_');
}, 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''")));
Example #17
0
 /**
  * Return all event templates as array
  * @param object
  * @return array
  */
 public function getTemplates(DataContainer $dc)
 {
     return Controller::getTemplateGroup('linkliste_');
 }
 /**
  * Return all event templates as array
  * @param object
  * @return array
  */
 public function getTemplates(DataContainer $dc)
 {
     return Controller::getTemplateGroup('ce_download_');
 }
 /**
  * Load the TL_CTE, FE_MOD and TL_FFL configuration and use caching if possible
  *
  * @param  bool $bypassCache
  * @return void
  */
 public static function loadConfig($bypassCache = false)
 {
     // Don't load the config in the install tool
     if (version_compare(VERSION, '4.0', '>=')) {
         try {
             if (\System::getContainer()->get('request')->get('_route') === 'contao_backend_install') {
                 return;
             }
         } catch (\Exception $exception) {
             return;
         }
     } else {
         if (\Environment::get('script') === 'contao/install.php' || \Environment::get('script') === 'install.php') {
             return;
         }
     }
     $filePaths = static::getCacheFilePaths();
     $cacheHash = md5(implode(',', array_merge(glob(TL_ROOT . '/templates/rsce_*') ?: array(), glob(TL_ROOT . '/templates/*/rsce_*') ?: array())));
     if (!$bypassCache && file_exists($filePaths['fullPath'])) {
         $fileCacheHash = null;
         include $filePaths['fullPath'];
         if ($fileCacheHash === $cacheHash) {
             // the cache file is valid and loaded
             return;
         }
     }
     // The getInstance calls are neccessary to keep the contao instance
     // stack intact and prevent an "Invalid connection resource" exception
     if (TL_MODE === 'BE') {
         \BackendUser::getInstance();
     } else {
         if (TL_MODE === 'FE') {
             \FrontendUser::getInstance();
         }
     }
     \Database::getInstance();
     $contents = array();
     $contents[] = '<?php' . "\n";
     $contents[] = '$fileCacheHash = ' . var_export($cacheHash, true) . ';' . "\n";
     $templates = \Controller::getTemplateGroup('rsce_');
     $allConfigs = array_merge(glob(TL_ROOT . '/templates/rsce_*_config.php') ?: array(), glob(TL_ROOT . '/templates/*/rsce_*_config.php') ?: array());
     $fallbackConfigPaths = array();
     $duplicateConfigs = array_filter(array_count_values(array_map(function ($configPath) {
         return basename($configPath, '_config.php');
     }, $allConfigs)), function ($count) {
         return $count > 1;
     });
     if (count($duplicateConfigs)) {
         \System::log('Duplicate Custom Elements found: ' . implode(', ', array_keys($duplicateConfigs)), __METHOD__, TL_ERROR);
     }
     foreach ($allConfigs as $configPath) {
         $templateName = basename($configPath, '_config.php');
         if (file_exists(substr($configPath, 0, -11) . '.html5')) {
             if (!isset($templates[$templateName])) {
                 $templates[$templateName] = $templateName;
             }
             if (!isset($fallbackConfigPaths[$templateName])) {
                 $fallbackConfigPaths[$templateName] = $configPath;
             }
         }
     }
     $themes = \Database::getInstance()->prepare('SELECT name, templates FROM tl_theme')->execute()->fetchAllAssoc();
     $themeNamesByTemplateDir = array();
     foreach ($themes as $theme) {
         if ($theme['templates']) {
             $themeNamesByTemplateDir[$theme['templates']] = $theme['name'];
         }
     }
     $elements = array();
     foreach ($templates as $template => $label) {
         if (substr($template, -7) === '_config') {
             continue;
         }
         $configPath = null;
         try {
             $templatePaths = CustomTemplate::getTemplates($template);
             if (!empty($templatePaths[0])) {
                 $configPath = substr($templatePaths[0], 0, -6) . '_config.php';
             }
         } catch (\Exception $e) {
             $configPath = null;
         }
         if ($configPath === null || !file_exists($configPath)) {
             if (isset($fallbackConfigPaths[$template])) {
                 $configPath = $fallbackConfigPaths[$template];
             } else {
                 continue;
             }
         }
         $config = (include $configPath);
         $element = array('config' => $config, 'label' => isset($config['label']) ? $config['label'] : array(implode(' ', array_map('ucfirst', explode('_', substr($template, 5)))), ''), 'labelPrefix' => '', 'types' => isset($config['types']) ? $config['types'] : array('content', 'module', 'form'), 'contentCategory' => isset($config['contentCategory']) ? $config['contentCategory'] : 'custom_elements', 'moduleCategory' => isset($config['moduleCategory']) ? $config['moduleCategory'] : 'custom_elements', 'template' => $template, 'path' => substr(dirname($configPath), strlen(TL_ROOT . '/')));
         if ($element['path'] && substr($element['path'], 10)) {
             if (isset($themeNamesByTemplateDir[$element['path']])) {
                 $element['labelPrefix'] = $themeNamesByTemplateDir[$element['path']] . ': ';
             } else {
                 $element['labelPrefix'] = implode(' ', array_map('ucfirst', preg_split('(\\W)', substr($element['path'], 10)))) . ': ';
             }
         }
         $elements[] = $element;
     }
     usort($elements, function ($a, $b) {
         if ($a['path'] !== $b['path']) {
             if ($a['path'] === 'templates') {
                 return -1;
             }
             if ($b['path'] === 'templates') {
                 return 1;
             }
             return strcmp($a['labelPrefix'], $b['labelPrefix']);
         }
         return strcmp($a['template'], $b['template']);
     });
     $addLabelPrefix = count(array_unique(array_map(function ($element) {
         return $element['path'];
     }, $elements))) > 1;
     foreach ($elements as $element) {
         if (in_array('content', $element['types'])) {
             $GLOBALS['TL_CTE'][$element['contentCategory']][$element['template']] = 'MadeYourDay\\Contao\\Element\\CustomElement';
             $contents[] = '$GLOBALS[\'TL_CTE\'][\'' . $element['contentCategory'] . '\'][\'' . $element['template'] . '\'] = \'MadeYourDay\\\\Contao\\\\Element\\\\CustomElement\';';
             $GLOBALS['TL_LANG']['CTE'][$element['template']] = static::getLabelTranslated($element['label']);
             $contents[] = '$GLOBALS[\'TL_LANG\'][\'CTE\'][\'' . $element['template'] . '\'] = \\MadeYourDay\\Contao\\CustomElements::getLabelTranslated(' . var_export($element['label'], true) . ');';
             if ($addLabelPrefix && $element['labelPrefix']) {
                 $GLOBALS['TL_LANG']['CTE'][$element['template']][0] = $element['labelPrefix'] . $GLOBALS['TL_LANG']['CTE'][$element['template']][0];
                 $contents[] = '$GLOBALS[\'TL_LANG\'][\'CTE\'][\'' . $element['template'] . '\'][0] = ' . var_export($element['labelPrefix'], true) . ' . $GLOBALS[\'TL_LANG\'][\'CTE\'][\'' . $element['template'] . '\'][0];';
             }
         }
         if (in_array('module', $element['types'])) {
             $GLOBALS['FE_MOD'][$element['moduleCategory']][$element['template']] = 'MadeYourDay\\Contao\\Element\\CustomElement';
             $contents[] = '$GLOBALS[\'FE_MOD\'][\'' . $element['moduleCategory'] . '\'][\'' . $element['template'] . '\'] = \'MadeYourDay\\\\Contao\\\\Element\\\\CustomElement\';';
             $GLOBALS['TL_LANG']['FMD'][$element['template']] = static::getLabelTranslated($element['label']);
             $contents[] = '$GLOBALS[\'TL_LANG\'][\'FMD\'][\'' . $element['template'] . '\'] = \\MadeYourDay\\Contao\\CustomElements::getLabelTranslated(' . var_export($element['label'], true) . ');';
             if ($addLabelPrefix && $element['labelPrefix']) {
                 $GLOBALS['TL_LANG']['FMD'][$element['template']][0] = $element['labelPrefix'] . $GLOBALS['TL_LANG']['FMD'][$element['template']][0];
                 $contents[] = '$GLOBALS[\'TL_LANG\'][\'FMD\'][\'' . $element['template'] . '\'][0] = ' . var_export($element['labelPrefix'], true) . ' . $GLOBALS[\'TL_LANG\'][\'FMD\'][\'' . $element['template'] . '\'][0];';
             }
         }
         if (in_array('form', $element['types'])) {
             $GLOBALS['TL_FFL'][$element['template']] = 'MadeYourDay\\Contao\\Form\\CustomWidget';
             $contents[] = '$GLOBALS[\'TL_FFL\'][\'' . $element['template'] . '\'] = \'MadeYourDay\\\\Contao\\\\Form\\\\CustomWidget\';';
             $GLOBALS['TL_LANG']['FFL'][$element['template']] = static::getLabelTranslated($element['label']);
             $contents[] = '$GLOBALS[\'TL_LANG\'][\'FFL\'][\'' . $element['template'] . '\'] = \\MadeYourDay\\Contao\\CustomElements::getLabelTranslated(' . var_export($element['label'], true) . ');';
             if ($addLabelPrefix && $element['labelPrefix']) {
                 $GLOBALS['TL_LANG']['FFL'][$element['template']][0] = $element['labelPrefix'] . $GLOBALS['TL_LANG']['FFL'][$element['template']][0];
                 $contents[] = '$GLOBALS[\'TL_LANG\'][\'FFL\'][\'' . $element['template'] . '\'][0] = ' . var_export($element['labelPrefix'], true) . ' . $GLOBALS[\'TL_LANG\'][\'FFL\'][\'' . $element['template'] . '\'][0];';
             }
         }
         if (!empty($element['config']['wrapper']['type'])) {
             $GLOBALS['TL_WRAPPERS'][$element['config']['wrapper']['type']][] = $element['template'];
             $contents[] = '$GLOBALS[\'TL_WRAPPERS\'][' . var_export($element['config']['wrapper']['type'], true) . '][] = ' . var_export($element['template'], true) . ';';
         }
     }
     $file = new \File($filePaths['path'], true);
     $file->write(implode("\n", $contents));
     $file->close();
     static::refreshOpcodeCache($filePaths['fullPath']);
 }
/**
 * Add global callbacks
 */
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = ['Derhaeuptling\\VimeoApi\\DataContainer\\ContentContainer', 'rebuildVimeoCache'];
/**
 * Add palettes
 */
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'vimeo_customPoster';
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'vimeo_lightbox';
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'vimeo_link';
$GLOBALS['TL_DCA']['tl_content']['palettes']['vimeo_album'] = '{type_legend},type,headline;{source_legend},vimeo_albumId,vimeo_lightbox,vimeo_sorting,vimeo_sortingDirection;{template_legend:hide},customTpl,vimeo_template,size;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['vimeo_video'] = '{type_legend},type,headline;{source_legend},vimeo_videoId,vimeo_customName,vimeo_lightbox,vimeo_link;{poster_legend:hide},vimeo_customPoster;{template_legend:hide},customTpl,vimeo_template,size;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vimeo_customPoster'] = 'singleSRC';
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vimeo_lightbox'] = 'vimeo_lightboxAutoplay';
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vimeo_link'] = 'url,titleText';
/**
 * Add fields
 */
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_albumId'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_albumId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 32, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_videoId'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_videoId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 32, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_customName'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_customName'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_lightbox'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_lightbox'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_lightbox'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_lightbox'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_lightboxAutoplay'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_lightboxAutoplay'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_link'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_link'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_customPoster'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_customPoster'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_template'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_template'], 'default' => 'vimeo_default', 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \Controller::getTemplateGroup('vimeo_');
}, 'eval' => array('chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_sorting'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sorting'], 'exclude' => true, 'inputType' => 'select', 'options' => ['manual', 'date', 'alphabetical', 'plays', 'likes', 'comments', 'duration', 'modified_time'], 'reference' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sorting'], 'eval' => array('includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sorting']['blank'], 'tl_class' => 'w50'), 'sql' => "varchar(13) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_content']['fields']['vimeo_sortingDirection'] = ['label' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sortingDirection'], 'exclude' => true, 'inputType' => 'select', 'options' => ['asc', 'desc'], 'reference' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sortingDirection'], 'eval' => ['includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_content']['vimeo_sortingDirection']['blank'], 'tl_class' => 'w50'], 'sql' => "varchar(4) NOT NULL default ''"];
Example #21
0
 /**
  * List template from all themes, show theme name
  *
  * @param string $strPrefix
  *
  * @return array
  */
 public static function getTemplates($strPrefix)
 {
     $arrTemplates = \Controller::getTemplateGroup($strPrefix);
     // Try to select the shop configs
     try {
         $objConfig = Config::findAll(array('order' => 'name'));
     } catch (\Exception $e) {
         $objConfig = null;
     }
     // Add the shop config templates
     if (null !== $objConfig) {
         while ($objConfig->next()) {
             if ($objConfig->templateGroup != '') {
                 $arrConfigTemplates = glob(TL_ROOT . '/' . $objConfig->templateGroup . '/' . $strPrefix . '*');
                 if (is_array($arrConfigTemplates)) {
                     foreach ($arrConfigTemplates as $strFile) {
                         $strTemplate = basename($strFile, strrchr($strFile, '.'));
                         if (!isset($arrTemplates[$strTemplate])) {
                             $arrTemplates[$strTemplate] = $strTemplate;
                         } else {
                             $arrTemplates[$strTemplate] = substr($arrTemplates[$strTemplate], 0, -1) . ', ' . sprintf($GLOBALS['TL_LANG']['MSC']['templatesConfig'], $objConfig->name) . ')';
                         }
                     }
                 }
             }
         }
     }
     return $arrTemplates;
 }
Example #22
0
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2005-2015 Leo Feyer
 *
 * @license LGPL-3.0+
 */
/**
 * Table tl_newsletter
 */
$GLOBALS['TL_DCA']['tl_newsletter'] = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_newsletter_channel', 'enableVersioning' => true, 'onload_callback' => array(array('tl_newsletter', 'checkPermission')), 'sql' => array('keys' => array('id' => 'primary', 'pid' => 'index'))), 'list' => array('sorting' => array('mode' => 4, 'fields' => array('sent', 'date DESC', 'tstamp DESC'), 'headerFields' => array('title', 'jumpTo', 'tstamp', 'sender'), 'panelLayout' => 'filter;sort,search,limit', 'child_record_callback' => array('tl_newsletter', 'listNewsletters')), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['copy'], 'href' => 'act=paste&amp;mode=copy', 'icon' => 'copy.gif'), 'cut' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['cut'], 'href' => 'act=paste&amp;mode=cut', 'icon' => 'cut.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'send' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['send'], 'href' => 'key=send', 'icon' => 'bundles/contaonewsletter/icon.gif'))), 'palettes' => array('__selector__' => array('addFile'), 'default' => '{title_legend},subject,alias;{html_legend},content;{text_legend:hide},text;{attachment_legend},addFile;{template_legend:hide},template;{sender_legend:hide},sender,senderName;{expert_legend:hide},sendText,externalImages'), 'subpalettes' => array('addFile' => 'files'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_newsletter_channel.title', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'eager')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'subject' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['subject'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'decodeEntities' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['alias'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'alias', 'unique' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'save_callback' => array(array('tl_newsletter', 'generateAlias')), 'sql' => "varchar(128) COLLATE utf8_bin NOT NULL default ''"), 'content' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['content'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyNews', 'helpwizard' => true), 'explanation' => 'insertTags', 'load_callback' => array(array('tl_newsletter', 'convertAbsoluteLinks')), 'save_callback' => array(array('tl_newsletter', 'convertRelativeLinks')), 'sql' => "mediumtext NULL"), 'text' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['text'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('decodeEntities' => true, 'class' => 'noresize'), 'sql' => "mediumtext NULL"), 'addFile' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['addFile'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'files' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['files'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox', 'filesOnly' => true, 'mandatory' => true), 'sql' => "blob NULL"), 'template' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['template'], 'exclude' => true, 'inputType' => 'select', 'eval' => array('includeBlankOption' => true), 'options_callback' => function () {
    return Controller::getTemplateGroup('mail_');
}, 'sql' => "varchar(32) NOT NULL default ''"), 'sendText' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['sendText'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'externalImages' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['externalImages'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'sender' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['sender'], 'exclude' => true, 'search' => true, 'filter' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'email', 'maxlength' => 128, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'senderName' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['senderName'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 11, 'inputType' => 'text', 'eval' => array('decodeEntities' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'sent' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['sent'], 'filter' => true, 'sorting' => true, 'flag' => 11, 'eval' => array('doNotCopy' => true, 'isBoolean' => true), 'sql' => "char(1) NOT NULL default ''"), 'date' => array('label' => &$GLOBALS['TL_LANG']['tl_newsletter']['mailingDate'], 'filter' => true, 'sorting' => true, 'flag' => 8, 'eval' => array('rgxp' => 'datim'), 'sql' => "varchar(10) NOT NULL default ''")));
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class tl_newsletter extends Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
        parent::__construct();
        $this->import('BackendUser', 'User');
    }
    /**
Example #23
0
        {title_legend},name,headline,type;
        {config_legend},anystores_categories,jumpTo;
        {map_legend},anystores_latitude,anystores_longitude,anystores_mapheight,anystores_defaultMarker;
        {map_api_legend},anystores_mapsApi;
        {template_legend:hide},customTpl,anystores_detailTpl;
        {expert_legend:hide},guests,cssID,space
    ', 'anystores_searchmap' => '
        {title_legend},name,headline,type;
        {config_legend},anystores_categories,jumpTo,anystores_defaultCountry,anystores_listLimit,anystores_allowEmptySearch,anystores_limitDistance;
        {map_legend},anystores_latitude,anystores_longitude,anystores_mapheight,anystores_defaultMarker;
        {map_api_legend},anystores_mapsApi;
        {template_legend:hide},customTpl,anystores_detailTpl;
        {expert_legend:hide},guests,cssID,space
    '));
/**
 * Selector
 */
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'anystores_mapsApi';
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'anystores_limitDistance';
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'anystores_allowEmptySearch';
/**
 * Subpalettes
 */
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['anystores_mapsApi_GoogleMaps'] = 'anystores_zoom,anystores_maptype,anystores_streetview,anystores_signedIn';
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['anystores_allowEmptySearch'] = 'anystores_sortingOrder';
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['anystores_limitDistance'] = 'anystores_maxDistance';
/**
 * Add fields to tl_module
 */
array_insert($GLOBALS['TL_DCA']['tl_module']['fields'], 0, array('anystores_defaultCountry' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_defaultCountry'], 'exclude' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'anystores_categories' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_categories'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_anystores_category.title', 'eval' => array('mandatory' => true, 'multiple' => true), 'sql' => "text NULL"), 'anystores_listLimit' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_listLimit'], 'exclude' => true, 'inputType' => 'text', 'default' => '10', 'eval' => array('mandatory' => true, 'maxlength' => 4, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "smallint(4) unsigned NOT NULL default '10'"), 'anystores_allowEmptySearch' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_allowEmptySearch'], 'exclude' => true, 'inputType' => 'checkbox', 'default' => true, 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_sortingOrder' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_sortingOrder'], 'exclude' => true, 'inputType' => 'text', 'default' => 'postal', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_limitDistance' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_limitDistance'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50 m12 clr'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_maxDistance' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_maxDistance'], 'exclude' => true, 'inputType' => 'text', 'default' => '10', 'eval' => array('mandatory' => true, 'maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default '10'"), 'anystores_detailTpl' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_detailTpl'], 'exclude' => true, 'inputType' => 'select', 'options' => Controller::getTemplateGroup('anystores_'), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_mapTpl' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_mapTpl'], 'exclude' => true, 'inputType' => 'select', 'options' => Controller::getTemplateGroup('map_'), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'anystores_latitude' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_latitude'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'default' => 0, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "float(10,6) NOT NULL"), 'anystores_longitude' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_longitude'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'default' => 0, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "float(10,6) NOT NULL"), 'anystores_zoom' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_zoom'], 'exclude' => true, 'inputType' => 'select', 'options' => range(1, 18), 'eval' => array('default' => 6, 'tl_class' => 'clr w50'), 'sql' => "tinyint(2) unsigned NOT NULL default '6'"), 'anystores_streetview' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_streetview'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'anystores_maptype' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_maptype'], 'exclude' => true, 'inputType' => 'select', 'options' => array('roadmap', 'satellite', 'hybrid', 'terrain'), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(9) NOT NULL default 'roadmap'"), 'anystores_mapheight' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_mapheight'], 'exclude' => true, 'inputType' => 'inputUnit', 'options' => $GLOBALS['TL_CSS_UNITS'], 'eval' => array('default' => 500, 'maxlength' => 3, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'anystores_defaultMarker' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_defaultMarker'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('files' => true, 'fieldType' => 'radio', 'extensions' => Config::get('validImageTypes'), 'tl_class' => 'w50'), 'sql' => "binary(16) NULL"), 'anystores_mapsApi' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_mapsApi'], 'inputType' => 'select', 'options' => array('GoogleMaps' => 'Google Maps'), 'eval' => array('submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default 'GoogleMaps'"), 'anystores_signedIn' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['anystores_signedIn'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''")));