From a8c6f8b510bb4747798c4f576162733d982bae75 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 19 Aug 2013 13:04:19 +0000 Subject: [PATCH] changed page structure svn path=/trunk/; revision=6 --- page.sh | 12 +++++------- ifcomponent/page_attendees.sh => pages/attendees.sh | 0 ifcomponent/page_courses.sh => pages/courses.sh | 0 ifcomponent/page_email.sh => pages/email.sh | 0 ifcomponent/page_error.sh => pages/error.sh | 0 ifcomponent/frame.sh => templates/frame.html.sh | 6 +++--- {ifcomponent => templates}/view_attendee.sh | 0 {ifcomponent => templates}/view_course.sh | 0 8 files changed, 8 insertions(+), 10 deletions(-) rename ifcomponent/page_attendees.sh => pages/attendees.sh (100%) rename ifcomponent/page_courses.sh => pages/courses.sh (100%) rename ifcomponent/page_email.sh => pages/email.sh (100%) rename ifcomponent/page_error.sh => pages/error.sh (100%) rename ifcomponent/frame.sh => templates/frame.html.sh (84%) rename {ifcomponent => templates}/view_attendee.sh (100%) rename {ifcomponent => templates}/view_course.sh (100%) diff --git a/page.sh b/page.sh index a26e882..f49968b 100755 --- a/page.sh +++ b/page.sh @@ -3,17 +3,15 @@ echo -n "Content-Type: text/html;charset=utf-8\n\n" PAGE="$(echo "$_GET[\"page\"]" |egrep '^[a-zA-Z0-9_-]+$')" -PAGE="${_EXEC}/ifcomponent/page_${PAGE}.sh" -[ -x "$PAGE" ] || PAGE="${_EXEC}/ifcomponent/page_error.sh" - -TITLE=$($PAGE title) +PAGE="${_EXEC}/pages/${PAGE}.sh" +[ -x "$PAGE" ] || PAGE="${_EXEC}/pages/error.sh" NAVIGATION() { - for each in "${_EXEC}/ifcomponent"/page_*.sh; do - link="$(echo "$each" |sed -r "s:^.*page_(.*)\.sh$:\1:")" + for each in "${_EXEC}"/pages/*.sh; do + link="$(echo "$each" |sed -r "s:^.*/([^/]*)\.sh$:\1:")" title="$($each title)" [ -n "$title" ] && echo "/?page=$link $title" done } -. ${_EXEC}/ifcomponent/frame.sh +. ${_EXEC}/templates/frame.html.sh diff --git a/ifcomponent/page_attendees.sh b/pages/attendees.sh similarity index 100% rename from ifcomponent/page_attendees.sh rename to pages/attendees.sh diff --git a/ifcomponent/page_courses.sh b/pages/courses.sh similarity index 100% rename from ifcomponent/page_courses.sh rename to pages/courses.sh diff --git a/ifcomponent/page_email.sh b/pages/email.sh similarity index 100% rename from ifcomponent/page_email.sh rename to pages/email.sh diff --git a/ifcomponent/page_error.sh b/pages/error.sh similarity index 100% rename from ifcomponent/page_error.sh rename to pages/error.sh diff --git a/ifcomponent/frame.sh b/templates/frame.html.sh similarity index 84% rename from ifcomponent/frame.sh rename to templates/frame.html.sh index fa04fd6..bac2871 100755 --- a/ifcomponent/frame.sh +++ b/templates/frame.html.sh @@ -1,11 +1,9 @@ -#!/bin/zsh - cat < - $TITLE + $($PAGE title)