function "wiki" of index.sh returned with an error.') -
X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=inline;f=themes%2Fdefault.sh;h=de357871bd49695f9a2b01efc81c1f12178b2628;hb=9684cabf3651df8369d71c7a60e9235730dbe978;hp=3c5f2a1819a000277c06dc31451a2013f1335812;hpb=922181c682dc5d499eea65ae502e894e88e07f84;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index 3c5f2a1..de35787 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -3,11 +3,14 @@ . "$_EXEC/tools.sh" theme_head(){ + local IFS="$BR" printf ' - - - - ' "$_BASE" + + ' + for css in "$_BASE/%5B.%5D/cgilite/common.css" "$_BASE/%5B.%5D/themes/default.css" $PAGE_CSS; do + printf '' \ + "$(HTML "${css##*//}")" + done } theme_header(){ @@ -15,41 +18,50 @@ theme_header(){ } theme_footer(){ - printf '' "$(wiki '[wiki]/footer/' ||echo No footer)" + printf '' "$(wiki '[wiki]/footer/')" } -theme_page(){ - local page="$1" title - title="${page%/}"; title="${title##*/}" +theme_pagemenu(){ + local page="$1" - if [ ! "$(mdfile "$page")" ]; then - theme_error 404 - return 0 - elif ! acl_read "$page"; then - theme_error 403 - return 0 + if acl_write "$page"; then + cat <<-EOF +
+ EOF fi +} + +theme_page(){ + local page="$1" title="$2" + title="$(HTML "${title:-"${PAGE_TITLE:-"${page}"}"}")" # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" cat <<-EOF - + $(theme_head) -![](%s)
[%s](%s)
' "$att" "$att" + ;; + esac + done) +