X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=themes%2Fdefault.sh;h=0b850078a06c321a6892813b1d129b8b1fabd9af;hb=fef8e307b2e7777e5c43766e625338da8089bbfc;hp=56b57aed24eb505669d742cca13fde2f9660ae3f;hpb=b2c5e68fd567ad46143e70254c95f5b1050c8ed0;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index 56b57ae..0b85007 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -1,9 +1,12 @@ #!/bin/sh +. "$_EXEC/tools.sh" + theme_head(){ printf ' + ' "$_BASE" } @@ -12,63 +15,140 @@ 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) -