[mapserver-commits] r7219 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Dec 27 14:07:17 EST 2007
Author: sdlime
Date: 2007-12-27 14:07:17 -0500 (Thu, 27 Dec 2007)
New Revision: 7219
Modified:
trunk/mapserver/maptemplate.c
Log:
Updated template include tag to allow for tag processing in the included content.
Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c 2007-12-27 16:48:12 UTC (rev 7218)
+++ trunk/mapserver/maptemplate.c 2007-12-27 19:07:17 UTC (rev 7219)
@@ -967,13 +967,13 @@
** TODO's:
** - Allow URLs.
*/
-static int processInclude(mapObj *map, char **line)
+static int processInclude(mapservObj *ms, char **line, int mode)
{
char *tag, *tagStart, *tagEnd;
hashTableObj *tagArgs=NULL;
int tagOffset, tagLength;
- char *content=NULL, *src=NULL;
+ char *content=NULL, *processedContent=NULL, *src=NULL;
FILE *stream;
char buffer[MS_BUFFER_LENGTH], path[MS_MAXPATHLEN];
@@ -999,7 +999,7 @@
if(!src) return(MS_SUCCESS); /* don't process the tag, could be something else so return MS_SUCCESS */
- if((stream = fopen(msBuildPath(path, map->mappath, src), "r")) == NULL) {
+ if((stream = fopen(msBuildPath(path, ms->Map->mappath, src), "r")) == NULL) {
msSetError(MS_IOERR, src, "processInclude()");
return MS_FAILURE;
}
@@ -1017,13 +1017,18 @@
strncpy(tag, tagStart, tagLength);
tag[tagLength] = '\0';
+ /* process any tags in the content */
+ processedContent = processLine(ms, content, mode);
+
/* do the replacement */
- *line = msReplaceSubstring(*line, tag, content);
+ *line = msReplaceSubstring(*line, tag, processedContent);
/* clean up */
free(tag); tag = NULL;
msFreeHashTable(tagArgs); tagArgs=NULL;
free(content);
+ free(processedContent);
+
if((*line)[tagOffset] != '\0')
tagStart = findTag(*line+tagOffset+1, "include");
@@ -2984,7 +2989,7 @@
} /* end query mode specific substitutions */
- if(processInclude(msObj->Map, &outstr) != MS_SUCCESS)
+ if(processInclude(msObj, &outstr, mode) != MS_SUCCESS)
return(NULL);
for(i=0;i<msObj->request->NumParams;i++) {
More information about the mapserver-commits
mailing list