diff options
author | allen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1> | 2000-09-23 15:35:39 +0000 |
---|---|---|
committer | allen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1> | 2000-09-23 15:35:39 +0000 |
commit | 507d85b9d1725418a1488b9c6a4b75f45ce30c9a (patch) | |
tree | 5fb68b2bb8fc00e4449414dac96b53ffff146170 /src | |
parent | 15b0025e813045765ee012321a6cf5cd10828fd0 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/IO.c | 38 |
1 files changed, 29 insertions, 9 deletions
@@ -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) "<p>Many IO methods have <i>steerable</i> parameters which " "allow you to e.g. add fields and customise behaviour." "Depending on your authorisation, you can access the" - " <a href=\"/Parameters/index.html\">parameter steering page</a></p>" - "<center>" - "<table cellspacing=5 cellpadding=5 border=0\n>" - "<tr><th>Variable<br>File Name</th><th>Description</th><th>Image</th></tr>\n"); + " <a href=\"/Parameters/index.html\">parameter steering page</a></p>"); 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, + "<center>" + "<table cellspacing=5 cellpadding=5 border=0\n>" + "<tr><th>Variable<br>File Name</th>\n" + "<th>Description</th><th>Image</th></tr>\n"); + HTTP_Write(request, message, strlen(message)); + foundone = 1; + } sprintf(message, - "<tr><td valign=center><small>%s<br>" - "<A HREF=\"/Output/%s\">%s</A></small></td>" - "<td valign=center>%s</td>" - "<td valign=center><img src=\"%s\"></td></tr>\n", + "<tr>\n" + "<td valign=center><small>%s<br>\n" + "<A HREF=\"/Output/%s\">%s</A>\n" + "</small></td>\n" + "<td valign=center>%s</td>\n" + "<td valign=center><img src=\"%s\"></td>\n" + "</tr>\n", list->data.varname,list->linkname, list->filename, list->data.description,list->linkname); HTTP_Write(request, message, strlen(message)); } } - strcpy(message,"</table></center>"); + if (!foundone) + { + strcpy(message,"<center><b><p>No viewable images registered!</p>" + "<b><center>\n"); + HTTP_Write(request, message, strlen(message)); + } + + + strcpy(message,"</table>\n</center>\n"); HTTP_Write(request, message, strlen(message)); /* Write out the footer part. */ |