X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F60_move_rename_delete.sh;h=47886c59d8f1f44130f3c31b27c59194caf79d05;hb=696420310ff6a3ac680935ef50985f0d37c61ad9;hp=bbe994e4f7a44911d18e10f7cc4eca923d0518dc;hpb=c895cb5c92f3b1ab8c61821d79ba2c1438eec304;p=shellwiki diff --git a/handlers/60_move_rename_delete.sh b/handlers/60_move_rename_delete.sh index bbe994e..47886c5 100755 --- a/handlers/60_move_rename_delete.sh +++ b/handlers/60_move_rename_delete.sh @@ -1,5 +1,14 @@ #!/bin/sh +l10n_immutablepage 2>&1 >/dev/null \ +|| l10n_immutablepage(){ #TRANSLATION + cat <<-EOF +

Immutable Page

+ This is a core page of the wiki system. Its name and position cannot be changed. + You may however update this page and you can use ACLs to hide it from various listings. + EOF +} + case "${PATH_INFO}" in */\[move\]|*/\[rename\]|*/\[delete\]) page="${PATH_INFO%\[*\]}" @@ -14,9 +23,7 @@ case "${PATH_INFO}" in theme_page - <<-EOF

-

Immutable Page

- This is a core page of the wiki system. Its name and position cannot be changed. - You may however update this page and you can use ACLs to hide it from various listings. + $(l10n_immutablepage)

EOF @@ -26,16 +33,9 @@ case "${PATH_INFO}" in *) return 1;; esac -if [ "$REQUEST_METHOD" = POST ]; then - action="$(POST action)" - newname="$(POST newname |grep -m1 -xE '[^#/]*')" - newlocation="$(POST newlocation |grep -m1 -xE '/[^#]*')" -else case "${PATH_INFO}" in - */\[move\]) - location="${page%/}" location="${location%/*}/" - theme_page - <<-EOF -
- +l10n_movepage 2>&1 >/dev/null \ +|| l10n_movepage(){ # TRANSLATION + cat <<-EOF

Move Page

$(HTML "${page}")

@@ -47,15 +47,11 @@ else case "${PATH_INFO}" in -
EOF - return 0 - ;; - */\[rename\]) - name="${page%/}" name="${name##*/}" - theme_page - <<-EOF -
- +} +l10n_renamepage 2>&1 >/dev/null \ +|| l10n_renamepage(){ # TRANSLATION + cat <<-EOF

Rename Page

$(HTML "${page}")

@@ -67,14 +63,11 @@ else case "${PATH_INFO}" in -
EOF - return 0 - ;; - */\[delete\]) - theme_page - <<-EOF -
- +} +l10n_deletepage 2>&1 >/dev/null \ +|| l10n_deletepage(){ # TRANSLATION + cat <<-EOF

Delete Page

$(HTML "${page}")

This page and its attachments will be deleted

@@ -85,6 +78,39 @@ else case "${PATH_INFO}" in + EOF +} + +if [ "$REQUEST_METHOD" = POST ]; then + action="$(POST action)" + newname="$(POST newname |grep -m1 -xE '[^#/]*')" + newlocation="$(POST newlocation |grep -m1 -xE '/[^#]*')" +else case "${PATH_INFO}" in + */\[move\]) + location="${page%/}" location="${location%/*}/" + theme_page - <<-EOF + + + $(l10n_movepage) +
+ EOF + return 0 + ;; + */\[rename\]) + name="${page%/}" name="${name##*/}" + theme_page - <<-EOF +
+ + $(l10n_renamepage) +
+ EOF + return 0 + ;; + */\[delete\]) + theme_page - <<-EOF +
+ + $(l10n_deletepage)
EOF return 0