Changeset 282 for trunk/gsdl/src/recpt
- Timestamp:
- 1999-06-17T15:06:58+12:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/browsetools.cpp
r281 r282 12 12 /* 13 13 $Log$ 14 Revision 1.8 1999/06/17 03:06:53 sjboddie 15 got detach button working properly - the close book icon is now disabled 16 when page is detached as the javascript close() function I was using is 17 too unreliable over different browsers 18 note that in my last comment I meant the "cl" arg (not the "c" arg). 19 14 20 Revision 1.7 1999/06/16 23:53:14 sjboddie 15 21 tidied a few things up. documentaction::define_external_macros now … … 218 224 219 225 // detach button 220 buttons.push_back ("_ imagedetach_");226 buttons.push_back ("_document:imagedetach_"); 221 227 222 228 // highlighting button 223 229 if (args["hl"] == "1") 224 buttons.push_back ("_ imagenohighlight_");230 buttons.push_back ("_document:imagenohighlight_"); 225 231 else 226 buttons.push_back ("_ imagehighlight_");232 buttons.push_back ("_document:imagehighlight_"); 227 233 228 234 // expand/contract contents button - only have this if it's … … 232 238 if (response.docInfo[0].metadata[0].values[0] == "Hierarchy") 233 239 if (args["gc"] == "1") 234 buttons.push_back ("_ imagecontracttoc_");240 buttons.push_back ("_document:imagecontracttoc_"); 235 241 else 236 buttons.push_back ("_ imageexpandtoc_");242 buttons.push_back ("_document:imageexpandtoc_"); 237 243 } 238 244 239 245 // expand/contract text button 240 246 if (args.getintarg("gt")) 241 buttons.push_back ("_ imagecontracttext_");247 buttons.push_back ("_document:imagecontracttext_"); 242 248 else 243 buttons.push_back ("_ imageexpandtext_");249 buttons.push_back ("_document:imageexpandtext_"); 244 250 245 251 text_tarray::const_iterator here = buttons.begin(); … … 472 478 if ((classifytype == "Document") && (is_top((*thissection).OID)) && 473 479 (args.getintarg("x"))) 474 textout << "<a href=\"\" onClick = \"close_detach();\">"; 480 textout << outconvert << disp << icon << "</td><td"; 481 475 482 else { 476 483 if (!gt) { … … 504 511 count ++; 505 512 } 506 }507 508 textout << outconvert << disp << icon << "</a></td><td";513 514 textout << outconvert << disp << icon << "</a></td><td"; 515 } 509 516 if (colsremaining > 1) textout << " colspan=" << colsremaining; 510 517 textout << outconvert << disp << ">" << title << "</td></tr>\n"; … … 567 574 tabcount ++; 568 575 576 textout << outconvert << disp << "<tr>" << tab << "<td valign=top>"; 577 569 578 if (is_top(*thisparent) && args["x"] == "1") { 570 textout << outconvert << disp << "<tr>" << tab << "<td valign=top><a href=\"\" " 571 << "onClick = \"close_detach()\">" << icon << "</a></td>"; 579 textout << outconvert << disp << icon; 572 580 } else { 573 581 text_t link; … … 583 591 else link = doclink + "&cl=" + arg_cl + "&d=" + *thisparent + ".pr\">"; 584 592 585 textout << outconvert << disp << "<tr>" << tab << "<td valign=top>" 586 << link << icon << "</a></td>"; 593 textout << outconvert << disp << link << icon << "</a>"; 587 594 } 588 textout << "< td";595 textout << "</td><td"; 589 596 if (colnum > 1) textout << outconvert << " colspan=" << text_t(colnum); 590 597 textout << outconvert << disp << ">" << title << "</td></tr>\n"; -
trunk/gsdl/src/recpt/documentaction.cpp
r281 r282 12 12 /* 13 13 $Log$ 14 Revision 1.7 1999/06/17 03:06:58 sjboddie 15 got detach button working properly - the close book icon is now disabled 16 when page is detached as the javascript close() function I was using is 17 too unreliable over different browsers 18 note that in my last comment I meant the "cl" arg (not the "c" arg). 19 14 20 Revision 1.6 1999/06/16 23:53:15 sjboddie 15 21 tidied a few things up. documentaction::define_external_macros now … … 131 137 arg_ainfo.defaultstatus = cgiarginfo::weak; 132 138 arg_ainfo.argdefault = "0"; 133 arg_ainfo.savedarginfo = cgiarginfo:: can;139 arg_ainfo.savedarginfo = cgiarginfo::must; 134 140 argsinfo.addarginfo (NULL, arg_ainfo); 135 141 } … … 240 246 } 241 247 242 get_top (arg_cl, topparent); 243 244 collectproto->get_filterinfo (collection, filterinfo, err, logout); 245 if (err == noError) { 246 // check that there's a browse filter 247 if (filterinfo.filterNames.find ("BrowseFilter") != filterinfo.filterNames.end()) { 248 249 metadata.push_back ("Title"); 250 metadata.push_back ("classifytype"); 251 get_children ("", collection, metadata, collectproto, response, logout); 252 253 // don't do anything unless there are classifications 254 if (!response.docInfo.empty()) { 255 256 ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin(); 257 ResultDocInfo_tarray::const_iterator docend = response.docInfo.end(); 248 // don't want navigation bar if page is 'detached' 249 if (!args.getintarg("x")) { 250 251 get_top (arg_cl, topparent); 252 253 collectproto->get_filterinfo (collection, filterinfo, err, logout); 254 if (err == noError) { 255 // check that there's a browse filter 256 if (filterinfo.filterNames.find ("BrowseFilter") != filterinfo.filterNames.end()) { 258 257 259 navigationbar = "<!-- Navigation Bar -->\n"; 258 metadata.push_back ("Title"); 259 metadata.push_back ("classifytype"); 260 get_children ("", collection, metadata, collectproto, response, logout); 261 262 // don't do anything unless there are classifications 263 if (!response.docInfo.empty()) { 260 264 261 // calculate width of spacers and set macro 262 if (args.getintarg("v") == 0) { 263 disp.expandstring ("Global", "_pagewidth_", width); 264 twidth = width.getint(); 265 ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin(); 266 ResultDocInfo_tarray::const_iterator docend = response.docInfo.end(); 265 267 266 disp.expandstring ("query", "_searchwidth_", width); 267 iwidth += width.getint(); 268 navigationbar = "<!-- Navigation Bar -->\n"; 268 269 270 // calculate width of spacers and set macro 271 if (args.getintarg("v") == 0) { 272 disp.expandstring ("Global", "_pagewidth_", width); 273 twidth = width.getint(); 274 275 disp.expandstring ("query", "_searchwidth_", width); 276 iwidth += width.getint(); 277 278 while (dochere != docend) { 279 disp.expandstring ("document", "_" + (*dochere).metadata[0].values[0] + "width_", width); 280 iwidth += width.getint(); 281 dochere ++; 282 } 283 if ((twidth - iwidth) < int(response.docInfo.size())) swidth = 2; 284 else swidth = (twidth - iwidth) / response.docInfo.size(); 285 disp.setmacro ("widthtspace", "Global", swidth); 286 } 287 288 navigationbar += "<nobr>\n"; 289 if (args["a"] == "q") { 290 navigationbar += "_icontabsearchgreen_"; 291 } else { 292 navigationbar += "_imagesearch_"; 293 javaimagesnavbar = "_javasearch_"; 294 } 295 dochere = response.docInfo.begin(); 269 296 while (dochere != docend) { 270 disp.expandstring ("document", "_" + (*dochere).metadata[0].values[0] + "width_", width); 271 iwidth += width.getint(); 297 const text_t &title = (*dochere).metadata[0].values[0]; 298 const text_t &classifytype = (*dochere).metadata[1].values[0]; 299 300 // if we're inside a document all the classification buttons should be enabled 301 if (arg_d.empty() && ((*dochere).OID == topparent)) 302 navigationbar += "_imagespacer__icontab" + title + "green_"; 303 else { 304 navigationbar += "_imagespacer__image" + title + "_"; 305 306 // set the _httpbrowseXXX_ macro for this classification 307 text_t link = (*dochere).OID; 308 if (classifytype == "AZList" || classifytype == "Datelist") link += ".fc"; 309 disp.setmacro ("httpbrowse" + title, "Global", 310 "_httpdocument_&cl=" + link); 311 } 312 javaimagesnavbar += "_java" + title + "_"; 272 313 dochere ++; 273 314 } 274 if ((twidth - iwidth) < int(response.docInfo.size())) swidth = 2; 275 else swidth = (twidth - iwidth) / response.docInfo.size(); 276 disp.setmacro ("widthtspace", "Global", swidth); 315 navigationbar += "\n</nobr>\n"; 316 navigationbar += "<!-- End of Navigation Bar -->\n"; 317 disp.setmacro ("navigationbar", "Global", navigationbar); 318 if (args.getintarg("v") == 0) 319 disp.setmacro ("javaimagesnavbar", "Global", javaimagesnavbar); 277 320 } 278 279 navigationbar += "<nobr>\n"; 280 if (args["a"] == "q") { 281 navigationbar += "_icontabsearchgreen_"; 282 } else { 283 navigationbar += "_imagesearch_"; 284 javaimagesnavbar = "_javasearch_"; 285 } 286 dochere = response.docInfo.begin(); 287 while (dochere != docend) { 288 const text_t &title = (*dochere).metadata[0].values[0]; 289 const text_t &classifytype = (*dochere).metadata[1].values[0]; 290 291 // if we're inside a document all the classification buttons should be enabled 292 if (arg_d.empty() && ((*dochere).OID == topparent)) 293 navigationbar += "_imagespacer__icontab" + title + "green_"; 294 else { 295 navigationbar += "_imagespacer__image" + title + "_"; 296 297 // set the _httpbrowseXXX_ macro for this classification 298 text_t link = (*dochere).OID; 299 if (classifytype == "AZList" || classifytype == "Datelist") link += ".fc"; 300 disp.setmacro ("httpbrowse" + title, "Global", 301 "_httpdocument_&cl=" + link); 302 } 303 javaimagesnavbar += "_java" + title + "_"; 304 dochere ++; 305 } 306 navigationbar += "\n</nobr>\n"; 307 navigationbar += "<!-- End of Navigation Bar -->\n"; 308 disp.setmacro ("navigationbar", "Global", navigationbar); 309 if (args.getintarg("v") == 0) 310 disp.setmacro ("javaimagesnavbar", "Global", javaimagesnavbar); 311 } 312 } 313 } else { 314 logout << text_t2ascii 315 << "Error (documentaction::define_external_macros()) in call to get_filterinfo() " 316 << get_comerror_string (err); 321 } 322 } else { 323 logout << text_t2ascii 324 << "Error (documentaction::define_external_macros()) in call to get_filterinfo() " 325 << get_comerror_string (err); 326 } 317 327 } 318 328 } … … 326 336 // define_internal_macros sets the following macros: 327 337 338 // _random_ a random number - used for setting target tags to display 339 // a random page when you hit the 'detach' button 340 328 341 // _pagetitle_ the title to be displayed at the top of the browser window 329 342 … … 347 360 if (collectproto == NULL) return; 348 361 362 disp.setmacro("random", "document", rand()); 349 363 350 364 text_tarray metadata;
Note:
See TracChangeset
for help on using the changeset viewer.