#!/bin/sh
+# Copyright 2022 - 2023 Paul Hänsch
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
REV_ATTACHMENTS="${REV_ATTACHMENTS:-false}"
if [ "${PATH_INFO##*/\[attachment\]}" ]; then
if [ "$success" -a "$fail" ]; then
printf "%s\r\n" "Status: 500 Internal Server Error"
- theme_page - "Attachment rename" <<-EOF
- <h1 class="rename partial">Some files could not be renamed</h1>
- <h2 class="rename success">Successfully renamed:</h2>
+ theme_page - "$(_ "Attachment rename")" <<-EOF
+ <h1 class="rename partial">$(_ Some files could not be renamed)</h1>
+ <h2 class="rename success">$(_ Successfully renamed:)</h2>
<ul class="rename success">
$(printf %s "$success" |while read html; do
printf '<li><span class=from>%s</span> -> <span class=to>%s</span></li>' \
"${html%%/*}" "${html##*/}"
done)
</ul>
- <h2 class="rename fail">Errors:</h2>
+ <h2 class="rename fail">$(_ Errors:)</h2>
<ul class="rename fail">
$(printf %s "$fail" |while read html; do
printf '<li><span class=from>%s</span> -> <span class=to>%s</span></li>' \
"${html%%/*}" "${html##*/}"
done)
</ul>
- <a class="button rename fail" href="[attachment]">OK</a>
+ <a class="button rename fail" href="[attachment]">$(_ OK)</a>
EOF
exit 0
elif [ "$fail" ]; then
printf "%s\r\n" "Status: 500 Internal Server Error"
- theme_page - "Attachment rename" <<-EOF
- <h1 class="rename fail">Files could not be renamed</h1>
+ theme_page - "$(_ "Attachment rename")" <<-EOF
+ <h1 class="rename fail">$(_ "Files could not be renamed")</h1>
<ul class="rename fail">
$(printf %s "$fail" |while read html; do
printf '<li><span class=from>%s</span> -> <span class=to>%s</span></li>' \
"${html%%/*}" "${html##*/}"
done)
</ul>
- <a class="button rename fail" href="[attachment]">OK</a>
+ <a class="button rename fail" href="[attachment]">$(_ OK)</a>
EOF
exit 0
elif [ "$success" ]; then
printf 'Refresh: %i\r\n' 4
theme_page - "Attachment rename" <<-EOF
- <h1 class="rename success">Files were renamed</h1>
+ <h1 class="rename success">$(_ Files were renamed)</h1>
<ul class="rename success">
$(printf %s "$success" |while read html; do
printf '<li><span class=from>%s</span> -> <span class=to>%s</span></li>' \
"${html%%/*}" "${html##*/}"
done)
</ul>
- <a class="button rename success" href="[attachment]">OK</a>
+ <a class="button rename success" href="[attachment]">$(_ OK)</a>
EOF
exit 0