示例#1
0
 /**
  * @deprecated
  */
 public static function loadStoreDetails(array $arrStore, $jumpTo = null)
 {
     //load country names
     //@todo load only once. not every time.
     $arrCountryNames = \System::getCountries();
     //full localized country name
     //@todo rename country to countrycode in database
     $arrStore['countrycode'] = $arrStore['country'];
     $arrStore['country'] = $arrCountryNames[$arrStore['countrycode']];
     // generate jump to
     if ($jumpTo) {
         if (($objLocation = \PageModel::findByPk($jumpTo)) !== null) {
             //@todo language parameter
             $strStoreKey = !$GLOBALS['TL_CONFIG']['useAutoItem'] ? '/store/' : '/';
             $strStoreValue = $arrStore['alias'];
             $arrStore['href'] = \Controller::generateFrontendUrl($objLocation->row(), $strStoreKey . $strStoreValue);
         }
     }
     // opening times
     $arrStore['opening_times'] = deserialize($arrStore['opening_times']);
     // store logo
     //@todo change size and properties in module
     if ($arrStore['logo']) {
         if (($objLogo = \FilesModel::findByUuid($arrStore['logo'])) !== null) {
             $arrLogo = $objLogo->row();
             $arrMeta = deserialize($arrLogo['meta']);
             $arrLogo['meta'] = $arrMeta[$GLOBALS['TL_LANGUAGE']];
             $arrStore['logo'] = $arrLogo;
         } else {
             $arrStore['logo'] = null;
         }
     }
     return $arrStore;
 }
示例#2
0
 /**
  * Fills coordinates if not already set and saving
  * @param DataContainer
  * @return bool
  */
 public function fillCoordinates(DataContainer $dc)
 {
     // Return if both are numeric
     if (is_numeric($dc->activeRecord->latitude) && is_numeric($dc->activeRecord->longitude)) {
         return;
     }
     // Get country name
     $arrCountries = \System::getCountries();
     // find coordinates
     $arrCoords = AnyStores::getLonLat(sprintf('%s, %s %s, %s', $dc->activeRecord->street, $dc->activeRecord->postal, $dc->activeRecord->city, $arrCountries[$dc->activeRecord->country]));
     if (!empty($arrCoords)) {
         $objStore = AnyStoresModel::findByPk($dc->id);
         $objStore->latitude = $arrCoords['latitude'];
         $objStore->longitude = $arrCoords['longitude'];
         $objStore->save();
     }
 }
 /**
  * Generate module
  */
 protected function compile()
 {
     // unique form id
     $strFormId = 'anystores_search_' . $this->id;
     // localize url parameter keys
     $strSearchKey = $GLOBALS['TL_LANG']['anystores']['url_params']['search'] ?: 'search';
     $strSearchValue = \Input::post($strSearchKey);
     $strCountryKey = $GLOBALS['TL_LANG']['anystores']['url_params']['country'] ?: 'country';
     $strCountryValue = \Input::post($strCountryKey);
     // redirect if form was send
     if (\Input::post('FORM_SUBMIT') == $strFormId && ($this->anystores_allowEmptySearch || !empty($strSearchValue))) {
         $intPageId = $this->jumpTo ?: $GLOBALS['objPage']->id;
         $objPage = \PageModel::findByPk($intPageId);
         if ($objPage) {
             /**
              * Build url
              * @example /search/_term_/country/_de_
              */
             $strPageUrl = $this->generateFrontendUrl($objPage->row(), "/{$strSearchKey}/" . $this->encodeSearchValue($strSearchValue) . "/{$strCountryKey}/" . $strCountryValue);
             $this->redirect($strPageUrl, 302);
         }
         $this->log("Can't find redirect page in module ID {$this->id}", __METHOD__, TL_ERROR);
     }
     // render countries for the dropdown
     if (($objCountries = AnyStoresModel::findAllPublished()) !== null) {
         $arrCountries = array_unique($objCountries->fetchEach('country'));
         $arrCountryNames = \System::getCountries();
         foreach ($arrCountries as $country) {
             $arrCountryOptions[$country] = $arrCountryNames[$country];
         }
         asort($arrCountryOptions);
         $this->Template->countryOptions = $arrCountryOptions;
     }
     $this->Template->formId = $strFormId;
     $this->Template->formAction = \Environment::get('indexFreeRequest');
     $this->Template->searchName = $strSearchKey;
     $this->Template->searchId = 'ctrl_search_' . $this->id;
     $this->Template->searchValue = \Input::get($strSearchKey);
     $this->Template->countryName = $strCountryKey;
     $this->Template->countryId = 'ctrl_country_' . $this->id;
     $this->Template->countryValue = \Input::get($strCountryKey) ?: $GLOBALS['TL_LANGUAGE'];
 }
示例#4
0
<?php

/******************************************************************
 *
 * (c) 2014 Stephan Preßl <*****@*****.**>
 * All rights reserved
 *
 * Modification, distribution or any other action on or with
 * this file is permitted unless explicitly granted by DesProSeo
 * www.desproseo.at <*****@*****.**>
 *
 ******************************************************************/
/**
 * table tl_dps_website
 */
$GLOBALS['TL_DCA']['tl_dps_website'] = array('config' => array('dataContainer' => 'File', 'closed' => true), 'palettes' => array('__selector__' => array(), 'default' => '{address_legend},dps_websiteCompany,dps_websiteOwner,dps_websiteStreet,dps_websitePostal,dps_websiteCity,dps_websiteState,dps_websiteCountry;' . '{contact_legend},dps_websitePhone,dps_websiteMobile,dps_websiteFax,dps_websiteEmail,dps_websiteWebsite;' . '{logo_legend},dps_websiteLogo,dps_websiteLogoAlt,dps_websiteLogoTitle,dps_websiteLogoSize,dps_websiteLogoImagemargin,dps_websiteLogoImageUrl,dps_websiteLogoCaption;' . '{sublogo_legend},dps_websiteSublogo,dps_websiteSublogoAlt,dps_websiteSublogoTitle,dps_websiteSublogoSize,dps_websiteSublogoImagemargin,dps_websiteSublogoImageUrl,dps_websiteSublogoCaption;'), 'subpalettes' => array('useSMTP' => 'smtpHost,smtpUser,smtpPass,smtpEnc,smtpPort'), 'fields' => array('dps_websiteCompany' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['company'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteOwner' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['owner'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteStreet' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['street'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'long')), 'dps_websitePostal' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['postal'], 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'tl_class' => 'w50')), 'dps_websiteCity' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['city'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteState' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['state'], 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50')), 'dps_websiteCountry' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['country'], 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50')), 'dps_websitePhone' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['phone'], 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50', 'rgxp' => 'phone')), 'dps_websiteMobile' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['mobile'], 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50', 'rgxp' => 'phone')), 'dps_websiteFax' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['fax'], 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50', 'rgxp' => 'phone')), 'dps_websiteEmail' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['email'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'rgxp' => 'email')), 'dps_websiteWebsite' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['website'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'rgxp' => 'url')), 'dps_websiteLogo' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logo'], 'inputType' => 'fileTree', 'eval' => array('filesOnly' => true, 'fieldType' => 'radio', 'tl_class' => 'clr'), 'save_callback' => array(array('DPS\\Customize\\Tables', 'storeFileMetaInformation'))), 'dps_websiteLogoAlt' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoAlt'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteLogoTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoTitle'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteLogoSize' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoSize'], 'inputType' => 'imageSize', 'options' => $GLOBALS['TL_CROP'], 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50')), 'dps_websiteLogoImagemargin' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoImagemargin'], 'inputType' => 'trbl', 'options' => array('px', '%', 'em', 'rem', 'ex', 'pt', 'pc', 'in', 'cm', 'mm'), 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50')), 'dps_websiteLogoImageUrl' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoImageUrl'], 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'decodeEntities' => true, 'maxlength' => 255, 'tl_class' => 'w50 wizard'), 'wizard' => array(array('DPS\\Customize\\Tables', 'pagePicker'))), 'dps_websiteLogoCaption' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['logoCaption'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'allowHtml' => true, 'tl_class' => 'w50')), 'dps_websiteSublogo' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogo'], 'inputType' => 'fileTree', 'eval' => array('filesOnly' => true, 'fieldType' => 'radio', 'tl_class' => 'clr'), 'save_callback' => array(array('DPS\\Customize\\Tables', 'storeFileMetaInformation'))), 'dps_websiteSublogoAlt' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoAlt'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteSublogoTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoTitle'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50')), 'dps_websiteSublogoSize' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoSize'], 'inputType' => 'imageSize', 'options' => $GLOBALS['TL_CROP'], 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50')), 'dps_websiteSublogoImagemargin' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoImagemargin'], 'inputType' => 'trbl', 'options' => array('px', '%', 'em', 'rem', 'ex', 'pt', 'pc', 'in', 'cm', 'mm'), 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50')), 'dps_websiteSublogoImageUrl' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoImageUrl'], 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'decodeEntities' => true, 'maxlength' => 255, 'tl_class' => 'w50 wizard'), 'wizard' => array(array('DPS\\Customize\\Tables', 'pagePicker'))), 'dps_websiteSublogoCaption' => array('label' => &$GLOBALS['TL_LANG']['tl_dps_website']['sublogoCaption'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'allowHtml' => true, 'tl_class' => 'w50'))));
示例#5
0
 * @author      Daniel Jahnsmüller <*****@*****.**>
 *              Benny Born <*****@*****.**>
 * @license     http://opensource.org/licenses/lgpl-3.0.html
 * @package     anyStores
 */
/**
 * Table tl_anystores
 */
$GLOBALS['TL_DCA']['tl_anystores'] = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_anystores_category', 'ctable' => array('tl_content'), 'enableVersioning' => true, 'onsubmit_callback' => array(array('tl_anystores', 'fillCoordinates'), array('tl_anystores', 'clearOpeningTimes')), 'sql' => array('keys' => array('id' => 'primary', 'pid' => 'index', 'pid,name,street,postal,city,country' => 'unique'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('name', 'street', 'postal', 'city', 'country'), 'showColumns' => true), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'edit_description' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['edit_description'], 'href' => 'table=tl_content', 'icon' => 'system/modules/anyStores/assets/images/description.png'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'coords' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['coords'], 'href' => 'act=show', 'icon' => array('system/modules/anyStores/assets/images/coords0.png', 'system/modules/anyStores/assets/images/coords1.png'), 'button_callback' => array('tl_anystores', 'coordsButton')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_anystores', 'toggleIcon')))), 'palettes' => array('__selector__' => array('published'), 'default' => '
            {common_legend},pid,name,alias,phone,fax,url,target,email,logo,description;
            {adress_legend},street,postal,city,country;
            {times_legend},opening_times;
            {geo_legend},geo_explain,longitude,map,latitude;
            {seo_legend},metatitle,metadescription;
            {publish_legend},published
        '), 'subpalettes' => array('published' => 'start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['pid'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => 'tl_anystores_category.title', 'eval' => array('mandatory' => true, 'tl_class' => 'clr'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['name'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'sorting' => true, 'filter' => true, 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['alias'], 'exclude' => true, 'inputType' => 'text', 'search' => true, 'eval' => array('rgxp' => 'alias', 'doNotCopy' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'save_callback' => array(array('tl_anystores', 'generateAlias')), 'sql' => "varchar(128) COLLATE utf8_bin NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['email'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('rgxp' => 'email', 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'url' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['url'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('rgxp' => 'url', 'decodeEntities' => true, 'maxlength' => 255, 'tl_class' => 'w50 wizard'), 'wizard' => array(array('tl_anystores', 'pagePicker')), 'sql' => "varchar(255) NOT NULL default ''"), 'target' => array('label' => &$GLOBALS['TL_LANG']['MSC']['target'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['phone'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('rgxp' => 'phone', 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['fax'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('rgxp' => 'phone', 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'logo' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['logo'], 'inputType' => 'fileTree', 'exclude' => true, 'eval' => array('filesOnly' => true, 'extensions' => $GLOBALS['TL_CONFIG']['validImageTypes'], 'fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['street'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'eval' => array('mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['postal'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'sorting' => true, 'filter' => true, 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgxp' => 'alphanum', 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['city'], 'inputType' => 'text', 'exclude' => true, 'search' => true, 'sorting' => true, 'filter' => true, 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['country'], 'inputType' => 'select', 'exclude' => true, 'options' => System::getCountries(), 'default' => 'de', 'search' => true, 'sorting' => true, 'filter' => true, 'flag' => 1, 'eval' => array('mandatory' => true, 'maxlength' => 64, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default 'de'"), 'description' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['description'], 'inputType' => 'textarea', 'exclude' => true, 'eval' => array('rte' => 'tinyMCE', 'tl_class' => 'long'), 'sql' => "text NULL"), 'opening_times' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['opening_times'], 'inputType' => 'multiColumnWizard', 'exclude' => true, 'eval' => array('doNotShow' => true, 'columnFields' => array('weekday' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['times_weekday'], 'inputType' => 'select', 'options' => &$GLOBALS['TL_LANG']['anystores']['days'], 'search' => true, 'eval' => array('style' => 'width:380px')), 'from' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['times_from'], 'inputType' => 'text', 'eval' => array('maxlength' => 8, 'style' => 'width:50px')), 'to' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['times_to'], 'inputType' => 'text', 'eval' => array('mandatory' => false, 'maxlength' => 8, 'style' => 'width:50px')), 'isClosed' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['times_isClosed'], 'inputType' => 'checkbox'))), 'sql' => "text NULL"), 'longitude' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['longitude'], 'inputType' => 'text', 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'latitude' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['latitude'], 'inputType' => 'text', 'search' => true, 'eval' => array('mandatory' => false, 'maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'map' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['latitude'], 'input_field_callback' => array('tl_anystores', 'showMap'), 'eval' => array('doNotShow' => true)), 'geo_explain' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['latitude'], 'input_field_callback' => function () {
    return '<div class="tl_help">' . $GLOBALS['TL_LANG']['tl_anystores']['geo_explain'][0] . '</div>';
}), 'file' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['import']['file'], 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => 'csv', 'class' => 'mandatory')), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['published'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'metatitle' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['metatitle'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255), 'sql' => "varchar(255) NOT NULL default ''"), 'metadescription' => array('label' => &$GLOBALS['TL_LANG']['tl_anystores']['metadescription'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('maxlength' => 255), 'sql' => "varchar(255) NOT NULL default ''")));
class tl_anystores extends Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
        parent::__construct();
        $this->import('BackendUser', 'User');
    }
    /**
     * Generates button to show if coordinates are available
     * @param array
示例#6
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")));
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2005-2015 Leo Feyer
 *
 * @license LGPL-3.0+
 */
/**
 * Table tl_member
 */
$GLOBALS['TL_DCA']['tl_member'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onsubmit_callback' => array(array('tl_member', 'storeDateAdded'), array('tl_member', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_member', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index', 'autologin' => 'unique', 'activation' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'firstname', 'lastname', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_member', 'addIcon')), '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_member']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_member', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['su'], 'href' => 'key=su', 'icon' => 'su.gif', 'button_callback' => array('tl_member', 'switchUser')))), 'palettes' => array('__selector__' => array('login', 'assignDir'), 'default' => '{personal_legend},firstname,lastname,dateOfBirth,gender;{address_legend:hide},company,street,postal,city,state,country;{contact_legend},phone,mobile,fax,email,website,language;{groups_legend},groups;{login_legend},login;{homedir_legend:hide},assignDir;{account_legend},disable,start,stop'), 'subpalettes' => array('login' => 'username,password', 'assignDir' => 'homeDir'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['firstname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(11) NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('includeBlankOption' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'state' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['state'], 'exclude' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'mobile' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['mobile'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'unique' => true, 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['language'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'options' => System::getLanguages(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'rgxp' => 'locale', 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(5) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true, 'feEditable' => true, 'feGroup' => 'login'), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'login' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['login'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'unique' => true, 'nullIfEmpty' => true, 'rgxp' => 'extnd', 'nospace' => true, 'maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'login'), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength'), 'feEditable' => true, 'feGroup' => 'login'), 'save_callback' => array(array('tl_member', 'setNewPassword')), 'sql' => "varchar(128) NOT NULL default ''"), 'assignDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['assignDir'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'homeDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['homeDir'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['disable'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['currentLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'session' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'autologin' => array('default' => null, 'eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NULL"), 'createdOn' => array('eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'activation' => array('eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NOT NULL default ''")));
/**
 * Filter disabled groups in the front end (see #6757)
 */
if (TL_MODE == 'FE') {
    $GLOBALS['TL_DCA']['tl_member']['fields']['groups']['options_callback'] = array('tl_member', 'getActiveGroups');
}
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class tl_member extends Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2015 Heimrich & Hannot GmbH
 *
 * @package extended_events
 * @author  Rico Kaltofen <*****@*****.**>
 * @license http://www.gnu.org/licences/lgpl-3.0.html LGPL
 */
/**
 * Table tl_calendar_promoters
 */
$GLOBALS['TL_DCA']['tl_calendar_promoters'] = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_calendar', 'switchToEdit' => true, 'enableVersioning' => true, 'onload_callback' => array(array('tl_calendar_promoters', 'checkPermission')), 'onsubmit_callback' => array('setDateAdded' => array('HeimrichHannot\\HastePlus\\Utilities', 'setDateAdded')), 'sql' => array('keys' => array('id' => 'primary', 'pid' => 'index'))), 'list' => array('sorting' => array('mode' => 4, 'fields' => array('title'), 'headerFields' => array('title', 'jumpTo', 'tstamp', 'protected', 'allowComments', 'makeFeed'), 'panelLayout' => 'filter;sort,search,limit', 'child_record_callback' => array('tl_calendar_promoters', 'listPromoters'), 'child_record_class' => 'no_padding'), '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_calendar_promoters']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['copy'], 'href' => 'act=paste&amp;mode=copy', 'icon' => 'copy.gif'), 'cut' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['cut'], 'href' => 'act=paste&amp;mode=cut', 'icon' => 'cut.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_calendar_promoters', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('published'), 'default' => '{type_legend},type;{title_legend},title,alias;{teaser_legend},subtitle,teaser;{address_legend},company,street,postal,city,country,singleCoords;{contact_legend},contactName,phone,fax,email,website,room;{contact_legend},website;{publish_legend},published'), 'subpalettes' => array('published' => 'start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_calendar.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'"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['type'], 'exclude' => true, 'search' => true, 'filter' => true, 'inputType' => 'select', 'default' => CALENDARPLUS_PROMOTER_TYPE_DEFAULT, 'options_callback' => array('HeimrichHannot\\CalendarPlus\\Utils\\Options', 'getPromoterTypes'), 'reference' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['type'], 'eval' => array('tl_class' => 'w50', 'submitOnChange' => true), 'sql' => "varchar(64) NOT NULL default ''"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['title'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['alias'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'alias', 'unique' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'save_callback' => array(array('tl_calendar_promoters', 'generateAlias')), 'sql' => "varchar(128) COLLATE utf8_bin NOT NULL default ''"), 'subtitle' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['subtitle'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'long'), 'sql' => "varchar(255) NOT NULL default ''"), 'teaser' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['teaser'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyMCE', 'tl_class' => 'clr'), 'sql' => "text NULL"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'singleCoords' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['singleCoords'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", 'save_callback' => array(array('tl_calendar_promoters', 'generateSingleCoords'))), 'contactName' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['contactName'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'rgxp' => 'email', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'room' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['room'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'foreignKey' => 'tl_calendar_room.id', 'options_callback' => array('tl_calendar_promoters', 'getAvailableRooms'), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'relation' => array('type' => 'belongsTo', 'load' => 'eager'), 'wizard' => array(array('tl_calendar_promoters', 'editRoom')), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'text' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['text'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyMCE', 'tl_class' => 'clr'), 'sql' => "text NULL"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['published'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_promoters']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''")));
/**
 * Class tl_calendar_promoters
 *
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @package extended_events
 * @author  Rico Kaltofen <*****@*****.**>
 * @license http://www.gnu.org/licences/lgpl-3.0.html LGPL
 **/
class tl_calendar_promoters extends Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
<?php

$GLOBALS['TL_DCA']['tl_calendar_room'] = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_calendar_room_archive', 'enableVersioning' => true, 'onload_callback' => array(array('tl_calendar_room', 'checkPermission')), 'onsubmit_callback' => array('setDateAdded' => array('HeimrichHannot\\HastePlus\\Utilities', 'setDateAdded')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('label' => array('fields' => array('id')), 'sorting' => array('mode' => 4, 'fields' => array('title'), 'headerFields' => array('title', 'jumpTo', 'tstamp', 'protected', 'allowComments', 'makeFeed'), 'panelLayout' => 'filter;sort,search,limit', 'child_record_callback' => array('tl_calendar_room', 'listRooms'), 'child_record_class' => 'no_padding'), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_calendar_room', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('published'), 'default' => '{title_legend},title,shortTitle,alias;{address_legend},street,postal,city,country,singleCoords;{room_legend},floor,isIndoor;{publish_legend},published'), 'subpalettes' => array('published' => 'start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_calendar_room_archive.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'"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['title'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'mandatory' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'shortTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['shortTitle'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 128, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'alias' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['alias'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'alias', 'unique' => true, 'maxlength' => 128, 'tl_class' => 'w50'), 'save_callback' => array(array('tl_calendar_room', 'generateAlias')), 'sql' => "varchar(128) COLLATE utf8_bin NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'singleCoords' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['singleCoords'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''", 'save_callback' => array(array('tl_calendar_room', 'generateSingleCoords'))), 'floor' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['floor'], 'exclude' => true, 'search' => true, 'default' => 0, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50', 'rgxp' => 'digit'), 'sql' => "int(10) NOT NULL"), 'isIndoor' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['isIndoor'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 clr'), 'default' => true, 'sql' => "char(1) NOT NULL default '1'"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['published'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_calendar_room']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''")));
class tl_calendar_room extends \Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
        parent::__construct();
        $this->import('BackendUser', 'User');
    }
    /**
     * Check permissions to edit table tl_calendar_events
     */
    public function checkPermission()
    {
        if ($this->User->isAdmin) {
            return;
        }
        // Set root IDs
        if (!is_array($this->User->calendars) || empty($this->User->calendars)) {
            $root = array(0);
        } else {
            $root = $this->User->calendars;
        }
        $archiveId = strlen(Input::get('id')) ? Input::get('id') : CURRENT_ID;
        $objRoomArchive = \HeimrichHannot\CalendarPlus\CalendarRoomArchiveModel::findByPk($archiveId);
        if ($objRoomArchive !== null) {
            $id = $objRoomArchive->pid;
<?php

/**
 * @package   Kontor4
 * @copyright KONTOR4, Agentur für neue Medien 2014 <*****@*****.**>
 * @license   For the full copyright and license information, please view the
 *            license.txt file that was distributed with this source code.
 */
$GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default'] = str_replace('endDate;', 'endDate,ignoreDynamic;', $GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default']);
$GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default'] = str_replace(",location,", ",location,strasse,plz,ort,land,status,", $GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default']);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields'] = array_merge($GLOBALS['TL_DCA']['tl_calendar_events']['fields'], array('ignoreDynamic' => array('label' => &$GLOBALS['TL_LANG']['tl_c2a_settings']['ignoreDynamics'], 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NULL"), 'strasse' => array('label' => &$GLOBALS['TL_LANG']['tl_c2a_settings']['strasse'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NULL"), 'plz' => array('label' => &$GLOBALS['TL_LANG']['tl_c2a_settings']['plz'], 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'tl_class' => 'w50'), 'sql' => "varchar(10) NULL"), 'ort' => array('label' => &$GLOBALS['TL_LANG']['tl_c2a_settings']['ort'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NULL"), 'land' => array('label' => &$GLOBALS['TL_LANG']['tl_c2a_settings']['land'], 'inputType' => 'select', 'options' => \System::getCountries(), 'default' => "de", 'eval' => array('maxlength' => 255, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NULL")));
示例#11
0
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2005-2015 Leo Feyer
 *
 * @package   beachcup
 * @author    Jakob Pallhuber
 * @license   LGPL
 * @copyright Copyright © Jakob Pallhuber All Rights Reserved
 */
/**
 * Table tl_beachcup_player
 */
$GLOBALS['TL_DCA']['tl_beachcup_player'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'filter,sort,search,limit'), 'label' => array('fields' => array('name', 'surname', 'tax_number'), 'format' => '%s %s (%s)'), '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_beachcup_player']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['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_beachcup_player']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'select' => array('buttons_callback' => array()), 'edit' => array('buttons_callback' => array()), 'palettes' => array('__selector__' => array(''), 'default' => '{general_legend},name,surname,birth_date,birth_place,gender,tax_number;{address_legend},address,zip_code,city,country;{contact_legend},email,phone_number;{body_legend},shirt_size,player_level;{administration_legend},is_confirmed,is_fipav,has_medical_certificate,has_privacy,has_shirt;'), 'subpalettes' => array('' => ''), '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_beachcup_player']['name'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'surname' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['surname'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'birth_date' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['birth_date'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50 wizard', 'datepicker' => true, 'rgxp' => 'date'), 'sql' => "varchar(11) NOT NULL default ''"), 'birth_place' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['birth_place'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "text NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['gender'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'select', 'options' => array('male', 'female', 'other'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'address' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['address'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "text NOT NULL default ''"), 'zip_code' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['zip_code'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50', 'rgxp' => 'digit'), 'sql' => "int"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['city'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "text NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['country'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['email'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'rgxp' => 'email'), 'sql' => "varchar(255) NOT NULL default ''"), 'phone_number' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['phone_number'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'rgxp' => 'phone'), 'sql' => "varchar(255) NOT NULL default ''"), 'tax_number' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['tax_number'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'minlength' => 16, 'maxlength' => 16, 'tl_class' => 'w50', 'unique' => true), 'sql' => "varchar(16) NOT NULL default ''"), 'shirt_size' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['shirt_size'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'select', 'options' => array('XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'player_level' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['player_level'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'select', 'foreignKey' => 'tl_beachcup_player_level.code', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL"), 'is_confirmed' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['is_confirmed'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "boolean NOT NULL default false"), 'is_fipav' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['is_fipav'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "boolean NOT NULL default false"), 'has_medical_certificate' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['has_medical_certificate'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "boolean NOT NULL default false"), 'has_privacy' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['has_privacy'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "boolean NOT NULL default false"), 'has_shirt' => array('label' => &$GLOBALS['TL_LANG']['tl_beachcup_player']['has_shirt'], 'exclude' => true, 'sorting' => true, 'search' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "boolean NOT NULL default false")));
示例#12
0
 /**
  * Get the details from a store
  * @return \AnyStoresModel
  */
 public function loadDetails()
 {
     //load country names
     //@todo load only once. not every time.
     $arrCountryNames = \System::getCountries();
     //full localized country name
     //@todo rename country to countrycode in database
     $this->countrycode = $this->country;
     $this->country = $arrCountryNames[$this->countrycode];
     // opening times
     $this->opening_times = deserialize($this->opening_times);
     // store logo
     //@todo change size and properties in module
     if ($this->logo) {
         if (($objLogo = \FilesModel::findByUuid($this->logo)) !== null) {
             $arrLogo = $objLogo->row();
             $arrMeta = deserialize($arrLogo['meta']);
             $arrLogo['meta'] = $arrMeta[$GLOBALS['TL_LANGUAGE']];
             $this->logo = $arrLogo;
         } else {
             $this->logo = null;
         }
     }
     // Cut distance
     if ($this->distance) {
         $this->distance = number_format($this->distance, 2, ',', '.');
     }
     // Prevent from saving
     $this->preventSaving(false);
     $this->blnDetailsLoaded = true;
     return $this;
 }
<?php

$GLOBALS['TL_DCA']['tl_company'] = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_company_archive', 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary')), 'onload_callback' => array(array('tl_company', 'initPalette'), array('HeimrichHannot\\Haste\\Dca\\General', 'setDateAdded', true))), 'list' => array('label' => array('fields' => array('title', 'id')), 'sorting' => array('mode' => 1, 'fields' => array('title'), 'flag' => 1, 'panelLayout' => 'filter;search,limit'), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'cut' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['cut'], 'href' => 'act=paste&amp;mode=cut', 'icon' => 'cut.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'activities' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['activities'], 'href' => 'do=companies&table=tl_company_activity', 'icon' => '/system/modules/companies/assets/img/icon_activities.png'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_company', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('addContacts', 'addMemberContacts', 'addMemberContacts'), 'default' => '{general_legend},title;{editor_legend},userEditors,memberEditors;{address_legend},street,street2,postal,city,state,country,coordinates,phone,fax,email,website;{contact_legend},addContacts,addUserContacts,addMemberContacts;{publish_legend},published;'), 'subpalettes' => array('addContacts' => '', 'addMemberContacts' => 'memberContacts', 'addUserContacts' => 'userContacts'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_company_archive.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'"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['published'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50', 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default '0'"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['title'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'mandatory' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'memberEditors' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['memberEditors'], 'inputType' => 'select', 'options_callback' => array('HeimrichHannot\\Haste\\Dca\\General', 'getMembersAsOptions'), 'eval' => array('multiple' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "blob NULL"), 'userEditors' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['userEditors'], 'inputType' => 'select', 'options_callback' => array('HeimrichHannot\\Haste\\Dca\\General', 'getUsersAsOptions'), 'eval' => array('multiple' => true, 'chosen' => true, 'tl_class' => 'w50 clr'), 'sql' => "blob NULL"), 'addContacts' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['addContacts'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 clr', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'addMemberContacts' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['addMemberContacts'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 clr', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'memberContacts' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['memberContacts'], 'inputType' => 'select', 'options_callback' => array('HeimrichHannot\\Haste\\Dca\\General', 'getMembersAsOptions'), 'eval' => array('multiple' => true, 'chosen' => true, 'tl_class' => 'w50', 'mandatory' => true), 'sql' => "blob NULL"), 'addUserContacts' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['addUserContacts'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 clr', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'userContacts' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['userContacts'], 'inputType' => 'select', 'options_callback' => array('HeimrichHannot\\Haste\\Dca\\General', 'getUsersAsOptions'), 'eval' => array('multiple' => true, 'chosen' => true, 'tl_class' => 'w50 clr', 'mandatory' => true), 'sql' => "blob NULL"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street2' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['street2'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['city'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'state' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['state'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50', 'submitOnChange' => true), 'sql' => "varchar(2) NOT NULL default ''"), 'coordinates' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['coordinates'], 'exclude' => true, 'inputType' => 'text', 'save_callback' => array(array('HeimrichHannot\\Haste\\Dca\\General', 'setCoordinatesForDc')), 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'rgxp' => 'email', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_company']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''")));
// if not set, all fields are used
\HeimrichHannot\Companies\Companies::importMemberFields();
class tl_company extends \Backend
{
    public static function initPalette()
    {
        $objCompany = \HeimrichHannot\Companies\CompanyModel::findByPk(\Input::get('id'));
        $arrDca =& $GLOBALS['TL_DCA']['tl_company'];
        switch ($objCompany->country) {
            case 'de':
                $arrDca['fields']['state']['inputType'] = 'select';
                $arrDca['fields']['state']['eval']['includeBlankOption'] = true;
                $arrDca['fields']['state']['options'] = $GLOBALS['TL_LANG']['COUNTIES'][$objCompany->country];
                asort($arrDca['fields']['state']['options']);
                break;
            default:
                break;
        }
    }
    public function toggleIcon($row, $href, $label, $title, $icon, $attributes)
    {
        $objUser = \BackendUser::getInstance();
        if (strlen(Input::get('tid'))) {
            $this->toggleVisibility(Input::get('tid'), Input::get('state') == 1);
            \Controller::redirect($this->getReferer());
        }
        // Check permissions AFTER checking the tid, so hacking attempts are logged
        if (!$objUser->isAdmin && !$objUser->hasAccess('tl_company::published', 'alexf')) {
<?php

$arrDca =& $GLOBALS['TL_DCA']['tl_submission'];
$arrDca = array('config' => array('dataContainer' => 'Table', 'ptable' => 'tl_submission_archive', 'enableVersioning' => true, 'doNotCopyRecords' => true, 'onload_callback' => array(array('HeimrichHannot\\Haste\\Dca\\General', 'setDateAdded', true), array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'checkPermission'), array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'modifyPalette', true)), 'onsubmit_callback' => array(array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'moveAttachments')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('label' => array('fields' => array('id'), 'format' => '%s'), 'sorting' => array('mode' => 4, 'fields' => array('dateAdded DESC'), 'headerFields' => array('title'), 'panelLayout' => 'filter;search,limit', 'child_record_callback' => array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'listChildren'), 'filter' => array(array('tstamp>?', 0))), 'global_operations' => array('export_csv' => \HeimrichHannot\Exporter\ModuleExporter::getGlobalOperation('export_csv', $GLOBALS['TL_LANG']['MSC']['export_csv'], 'system/modules/exporter/assets/img/icon_export.png'), 'export_xls' => \HeimrichHannot\Exporter\ModuleExporter::getGlobalOperation('export_xls', $GLOBALS['TL_LANG']['MSC']['export_xls'], 'system/modules/exporter/assets/img/icon_export.png'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'toggleIcon')), 'send_confirmation' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['send_confirmation'], 'icon' => 'system/modules/submissions/assets/img/icon_send_confirmation.png', 'href' => 'key=send_confirmation', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['sendConfirmationConfirm'] . '\'))return false;Backend.getScrollOffset()"', 'button_callback' => array('HeimrichHannot\\Submissions\\Backend\\SubmissionBackend', 'sendConfirmation')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{general_legend},authorType,author;' . '{submission_legend},gender,academicTitle,firstname,lastname,dateOfBirth,street,' . 'postal,city,country,email,phone,fax,notes,captcha,attachments;{publish_legend},published;'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_submission_archive.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'"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['type'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'reference' => &$GLOBALS['TL_LANG']['tl_submission']['reference']['type'], 'eval' => array('includeBlankOption' => true, 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50 clr'), 'sql' => "varchar(32) NOT NULL default ''"), 'academicTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['academicTitle'], 'exclude' => true, 'inputType' => 'select', 'options' => array('Dr.', 'Prof.'), 'eval' => array('maxlength' => 255, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'additionalTitle' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['additionalTitle'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['firstname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('datepicker' => true, 'rgxp' => 'date', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street2' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['street2'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => \System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'autoCompletionHiddenField' => true, 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'save_callback' => array(array('HeimrichHannot\\Haste\\Dca\\General', 'lowerCase')), 'eval' => array('mandatory' => true, 'maxlength' => 255, 'autoCompletionHiddenField' => true, 'rgxp' => 'email', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'subject' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['subject'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'notes' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['notes'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('tl_class' => 'long clr'), 'sql' => "text NULL"), 'agreement' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['agreement'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'privacy' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['privacy'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['published'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50', 'doNotCopy' => true), 'sql' => "char(1) NOT NULL default ''"), 'captcha' => array('label' => $GLOBALS['TL_LANG']['MSC']['securityQuestion'], 'inputType' => 'captcha', 'eval' => array('mandatory' => true, 'required' => true, 'tableless' => true)), 'formHybridBlob' => array('label' => &$GLOBALS['TL_LANG']['tl_submission']['formHybridBlob'], 'sql' => "blob NULL")));
// add attachment field
if (in_array('multifileupload', \ModuleLoader::getActive())) {
    $arrDca['fields']['attachments'] = array('label' => &$GLOBALS['TL_LANG']['tl_submission']['attachments'], 'exclude' => true, 'inputType' => 'multifileupload', 'eval' => array('explanation' => &$GLOBALS['TL_LANG']['tl_submission']['attachmentsExplanation'], 'tl_class' => 'clr', 'filesOnly' => true, 'maxFiles' => 5, 'fieldType' => 'checkbox', 'extensions' => \Config::get('uploadTypes'), 'maxUploadSize' => 10, 'uploadFolder' => \HeimrichHannot\Submissions\Submissions::getDefaultAttachmentSRC(), 'addRemoveLinks' => true, 'multiple' => true), 'sql' => "blob NULL");
}
\HeimrichHannot\Haste\Dca\General::addAuthorFieldAndCallback('tl_submission');
<?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_address
 */
$GLOBALS['TL_DCA']['tl_iso_address'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => false, 'ptable' => '', 'dynamicPtable' => true, 'onload_callback' => array(), 'sql' => array('keys' => array('id' => 'primary', 'pid,store_id' => 'index'))), 'list' => array('sorting' => array('mode' => 4, 'headerFields' => array('firstname', 'lastname', 'username'), 'disableGrouping' => true, 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit', 'child_record_callback' => array('Isotope\\Backend\\Address\\Callback', 'renderLabel')), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['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_address']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{store_legend},label,store_id;{personal_legend},gender,salutation,firstname,lastname,dateOfBirth,company,vat_no;{address_legend},street_1,street_2,street_3,street_number_1,street_number_2,street_number_3,postal,city,subdivision,country;{contact_legend},email,phone;{default_legend:hide},isDefaultBilling,isDefaultShipping'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'ptable' => array('sql' => "varchar(64) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['label'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'store_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['store_id'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 2, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(2) unsigned NOT NULL default '0'"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('includeBlankOption' => true, 'feEditable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'salutation' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['salutation'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['firstname'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(11) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => false, 'maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'vat_no' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['vat_no'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street_1' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['street_1'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street_2' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['street_2'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street_3' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['street_3'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 32, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'clr w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'subdivision' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['subdivision'], 'exclude' => true, 'sorting' => true, 'inputType' => 'conditionalselect', 'options_callback' => array('Isotope\\Backend', 'getSubdivisions'), 'eval' => array('feEditable' => true, 'feGroup' => 'address', 'conditionField' => 'country', 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => \System::getCountries(), 'eval' => array('mandatory' => true, 'feEditable' => true, 'feGroup' => 'address', 'tl_class' => 'w50', 'chosen' => true), 'sql' => "varchar(32) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => false, 'maxlength' => 64, 'rgxp' => 'phone', 'feEditable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'rgxp' => 'email', 'feEditable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'isDefaultBilling' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['isDefaultBilling'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('feEditable' => true, 'feGroup' => 'login', 'membersOnly' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", 'save_callback' => array(array('Isotope\\Backend\\Address\\Callback', 'updateDefault'))), 'isDefaultShipping' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_address']['isDefaultShipping'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('feEditable' => true, 'feGroup' => 'login', 'membersOnly' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''", 'save_callback' => array(array('Isotope\\Backend\\Address\\Callback', 'updateDefault')))));
/**
 * Dynamically add parent table
 */
if (\Input::get('do') == 'member') {
    $GLOBALS['TL_DCA']['tl_iso_address']['config']['ptable'] = 'tl_member';
} elseif (\Input::get('do') == 'iso_orders') {
    $GLOBALS['TL_DCA']['tl_iso_address']['config']['ptable'] = 'tl_iso_product_collection';
}
示例#16
0
文件: Config.php 项目: rpquadrat/core
 /**
  * Get enabled shipping countries
  *
  * @return array
  */
 public function getShippingCountries()
 {
     if (!isset($this->arrCache['shippingCountries'])) {
         $arrCountries = deserialize($this->shipping_countries);
         if (empty($arrCountries) || !is_array($arrCountries)) {
             $arrCountries = array_keys(\System::getCountries());
         }
         $this->arrCache['shippingCountries'] = $arrCountries;
     }
     return $this->arrCache['shippingCountries'];
 }
示例#17
0
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2005-2016 Leo Feyer
 *
 * @license LGPL-3.0+
 */
/**
 * Table tl_member
 */
$GLOBALS['TL_DCA']['tl_member'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onsubmit_callback' => array(array('tl_member', 'storeDateAdded'), array('tl_member', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_member', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index', 'autologin' => 'unique', 'activation' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'firstname', 'lastname', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_member', 'addIcon')), '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_member']['edit'], 'href' => 'act=edit', 'icon' => 'edit.svg'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['copy'], 'href' => 'act=copy', 'icon' => 'copy.svg'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['delete'], 'href' => 'act=delete', 'icon' => 'delete.svg', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['toggle'], 'icon' => 'visible.svg', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_member', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['show'], 'href' => 'act=show', 'icon' => 'show.svg'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['su'], 'href' => 'key=su', 'icon' => 'su.svg', 'button_callback' => array('tl_member', 'switchUser')))), 'palettes' => array('__selector__' => array('login', 'assignDir'), 'default' => '{personal_legend},firstname,lastname,dateOfBirth,gender;{address_legend:hide},company,street,postal,city,state,country;{contact_legend},phone,mobile,fax,email,website,language;{groups_legend},groups;{login_legend},login;{homedir_legend:hide},assignDir;{account_legend},disable,start,stop'), 'subpalettes' => array('login' => 'username,password', 'assignDir' => 'homeDir'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['firstname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(11) NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('includeBlankOption' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'state' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['state'], 'exclude' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'options_callback' => function () {
    return System::getCountries();
}, 'sql' => "varchar(2) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'mobile' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['mobile'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'unique' => true, 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['language'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'rgxp' => 'locale', 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'options_callback' => function () {
    return System::getLanguages();
}, 'sql' => "varchar(5) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true, 'feEditable' => true, 'feGroup' => 'login'), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'login' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['login'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'unique' => true, 'rgxp' => 'extnd', 'nospace' => true, 'maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'login'), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength'), 'feEditable' => true, 'feGroup' => 'login'), 'save_callback' => array(array('tl_member', 'setNewPassword')), 'sql' => "varchar(128) NOT NULL default ''"), 'assignDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['assignDir'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'homeDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['homeDir'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['disable'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'default' => time(), 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['currentLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('default' => 3, 'eval' => array('doNotCopy' => true), 'sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'session' => array('eval' => array('doNotShow' => true, 'doNotCopy' => true), 'sql' => "blob NULL"), 'autologin' => array('default' => null, 'eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NULL"), 'createdOn' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'activation' => array('eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NOT NULL default ''")));
/**
 * Filter disabled groups in the front end (see #6757)
 */
if (TL_MODE == 'FE') {
    $GLOBALS['TL_DCA']['tl_member']['fields']['groups']['options_callback'] = array('tl_member', 'getActiveGroups');
}
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class tl_member extends Backend
{
    /**
示例#18
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 ''")));