From b8a9467f8da780bf6a83d3b6765187dbfc897086 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 30 Jan 2016 20:12:31 +0100 Subject: Add support for TCA files named by the tablename --- add_extbase_property.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/add_extbase_property.sh b/add_extbase_property.sh index b8faa0b..8701c8b 100755 --- a/add_extbase_property.sh +++ b/add_extbase_property.sh @@ -11,13 +11,18 @@ property=$2 #typ=int typ=$3 +extension=$(basename `pwd`) +extension_normalize=`echo "$extension" | sed 's/_//g'` +model_normalize=`echo "$model" | tr '[:upper:]' '[:lower:]'` +tablename="tx_${extension_normalize}_domain_model_${model_normalize}" + model_file=Classes/Domain/Model/${model}.php -tca_file=Configuration/TCA/${model}.php +tca_file=Configuration/TCA/${tablename}.php + +[[ -e "$tca_file" ]] || tca_file=Configuration/TCA/${model}.php # TODO: search backwards for ext_emconf.php and cd to that directory and use it as extension name # TODO: fail if ext_emconf.php is not found (probably the wrong directory) -extension=$(basename `pwd`) -tablename=$(sed -n "s/^\$GLOBALS\['TCA'\]\['\([^']*\)'].*/\1/p" $tca_file) field=`echo $property | sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g'` uproperty=`echo $property | sed -r 's/^./\u&/'` -- cgit