| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doBaseActions { |
| |
| local -a FILES |
| local FILE='' |
| local OUTPUT='' |
| local TEMPLATE='' |
| local PARENTDIR='' |
| local EXTENSION='' |
| local TRANSLATION='' |
| local EXTERNALFILE='' |
| local EXTERNALFILES='' |
| local THIS_FILE_DIR='' |
| local NEXT_FILE_DIR='' |
| local COUNT=0 |
| |
| |
| cli_checkFiles "$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}" --directory |
| |
| |
| |
| |
| |
| EXTENSION='(svgz|svg|xhtml|docbook)' |
| |
| |
| PARENTDIR=$(basename "${ACTIONVAL}") |
| |
| |
| render_getDirTemplate |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| for FILE in $(cli_getFilesList ${TEMPLATE} --pattern="${FLAG_FILTER}.*\.${EXTENSION}" --type="f" \ |
| | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/');do |
| FILES[((++${#FILES[*]}))]=$FILE |
| done |
| |
| |
| |
| while [[ $COUNT -lt ${#FILES[*]} ]];do |
| |
| |
| FILE=${FILES[$COUNT]} |
| |
| |
| |
| THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) |
| |
| |
| |
| if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then |
| NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) |
| else |
| NEXT_FILE_DIR='' |
| fi |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| TRANSLATION=$(dirname $FILE \ |
| | sed -r 's!trunk/(Manuals|Identity)!trunk/Locales/\1!')/$(cli_getCurrentLocale)/messages.po |
| |
| |
| if [[ ! -f "$TRANSLATION" ]];then |
| cli_printMessage "`gettext "None"`" --as-translation-line |
| else |
| cli_printMessage "$TRANSLATION" --as-translation-line |
| fi |
| |
| |
| TEMPLATE=${FILE} |
| |
| |
| if [[ ! -f "$TEMPLATE" ]];then |
| cli_printMessage "`gettext "None"`" --as-design-line |
| else |
| cli_printMessage "$TEMPLATE" --as-design-line |
| fi |
| |
| |
| render_getDirOutput |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| FILE=$(echo ${FILE} \ |
| | sed -r "s!.*${PARENTDIR}/!!" \ |
| | sed -r "s/\.${EXTENSION}$//") |
| |
| |
| FILE=${OUTPUT}/$(basename "${FILE}") |
| |
| |
| INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) |
| |
| |
| |
| render_doTranslation |
| |
| |
| cli_replaceTMarkers ${INSTANCE} |
| |
| |
| |
| if [[ $INSTANCE =~ '\.(svgz|svg)$' ]];then |
| |
| |
| render_svg |
| |
| |
| render_svg_doPostActions |
| |
| |
| render_svg_doLastActions |
| |
| elif [[ $INSTANCE =~ '\.docbook$' ]];then |
| |
| |
| render_docbook |
| |
| |
| |
| |
| |
| |
| |
| elif [[ $INSTANCE =~ '\.xhtml$' ]];then |
| |
| |
| render_xhtml |
| |
| |
| |
| |
| |
| |
| |
| else |
| cli_printMessage "`gettext "The template file you try to render is not supported yet."`" --as-error-line |
| fi |
| |
| |
| if [[ -f $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |