vendor/numero2/contao-opengraph3/src/Resources/contao/dca/opengraph_fields.php line 139

Open in your IDE?
  1. <?php
  2. /**
  3.  * Contao Open Source CMS
  4.  *
  5.  * Copyright (c) 2005-2021 Leo Feyer
  6.  *
  7.  * @package   Opengraph3
  8.  * @author    Benny Born <benny.born@numero2.de>
  9.  * @author    Michael Bösherz <michael.boesherz@numero2.de>
  10.  * @license   LGPL
  11.  * @copyright 2021 numero2 - Agentur für digitales Marketing GbR
  12.  */
  13. $GLOBALS['TL_DCA']['opengraph_fields'] = [
  14.     'palettes' => [
  15.         'default' => '{opengraph_legend:hide},og_title,og_type,og_image,og_properties;{twitter_legend:hide},twitter_site,twitter_creator,twitter_card,twitter_title,twitter_description,twitter_image;'
  16.     ]
  17. ,   'og_subpalettes' => [
  18.         '__basic__' => 'og_title,og_type,og_image'
  19.     ,   '__all__' => 'og_description'
  20.     ,   'website' => 'og_locale,og_site_name'
  21.     ,   'article' => 'og_article_author,og_article_section'
  22.     ,   'book' => 'og_book_author,og_book_isbn,og_book_release_date,og_book_tag'
  23.     ,   'business.business' => 'og_business_contact_data_street_address,og_business_contact_data_locality,og_business_contact_data_postal_code,og_business_contact_data_country_name,og_place_location_latitude,og_place_location_longitude'
  24.     ,   'music.album' => 'og_music_musician,og_music_release_date,og_music_release_type'
  25.     ,   'music.song' => 'og_music_album_url,og_music_album_disc,og_music_album_track,og_music_duration,og_music_musician,og_music_preview_url_url,og_music_release_date,og_music_release_type'
  26.     ,   'place' => 'og_place_location_latitude,og_place_location_longitude,og_place_location_altitude'
  27.     ,   'product' => 'og_product_age_group,og_product_availability,og_product_brand,og_product_category,og_product_color,og_product_condition,og_product_ean,og_product_isbn,og_product_material,og_product_mfr_part_no,og_product_pattern,og_product_plural_title,og_product_price_amount,og_product_price_currency,og_product_shipping_weight_value,og_product_shipping_weight_unit,og_product_size,og_product_target_gender,og_product_upc,og_product_weight_value,og_product_weight_unit'
  28.     ,   'profile' => 'og_profile_first_name,og_profile_last_name,og_profile_username,og_profile_gender'
  29.     ]
  30. ,   'fields' => [
  31.     // __basic__ fields
  32.         'og_title' => [
  33.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_title']
  34.         ,   'inputType'         => 'text'
  35.         ,   'eval'              => ['maxlength'=>255'tl_class'=>'w50']
  36.         ,   'attributes'        => ['legend'=>'opengraph_legend']
  37.         ,   'sql'               => "varchar(255) NOT NULL default ''"
  38.         ]
  39.     ,   'og_type' => [
  40.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_type']
  41.         ,   'inputType'         => 'select'
  42.         ,   'options_callback'  => ['\numero2\OpenGraph3\DCAHelper\OpengraphFields','getTypes']
  43.         ,   'eval'              => ['chosen'=>true'includeBlankOption'=>true'submitOnChange'=>true'tl_class'=>'w50']
  44.         ,   'attributes'        => ['legend'=>'opengraph_legend']
  45.         ,   'sql'               => "varchar(32) NOT NULL default ''"
  46.         ]
  47.     ,   'og_image' => [
  48.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_image']
  49.         ,   'inputType'         => 'fileTree'
  50.         ,   'eval'              => ['extensions'=>'png,gif,jpg,jpeg''files'=>true'fieldType'=>'radio''tl_class'=>'clr']
  51.         ,   'attributes'        => ['legend'=>'opengraph_legend']
  52.         ,   'sql'               => "binary(16) NULL"
  53.         ]
  54.     // all optional properties
  55.     ,   'og_properties' => [
  56.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_properties']
  57.         ,   'inputType'         => 'openGraphProperties'
  58.         ,   'eval'              => ['tl_class'=>'clr']
  59.         ,   'attributes'        => ['legend'=>'opengraph_legend']
  60.         ,   'sql'               => "blob NULL"
  61.         ]
  62.     // __all__ fields
  63.     ,   'og_description' => [
  64.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_description']
  65.         ,   'inputType'         => 'textarea'
  66.         ,   'eval'              => ['style'=>'height: 60px;''decodeEntities'=>true]
  67.         ]
  68.         // website field
  69.     ,   'og_locale' => [
  70.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_locale']
  71.         ,   'inputType'         => 'text'
  72.         ,   'eval'              => ['maxlength'=>5'placeholder'=>'en_US']
  73.         ]
  74.     ,   'og_site_name' => [
  75.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_site_name']
  76.         ,   'inputType'         => 'text'
  77.         ]
  78.         // article fields
  79.     ,   'og_article_author' => [
  80.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_article_author']
  81.         ,   'inputType'         => 'text'
  82.         ,   'eval'              => ['og_multiple'=>true]
  83.         ]
  84.     ,   'og_article_section' => [
  85.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_article_section']
  86.         ,   'inputType'         => 'text'
  87.         ]
  88.     ,   'og_article_published_time' => [
  89.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_article_published_time']
  90.         ,   'inputType'         => 'text'
  91.         ,   'eval'              => ['rgxp'=>'datim''datepicker'=>true]
  92.         ]
  93.     ,   'og_article_modified_time' => [
  94.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_article_modified_time']
  95.         ,   'inputType'         => 'text'
  96.         ,   'eval'              => ['rgxp'=>'datim''datepicker'=>true]
  97.         ]
  98.         // book fields
  99.     ,   'og_book_author' => [
  100.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_book_author']
  101.         ,   'inputType'         => 'text'
  102.         ,   'eval'              => ['og_multiple'=>true]
  103.         ]
  104.     ,   'og_book_isbn' => [
  105.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_book_isbn']
  106.         ,   'inputType'         => 'text'
  107.         ]
  108.     ,   'og_book_release_date' => [
  109.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_book_release_date']
  110.         ,   'inputType'         => 'text'
  111.         ,   'eval'              => ['rgxp'=>'datim''datepicker'=>true]
  112.         ]
  113.     ,   'og_book_tag' => [
  114.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_book_tag']
  115.         ,   'inputType'         => 'text'
  116.         ,   'eval'              => ['og_multiple'=>true]
  117.         ]
  118.         // business.business fields
  119.     ,   'og_business_contact_data_street_address' => [
  120.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_business_contact_data_street_address']
  121.         ,   'inputType'         => 'text'
  122.         ]
  123.     ,   'og_business_contact_data_locality' => [
  124.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_business_contact_data_locality']
  125.         ,   'inputType'         => 'text'
  126.         ]
  127.     ,   'og_business_contact_data_postal_code' => [
  128.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_business_contact_data_postal_code']
  129.         ,   'inputType'         => 'text'
  130.         ]
  131.     ,   'og_business_contact_data_country_name' => [
  132.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_business_contact_data_country_name']
  133.         ,   'inputType'         => 'select'
  134.         ,   'options'           => System::getCountries()
  135.         ]
  136.         // music.album fields
  137.     ,   'og_music_musician' => [
  138.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_musician']
  139.         ,   'inputType'         => 'text'
  140.         ,   'eval'              => ['og_multiple'=>true]
  141.         ]
  142.     ,   'og_music_release_date' => [
  143.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_release_date']
  144.         ,   'inputType'         => 'text'
  145.         ,   'eval'              => ['rgxp'=>'datim''datepicker'=>true]
  146.         ]
  147.     ,   'og_music_release_type' => [
  148.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_release_type']
  149.         ,   'inputType'         => 'select'
  150.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_music_release_types')
  151.         ,   'eval'              => ['includeBlankOption'=>true]
  152.         ]
  153.         // music.song fields
  154.     ,   'og_music_album_url' => [
  155.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_album_url']
  156.         ,   'inputType'         => 'text'
  157.         ,   'eval'              => ['og_multiple'=>true'rgxp'=>'url']
  158.         ]
  159.     ,   'og_music_album_disc' => [
  160.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_album_disc']
  161.         ,   'inputType'         => 'text'
  162.         ,   'eval'              => ['rgxp'=>'natural']
  163.         ]
  164.     ,   'og_music_album_track' => [
  165.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_album_track']
  166.         ,   'inputType'         => 'text'
  167.         ,   'eval'              => ['rgxp'=>'natural']
  168.         ]
  169.     ,   'og_music_duration' => [
  170.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_duration']
  171.         ,   'inputType'         => 'text'
  172.         ,   'eval'              => ['rgxp'=>'natural']
  173.         ]
  174.     ,   'og_music_preview_url_url' => [
  175.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_music_preview_url_url']
  176.         ,   'inputType'         => 'text'
  177.         ,   'eval'              => ['rgxp'=>'url']
  178.         ]
  179.         // place fields
  180.     ,   'og_place_location_latitude' => [
  181.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_place_location_latitude']
  182.         ,   'inputType'         => 'text'
  183.         ,   'eval'              => ['rgxp'=>'digit']
  184.         ]
  185.     ,   'og_place_location_longitude' => [
  186.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_place_location_longitude']
  187.         ,   'inputType'         => 'text'
  188.         ,   'eval'              => ['rgxp'=>'digit']
  189.         ]
  190.     ,   'og_place_location_altitude' => [
  191.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_place_location_altitude']
  192.         ,   'inputType'         => 'text'
  193.         ,   'eval'              => ['rgxp'=>'digit']
  194.         ]
  195.         // product fields
  196.     ,   'og_product_age_group' => [
  197.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_age_group']
  198.         ,   'inputType'         => 'select'
  199.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_age_groups')
  200.         ,   'eval'              => ['includeBlankOption'=>true]
  201.         ]
  202.     ,   'og_product_availability' => [
  203.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_availability']
  204.         ,   'inputType'         => 'select'
  205.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_availabilities')
  206.         ,   'eval'              => ['includeBlankOption'=>true]
  207.         ]
  208.     ,   'og_product_brand' => [
  209.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_brand']
  210.         ,   'inputType'         => 'text'
  211.         ]
  212.     ,   'og_product_category' => [
  213.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_category']
  214.         ,   'inputType'         => 'text'
  215.         ]
  216.     ,   'og_product_color' => [
  217.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_color']
  218.         ,   'inputType'         => 'text'
  219.         ]
  220.     ,   'og_product_condition' => [
  221.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_condition']
  222.         ,   'inputType'         => 'select'
  223.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_conditions')
  224.         ,   'eval'              => ['includeBlankOption'=>true]
  225.         ]
  226.     ,   'og_product_ean' => [
  227.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_ean']
  228.         ,   'inputType'         => 'text'
  229.         ]
  230.     ,   'og_product_isbn' => [
  231.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_isbn']
  232.         ,   'inputType'         => 'text'
  233.         ]
  234.     ,   'og_product_material' => [
  235.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_material']
  236.         ,   'inputType'         => 'text'
  237.         ]
  238.     ,   'og_product_mfr_part_no' => [
  239.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_mfr_part_no']
  240.         ,   'inputType'         => 'text'
  241.         ]
  242.     ,   'og_product_pattern' => [
  243.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_pattern']
  244.         ,   'inputType'         => 'text'
  245.         ]
  246.     ,   'og_product_plural_title' => [
  247.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_plural_title']
  248.         ,   'inputType'         => 'text'
  249.         ]
  250.     ,   'og_product_price_amount' => [
  251.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_price_amount']
  252.         ,   'inputType'         => 'text'
  253.         ,   'eval'              => ['og_multiple'=>true'rgxp'=>'digit']
  254.         ]
  255.     ,   'og_product_price_currency' => [
  256.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_price_currency']
  257.         ,   'inputType'         => 'text'
  258.         ,   'eval'              => ['og_multiple'=>true]
  259.         ]
  260.     ,   'og_product_shipping_weight_value' => [
  261.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_shipping_weight_value']
  262.         ,   'inputType'         => 'text'
  263.         ,   'eval'              => ['rgxp'=>'digit']
  264.         ]
  265.     ,   'og_product_shipping_weight_unit' => [
  266.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_shipping_weight_unit']
  267.         ,   'inputType'         => 'select'
  268.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_weight_units')
  269.         ,   'eval'              => ['includeBlankOption'=>true]
  270.         ]
  271.     ,   'og_product_size' => [
  272.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_size']
  273.         ,   'inputType'         => 'text'
  274.         ]
  275.     ,   'og_product_target_gender' => [
  276.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_target_gender']
  277.         ,   'inputType'         => 'select'
  278.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_target_genders')
  279.         ,   'eval'              => ['includeBlankOption'=>true]
  280.         ]
  281.     ,   'og_product_upc' => [
  282.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_upc']
  283.         ,   'inputType'         => 'text'
  284.         ]
  285.     ,   'og_product_weight_value' => [
  286.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_weight_value']
  287.         ,   'inputType'         => 'text'
  288.         ,   'eval'              => ['rgxp'=>'digit']
  289.         ]
  290.     ,   'og_product_weight_unit' => [
  291.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_weight_unit']
  292.         ,   'inputType'         => 'select'
  293.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_product_weight_units')
  294.         ,   'eval'              => ['includeBlankOption'=>true]
  295.         ]
  296.     ,   'og_product_product_link' => [
  297.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_product_product_link']
  298.         ,   'inputType'         => 'text'
  299.         ,   'eval'              => ['rgxp'=>'url']
  300.         ]
  301.         // profile fields
  302.     ,   'og_profile_first_name' => [
  303.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_profile_first_name']
  304.         ,   'inputType'         => 'text'
  305.         ]
  306.     ,   'og_profile_last_name' => [
  307.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_profile_last_name']
  308.         ,   'inputType'         => 'text'
  309.         ]
  310.     ,   'og_profile_username' => [
  311.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_profile_username']
  312.         ,   'inputType'         => 'text'
  313.         ]
  314.     ,   'og_profile_gender' => [
  315.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['og_profile_gender']
  316.         ,   'inputType'         => 'select'
  317.         ,   'options'           => \numero2\OpenGraph3\DCAHelper\OpengraphFields::getEnumsFromLanguage('og_profile_genders')
  318.         ,   'eval'              => ['includeBlankOption'=>true]
  319.         ]
  320.         // twitter
  321.     ,   'twitter_site' => [
  322.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_site']
  323.         ,   'inputType'         => 'text'
  324.         ,   'eval'              => ['maxlength'=>255'tl_class'=>'w50''placeholder'=>'@page']
  325.         ,   'attributes'        => ['legend'=>'twitter_legend']
  326.         ,   'sql'               => "varchar(255) NOT NULL default ''"
  327.         ]
  328.     ,   'twitter_creator' => [
  329.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_creator']
  330.         ,   'inputType'         => 'text'
  331.         ,   'eval'              => ['maxlength'=>255'tl_class'=>'w50''placeholder'=>'@author']
  332.         ,   'attributes'        => ['legend'=>'twitter_legend']
  333.         ,   'sql'               => "varchar(255) NOT NULL default ''"
  334.         ]
  335.     ,   'twitter_card' => [
  336.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_card']
  337.         ,   'inputType'         => 'select'
  338.         ,   'options'           => ['summary_large_image''summary']
  339.         ,   'eval'              => ['includeBlankOption'=>false'tl_class'=>'w50']
  340.         ,   'attributes'        => ['legend'=>'twitter_legend']
  341.         ,   'sql'               => "varchar(255) NOT NULL default ''"
  342.         ]
  343.     ,   'twitter_title' => [
  344.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_title']
  345.         ,   'inputType'         => 'text'
  346.         ,   'eval'              => ['maxlength'=>255'tl_class'=>'clr long']
  347.         ,   'attributes'        => ['legend'=>'twitter_legend']
  348.         ,   'sql'               => "varchar(255) NOT NULL default ''"
  349.         ]
  350.     ,   'twitter_description' => [
  351.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_description']
  352.         ,   'inputType'         => 'textarea'
  353.         ,   'search'            => true
  354.         ,   'eval'              => ['style'=>'height: 60px;''decodeEntities'=>true'tl_class'=>'clr']
  355.         ,   'attributes'        => ['legend'=>'twitter_legend']
  356.         ,   'sql'               => "text NULL"
  357.         ]
  358.     ,   'twitter_image' => [
  359.             'label'             => &$GLOBALS['TL_LANG']['opengraph_fields']['twitter_image']
  360.         ,   'inputType'         => 'fileTree'
  361.         ,   'eval'              => ['extensions'=>'png,gif,jpg,jpeg''files'=>true'fieldType'=>'radio''tl_class'=>'clr']
  362.         ,   'attributes'        => ['legend'=>'twitter_legend']
  363.         ,   'sql'               => "binary(16) NULL"
  364.         ]
  365.     ]
  366. ];