summaryrefslogtreecommitdiff
path: root/add_extbase_property.sh
diff options
context:
space:
mode:
Diffstat (limited to 'add_extbase_property.sh')
-rwxr-xr-xadd_extbase_property.sh28
1 files changed, 12 insertions, 16 deletions
diff --git a/add_extbase_property.sh b/add_extbase_property.sh
index 324f555..6146b14 100755
--- a/add_extbase_property.sh
+++ b/add_extbase_property.sh
@@ -180,24 +180,20 @@ sql_type="${sql_types["$typ"]}"
# TCA
-# The first sed command is a fix for extension_builder's trailing comma in searchFields
-sed -i \
- -e "s/\('searchFields' => .*\),',/\1',/" \
- -e "s/\('searchFields.*\)',\$/\1,$field',/" \
- -e "s/\('searchFields' => '\),\(.*\)/\1\2/" \
- -e "s/\('showRecordFieldList.*\)',\$/\1, $field',/" \
- -e "s/'label' => 'uid'/'label' => '${field}'/" \
- $tca_file
-
-# Place before the access tab, if that is available
-if grep --quiet -- '--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access' $tca_file; then
- sed -i "s/\('showitem' => '..*\)--div/\1$field, --div/" $tca_file
-else
- sed -i "s/\('showitem' => '..*\)'),/\1, $field'),/" $tca_file
-fi
+sed -i -f - $tca_file << EOF
+s/\('searchFields' => .*\),',/\1',/
+s/\('searchFields.*\)',\$/\1,$field',/
+s/\('searchFields' => '\),\(.*\)/\1\2/
+s/\('showRecordFieldList.*\)',\$/\1, $field',/
+s/'label' => 'uid'/'label' => '${field}'/
+
+/'showitem' =>/ {
+ # Place before the first tab, if that is available
+ /--div--/s/\('showitem' => '..*\)--div/\1$field, --div/
+ /--div--/!s/\('showitem' => '..*\)'),/\1, $field'),/
+}
-sed -i -f - $tca_file << EOF
/[ ]*'columns' =>/ {
:loop