cardfile="$_DATA/vcard/$card"
attfile="$_DATA/mappings/attendance"
-_POST[0N]="${(echo "$_POST[0N]}" |sed 's:;: :')"
-_POST[1N]="${(echo "$_POST[1N]}" |sed 's:;: :')"
-_POST[2N]="${(echo "$_POST[2N]}" |sed 's:;: :')"
-_POST[3N]="${(echo "$_POST[3N]}" |sed 's:;: :')"
-_POST[4N]="${(echo "$_POST[4N]}" |sed 's:;: :')"
+_POST[0N]="$(echo "${_POST[0N]}" |sed 's:;: :')"
+_POST[1N]="$(echo "${_POST[1N]}" |sed 's:;: :')"
+_POST[2N]="$(echo "${_POST[2N]}" |sed 's:;: :')"
+_POST[3N]="$(echo "${_POST[3N]}" |sed 's:;: :')"
+_POST[4N]="$(echo "${_POST[4N]}" |sed 's:;: :')"
echo "BEGIN:VCARD\r" >"$tempfile"
echo "VERSION:4.0\r" >>"$tempfile"
VCF_FIELDS=(PHOTO LOGO FN NICKNAME SOUND GENDER KIND TITLE ROLE ORG MEMBER CATEGORIES ANNIVERSARY BDAY EMAIL TEL IMPP ADR URL LANG NOTE RELATED X-ZACK-JOINDATE X-ZACK-LEAVEDATE)
+[ -z "$NAVIGATION" ] && NAVIGATION=(attendees courses)
+PAGE="${_GET[p]:-$PAGE}"
+
uuidgenerator(){
head -c16 /dev/urandom |sha1sum - |cut -c1-32
}
-#!/bin/sh
+#!/bin/zsh
# Copyright 2014, 2015 Paul Hänsch
#
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-[ -z "${_GET[order]}" ] && _GET[order]=firstname
+[ -z "${_GET[order]}" ] && _GET[order]="firstname"
listcourses() {
ls -1 ${_DATA}/ical/*ics |while read file; do
done
. ${_EXEC}/templates/edit_attendee.sh
}
-
-case "$1" in
- title)
- echo "Teilnehmende"
- ;;
- css)
- . ${_EXEC}/templates/attendees.css.sh
- ;;
- body)
- . ${_EXEC}/templates/text_attendee.sh
- . ${_EXEC}/templates/attendees.html.sh
- ;;
-esac
-
-#!/bin/sh
+#!/bin/zsh
# Copyright 2014 Paul Hänsch
#
done
. ${_EXEC}/templates/edit_course.sh
}
-
-case "$1" in
- title)
- echo "Kurse"
- ;;
- css)
- . ${_EXEC}/templates/courses.css.sh
- ;;
- body)
- . ${_EXEC}/templates/text_courses.sh
- . ${_EXEC}/templates/courses.html.sh
- ;;
-esac
-
-#!/bin/sh
+#!/bin/zsh
# Copyright 2014 Paul Hänsch
#
echo "$(date -d "$icstime" "+%u %H%M%S")\t$file"
done |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:'
}
-
-case "$1" in
- title)
- echo "Email"
- ;;
- css)
- . ${_EXEC}/templates/email.css.sh
- ;;
- body)
- . ${_EXEC}/templates/text_email.sh
- . ${_EXEC}/templates/email.html.sh
- ;;
-esac
-
</div>
<div class="maillist">
-$(
-)
</div>
EOF
-# Copyright 2014 Paul Hänsch
+#!/bin/zsh
+
+# Copyright 2014, 2015 Paul Hänsch
#
# This file is part of Confetti.
#
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
+. "${_EXEC}/templates/text_frame.sh"
+[ -x "${_EXEC}/templates/text_${PAGE}.sh" ] && . "${_EXEC}/templates/text_${PAGE}.sh"
+
cat <<EOF
<!Doctype HTML>
<html>
<head>
- <title>$($PAGE title)</title>
+ <title>$(l10n p_${PAGE})</title>
<style type="text/css">
<!--
* {
}
/* dynamic page CSS starts here */
-$(. $PAGE css)
+$(debug CSS; [ -x "${CSS}" ] && . "${CSS}")
-->
</style>
</head>
<body class="$PAGE">
<div class="NAVIGATION">
- $(NAVIGATION |sed -r 's:^([^ ]+) (.+)$:<a href="\1">\2</a>:g')
+ $(debug NAVIGATION = "$NAVIGATION"; for each in ${NAVIGATION}; do printf %s "<a href=\"?p=${each}\">$(l10n "p_${each}")</a>"; done)
</div>
- $(. $PAGE body)
+ $(debug BODY; [ -x "${BODY}" ] && . "${BODY}" || printf %s 'Error')
</body>
</html>
EOF
-#!/bin/sh
-
-# Copyright 2014 Paul Hänsch
+# Copyright 2014, 2015 Paul Hänsch
#
# This file is part of Confetti.
#
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-case "$1" in
- title)
- ;;
- css)
- ;;
- body)
-cat <<EOF
-Page not found or nevermore<br />
-Quoth the server: 404
-EOF
- ;;
-esac
-
+declare -A item_name
+
+item_name[p_attendees]="Teilnehmende"
+item_name[p_courses]="Kurse"
+item_name[p_email]="Email"
+item_name[p_error]="Fehler"
+
+l10n() {
+ [ -n "$item_name[$1]" ] && echo -n "$item_name[$1]" || echo -n "$1"
+}