function "wiki" of index.sh returned with an error.') -
X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=themes%2Fdefault.sh;h=001dd3caa85d1ca95825359afa8d69f47b0d3600;hb=e2ad5bc6d56a970f4c4674f5c96ba7458370d8c9;hp=0d60fb34a4144846925a50dbc54ebd716381e602;hpb=e7342f9c967cce37a40d37f84e9e182c6f4e02a5;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index 0d60fb3..001dd3c 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -15,20 +15,26 @@ 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 + printf ' +
' fi +} + +theme_page(){ + local page="$1" title="$2" + title="$(HTML "${title:-"${page}"}")" # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" @@ -37,19 +43,18 @@ theme_page(){ $(theme_head) -