X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=themes%2Fdefault.sh;h=6807242cd2d6dd0445e419bd72ae62dfe5834f23;hb=b9be49d6871e7300adb0ecc055abb4de25cd6252;hp=c096f8218a03639d6b24352c4ed4228df515993d;hpb=77c6b2650f637948787357777172a91a305ce334;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index c096f82..6807242 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -1,10 +1,16 @@ #!/bin/sh +. "$_EXEC/tools.sh" + theme_head(){ + local IFS="$BR" printf ' - - ' "$_BASE" + ' + for css in "$_BASE/[.]/cgilite/common.css" "$_BASE/[.]/themes/default.css" $PAGE_CSS; do + printf '' \ + "$(HTML "${css##*//}")" + done } theme_header(){ @@ -12,64 +18,158 @@ theme_header(){ } theme_footer(){ - printf '' "$(wiki '[wiki]/footer/' ||echo No footer)" + printf '' "$(wiki '[wiki]/footer/')" +} + +theme_pagemenu(){ + local page="$1" + + if acl_write "$page"; then + printf ' +
' + fi } theme_page(){ - local page="$1" title - title="${page%/}"; title="${title##*/}" + local page="$1" title="$2" + title="$(HTML "${title:-"${page}"}")" - # Important! Web Server response including newline newline + # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" cat <<-EOF $(theme_head) -