This repository was archived by the owner on Jan 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_tables.php
More file actions
61 lines (55 loc) · 2.13 KB
/
ext_tables.php
File metadata and controls
61 lines (55 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
// No TypoScript to add!
t3lib_extMgm::addStaticFile('rtp_imgquery', 'Configuration/TypoScript/', 'Responsive Images');
// Language labels
$langFile = 'LLL:EXT:rtp_imgquery/Resources/Private/Language/locallang_db.xml:';
$breakpointLangLabel = $langFile . 'tt_content.tx_rtpimgquery_breakpoint';
$breakpointLangLabels = $langFile . 'tt_content.tx_rtpimgquery_breakpoints';
$pixelRatioLangLabels = $langFile . 'tt_content.tx_rtpimgquery_pixel_ratios';
$paletteLangLabels = $langFile . 'palette.breakpoints';
// TCA Columns
$tempColumns = array (
'tx_rtpimgquery_breakpoint' => array (
'exclude' => 1,
'label' => $breakpointLangLabel,
'config' => array (
'type' => 'input',
'size' => '12',
'eval' => 'int',
)
),
'tx_rtpimgquery_breakpoints' => array (
'exclude' => 1,
'label' => $breakpointLangLabels,
'config' => array (
'type' => 'text',
'cols' => '30',
'rows' => '5',
)
),
'tx_rtpimgquery_pixel_ratios' => array (
'exclude' => 1,
'label' => $pixelRatioLangLabels,
'config' => array (
'type' => 'input',
'size' => '30',
'eval' => 'trim',
)
),
);
t3lib_div::loadTCA('tt_content');
t3lib_extMgm::addTCAcolumns('tt_content', $tempColumns, 1);
// Creates a new palette "breakpoints"
$paletteFields = 'tx_rtpimgquery_breakpoint;' . $breakpointLangLabel;
$paletteFields .= ', --linebreak--, tx_rtpimgquery_breakpoints;' . $breakpointLangLabels;
$paletteFields .= ', --linebreak--, tx_rtpimgquery_pixel_ratios;' . $pixelRatioLangLabels;
t3lib_extMgm::addFieldsToPalette('tt_content', 'breakpoints', $paletteFields);
// TODO: Insert the new palette after the palette image_accessibility
$insertFields = '--palette--;' . $paletteLangLabels . ';breakpoints';
$insertTypes = 'image,textpic';
// This doesn't seem to work...
$insertPosition = 'after:palette.image_accessibility;image_accessibility,';
t3lib_extMgm::addToAllTCAtypes('tt_content', $insertFields, $insertTypes, $insertPosition);