From 507d85b9d1725418a1488b9c6a4b75f45ce30c9a Mon Sep 17 00:00:00 2001 From: allen Date: Sat, 23 Sep 2000 15:35:39 +0000 Subject: Nicer screen when no images are there to view git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPDExtra/trunk@12 61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1 --- src/IO.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/IO.c b/src/IO.c index 36dbe57..8f59350 100644 --- a/src/IO.c +++ b/src/IO.c @@ -365,6 +365,7 @@ static int SendFilePage(cGH *cctkGH, httpRequest *request, void *data) static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data) { int retval; + int foundone; char message[4098]; struct httpuFileList *list; @@ -400,29 +401,48 @@ static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data) "

Many IO methods have steerable parameters which " "allow you to e.g. add fields and customise behaviour." "Depending on your authorisation, you can access the" - " parameter steering page

" - "
" - "" - "\n"); + " parameter steering page

"); HTTP_Write(request, message, strlen(message)); + foundone = 0; for (list = filelist; list; list = list->next) { if (CCTK_Equals(list->data.mimetype,"image/jpeg")) { + if (!foundone) + { + strcpy(message, + "
" + "
Variable
File Name
DescriptionImage
" + "\n" + "\n"); + HTTP_Write(request, message, strlen(message)); + foundone = 1; + } sprintf(message, - "" - "" - "\n", + "\n" + "\n" + "\n" + "\n" + "\n", list->data.varname,list->linkname, list->filename, list->data.description,list->linkname); HTTP_Write(request, message, strlen(message)); } } - strcpy(message,"
Variable
File Name
DescriptionImage
%s
" - "%s
%s
%s
\n" + "%s\n" + "
%s
"); + if (!foundone) + { + strcpy(message,"

No viewable images registered!

" + "
\n"); + HTTP_Write(request, message, strlen(message)); + } + + + strcpy(message,"\n
\n"); HTTP_Write(request, message, strlen(message)); /* Write out the footer part. */ -- cgit v1.2.3