]> git.plutz.net Git - shellwiki/blobdiff - handlers/60_move_rename_delete.sh
Page titles for special function pages
[shellwiki] / handlers / 60_move_rename_delete.sh
index 49651a29d9510255d26ae8662ed5492beb85b39e..f399e0388bf907cd9cc198d5f0ba6a0280b5c849 100755 (executable)
@@ -52,7 +52,7 @@ l10n_movepage >/dev/null 2>&1 \
   cat <<-EOF
          <h1>Move Page</h1>
          <p class="pageid">$(HTML "${page}")</p>
-         <input name="newlocation" value="$(HTML "$location")" placeholder="New Location">
+         <input list="locations" autocomplete="off" name="newlocation" value="$(HTML "$location")" placeholder="New Location">
          <ul>
            <li>A page with the same name must not already exist at the new location.</li>
            <li>You must have permission to create new pages at this location.</li>
@@ -68,7 +68,7 @@ l10n_renamepage >/dev/null 2>&1 \
   cat <<-EOF
          <h1>Rename Page</h1>
          <p class="pageid">$(HTML "${page}")</p>
-         <input name="newname" value="$(HTML "$name")" placeholder="New Name">
+         <input autocomplete="off" name="newname" value="$(HTML "$name")" placeholder="New Name">
          <ul>
            <li>A page with the new name must not already exist.</li>
            <li>You must have permission to create new pages at this location.</li>
@@ -122,9 +122,16 @@ if [ "$REQUEST_METHOD" = POST ]; then
 else case "${PATH_INFO}" in
   */\[move\])
       location="${page%/}" location="${location%/*}/"
-      theme_page - <<-EOF
+      theme_page - "$(_ Move): ${PAGE_TITLE}"<<-EOF
        <form method=POST id=movepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
+         <datalist id="locations">
+         $(page_glob / -1 |while read loc; do
+           [ "$loc" = "$page" ] && continue
+           acl_write "$loc" || continue
+           printf '\n    <option>%s</option>' "$(HTML "$loc")"
+         done)
+         </datalist>
          $(l10n_movepage)
        </form>
        EOF
@@ -132,7 +139,7 @@ else case "${PATH_INFO}" in
     ;;
   */\[rename\])
       name="${page%/}" name="${name##*/}"
-      theme_page - <<-EOF
+      theme_page - "$(_ Rename): ${PAGE_TITLE}"<<-EOF
        <form method=POST id=renamepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
          $(l10n_renamepage)
@@ -141,7 +148,7 @@ else case "${PATH_INFO}" in
       return 0
     ;;
   */\[delete\])
-      theme_page - <<-EOF
+      theme_page - "$(_ Delete): ${PAGE_TITLE}"<<-EOF
        <form method=POST id=deletepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
          $(l10n_deletepage)