]> git.plutz.net Git - shellwiki/blobdiff - themes/default.sh
Page titles for special function pages
[shellwiki] / themes / default.sh
index 5979f207895e2f9586abd29947902f160a93d0b9..5b2f1edd55a261ec566e37820c122af0d8a08313 100755 (executable)
@@ -83,12 +83,11 @@ theme_page(){
 }
 
 theme_editor(){
-  local page="$1" template="$2" title file att
-  title="$(HTML "${PAGE_TITLE:-"${page}"}")"
+  local page="$1" template="$2" file att
 
   [ "$template" ] && acl_read "$template" || template="$page"
 
-  theme_page - "Editor: $title" <<-EOF
+  theme_page - "$(_ Editor): ${PAGE_TITLE:-"${page}"}" <<-EOF
        <input checked type=radio class=tab name=edithelp value=edtr id=editor><label for=editor>$(_ Editor)</label>
        <input         type=radio class=tab name=edithelp value=help id=syntax><label for=syntax>$(_ Syntax)</label>
        <input         type=radio class=tab name=edithelp value=att  id=attach><label for=attach>$(_ Attachments)</label>
@@ -139,7 +138,7 @@ theme_search(){
   local words="$*"
   # STDIN: read result pages line by line
 
-  theme_page - <<-EOF
+  theme_page - "$(_ Search results): ${words}" <<-EOF
        <article>
          <h1>$([ "$words" ] && _ "Search results" || _ "Search" )</h1>
          <form class="search" method="GET">
@@ -155,11 +154,10 @@ theme_search(){
 }
 
 theme_attachments(){
-  local page="$1" title
-  title="${page%/}"; title="${title##*/}"
+  local page="$1"
 
   if acl_write "$page"; then
-    theme_page - "$(_ Attachments): $title" <<-EOF
+    theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF
        <form class=upload method=POST enctype="multipart/form-data">
          <h2>$(_ Upload)</h2>
          <input type=hidden name=session_id value="$SESSION_ID">
@@ -204,7 +202,7 @@ theme_attachments(){
        </form>
        EOF
   else
-    theme_page - "$(_ Attachments): $title" <<-EOF
+    theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF
        <ul class="attachment list">
        $(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
          [ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \