source: trunk/gsdl/src/recpt/browsetools.cpp@ 941

Last change on this file since 941 was 941, checked in by sjboddie, 24 years ago

minor stuff - fixed some cvs conflicts

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 23.7 KB
Line 
1
2/**********************************************************************
3 *
4 * browsetools.cpp --
5 * Copyright (C) 1999 The New Zealand Digital Library Project
6 *
7 * A component of the Greenstone digital library software
8 * from the New Zealand Digital Library Project at the
9 * University of Waikato, New Zealand.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * $Id: browsetools.cpp 941 2000-02-17 02:42:25Z sjboddie $
26 *
27 *********************************************************************/
28
29/*
30 $Log$
31 Revision 1.38 2000/02/17 02:42:24 sjboddie
32 minor stuff - fixed some cvs conflicts
33
34 Revision 1.37 2000/02/15 22:53:47 kjm18
35 search history stuff added.
36
37 Revision 1.36 2000/02/06 21:31:36 sjboddie
38 made some formerly static functions accessible from elsewhere (for
39 cstr receptionist)
40
41 Revision 1.35 2000/01/26 23:46:16 sjboddie
42 wrap every second button now (was every third)
43
44 Revision 1.34 1999/11/09 02:28:47 sjboddie
45 fixed minor bug in expanded contents
46
47 Revision 1.33 1999/10/30 22:22:26 sjboddie
48 added collection argument to browserclass output_section_group
49 functions -- moved table functions to formattools
50
51 Revision 1.32 1999/10/24 07:22:37 sjboddie
52 added a FullTOC option
53
54 Revision 1.31 1999/10/20 03:54:20 sjboddie
55 problem with expanded contents
56
57 Revision 1.30 1999/10/19 21:36:59 sjboddie
58 fixed bug in DocumentContents
59
60 Revision 1.29 1999/10/19 08:40:12 sjboddie
61 fixed some stupid compiler warnings on windows
62
63 Revision 1.28 1999/10/18 20:08:36 sjboddie
64 tidied up a few things
65
66 Revision 1.27 1999/10/15 03:31:42 sjboddie
67 oops, left out an '&'
68
69 Revision 1.26 1999/10/14 22:58:05 sjboddie
70 finished up on changes to browseing support - may still need some
71 tidying up
72
73 Revision 1.25 1999/10/10 08:14:04 sjboddie
74 - metadata now returns mp rather than array
75 - redesigned browsing support (although it's not finished so
76 won't currently work ;-)
77
78 Revision 1.24 1999/09/28 01:46:55 rjmcnab
79 removed some unused stuff
80
81 Revision 1.23 1999/09/23 10:09:17 sjboddie
82 made some changes so AZLists within other classifications are
83 handled properly
84
85 Revision 1.22 1999/09/07 23:06:58 rjmcnab
86 removed some compiler warnings.
87
88 Revision 1.21 1999/09/07 04:56:52 sjboddie
89 added GPL notice
90
91 Revision 1.20 1999/08/25 04:46:58 sjboddie
92 fixed bug
93
94 Revision 1.19 1999/08/13 04:18:04 sjboddie
95 fixed some typos
96
97 Revision 1.18 1999/08/10 22:42:21 sjboddie
98 added more format options to document tocs - there are now just two
99 types of toc - standard (Hierarchical) and document (as in books)
100
101 Revision 1.17 1999/08/09 02:12:07 sjboddie
102 made it so dates may be only 4 digits (i.e. year only)
103
104 Revision 1.16 1999/07/30 02:16:10 sjboddie
105 -added ability to display nested classifications (expanded versions
106 of nested classifications has yet to be done).
107 -changed set_arrow_macros slightly to fit in with new showtoppage
108 format option
109
110 Revision 1.15 1999/07/21 05:01:56 sjboddie
111 wrote handler for DateList classification
112
113 Revision 1.14 1999/07/20 02:58:15 sjboddie
114 got List and AZList classifications using format strings - tidied
115 up a bit
116
117 Revision 1.13 1999/07/07 05:44:25 sjboddie
118 Made some changes to allow for new way classifiers work (i.e. you can
119 now have classifiers containing other classifiers). At present there's
120 only a special case for dealing with the hdl 'magazine' section. A bit
121 of a redesign is needed to get it completely flexible
122
123 Revision 1.12 1999/07/01 03:47:49 rjmcnab
124 Fixed a small warning.
125
126 Revision 1.11 1999/06/27 21:49:01 sjboddie
127 fixed a couple of version conflicts - tidied up some small things
128
129 Revision 1.10 1999/06/26 01:07:21 rjmcnab
130 Fixed a small "bug" -- well I probably just covered another one...
131
132 Revision 1.9 1999/06/24 05:12:15 sjboddie
133 lots of small changes
134
135 Revision 1.8 1999/06/17 03:06:53 sjboddie
136 got detach button working properly - the close book icon is now disabled
137 when page is detached as the javascript close() function I was using is
138 too unreliable over different browsers
139 note that in my last comment I meant the "cl" arg (not the "c" arg).
140
141 Revision 1.7 1999/06/16 23:53:14 sjboddie
142 tidied a few things up. documentaction::define_external_macros now
143 resets the "c" arg if it's set to something stupid by the .xx suffixes
144
145 Revision 1.6 1999/06/16 04:03:47 sjboddie
146 Now sets "cl" arg to "search" when going to a document from a search
147 results page. This allows the close book icon (in hierarchy toc) to
148 take you back to the results page if that's where you came from.
149 If you got to the document page somehow other than from a
150 classification or a search (i.e. if "cl" isn't set) then the close
151 book icon is disabled
152
153 Revision 1.5 1999/06/16 03:11:25 sjboddie
154 get_info() now takes a getParents argument
155
156 Revision 1.4 1999/05/10 03:40:26 sjboddie
157 lots of changes - slowly getting document action sorted out
158
159 Revision 1.3 1999/04/30 01:59:39 sjboddie
160 lots of stuff - getting documentaction working (documentaction replaces
161 old browseaction)
162
163 Revision 1.2 1999/03/29 02:14:29 sjboddie
164
165 More changes to browseaction
166
167 Revision 1.1 1999/03/25 03:10:15 sjboddie
168
169 new library for browse stuff
170
171 */
172
173#include "browsetools.h"
174#include "OIDtools.h"
175
176
177// output_controls displays the detach, expand/contract contents,
178// expand/contract text and highlighting/no highlighting buttons
179
180void output_controls (cgiargsclass &args, const text_tarray &ibuttons,
181 recptproto * /*collectproto*/, displayclass &disp,
182 outconvertclass &outconvert, ostream &textout,
183 ostream &/*logout*/) {
184
185 if (args["u"] != "1") {
186
187 FilterResponse_t response;
188 text_tarray metadata;
189 text_tarray buttons;
190
191 text_tarray::const_iterator here = ibuttons.begin();
192 text_tarray::const_iterator end = ibuttons.end();
193
194 while (here != end) {
195
196 if (*here == "Detach")
197 buttons.push_back ("_document:imagedetach_");
198 else if (*here == "Highlight") {
199 if (args["hl"] == "1")
200 buttons.push_back ("_document:imagenohighlight_");
201 else
202 buttons.push_back ("_document:imagehighlight_");
203 } else if (*here == "Expand Contents") {
204 if (args["gc"] == "1")
205 buttons.push_back ("_document:imagecontracttoc_");
206 else
207 buttons.push_back ("_document:imageexpandtoc_");
208 } else if (*here == "Expand Text") {
209 if (args.getintarg("gt"))
210 buttons.push_back ("_document:imagecontracttext_");
211 else
212 buttons.push_back ("_document:imageexpandtext_");
213 }
214 here ++;
215 }
216
217 here = buttons.begin();
218 end = buttons.end();
219 int count = 0;
220 while (here != end) {
221 if ((count != 0) && ((count % 2) == 0)) textout << "<br>\n";
222 textout << outconvert << disp << *here;
223 count ++;
224 here ++;
225 }
226 }
227}
228
229
230// at the moment this just writes out the html to display
231// the cover image (assuming it's called cover.jpg)
232// this whole thing should be done with a call to the collection
233// server which would send a link to the cover image if there
234// was one otherwise send title, author and stuff
235void output_cover_image (cgiargsclass &args, recptproto * /*collectproto*/,
236 displayclass &disp, outconvertclass &outconvert,
237 ostream &textout, ostream &/*logout*/) {
238
239 if (args["d"].empty()) return;
240
241 textout << outconvert << disp <<
242 "<img src=\"_httpcollection_/archives/_thisOID_/cover.jpg\"><br>\n";
243}
244
245void output_titles (cgiargsclass &args, recptproto *collectproto,
246 formatinfo_t &formatinfo, displayclass &disp,
247 outconvertclass &outconvert, ostream &textout,
248 ostream &logout) {
249
250 if (args["d"].empty()) return;
251
252 text_tset metadata;
253 bool getParents;
254 FilterResponse_t response;
255
256 format_t *formatlistptr = new format_t();
257 parse_formatstring (formatinfo.DocumentHeading, formatlistptr, metadata, getParents);
258
259 if (!get_info (args["d"], args["c"], metadata, getParents, collectproto, response, logout))
260 return;
261
262 textout << outconvert << disp << get_formatted_string (response.docInfo[0], formatlistptr);
263}
264
265
266static void recurse_contents (ResultDocInfo_t &section, cgiargsclass &args, bool fulltoc,
267 browserclass *bptr, text_tset &metadata, bool &getParents,
268 format_t *formatlistptr, format_tmap &formatlistmap,
269 formatinfo_t &formatinfo, browsermapclass *browsermap,
270 int tabcount, recptproto *collectproto, displayclass &disp,
271 outconvertclass &outconvert, ostream &textout, ostream &logout) {
272 text_t formatstring;
273
274 bool is_classify = false;
275 if (args["d"].empty() || fulltoc) is_classify = true;
276
277 // output this section
278 bool use_table = is_table_content (formatlistptr);
279 tabcount += bptr->output_section_group (section, args, "", tabcount, formatlistptr, use_table,
280 metadata, getParents, collectproto, disp, outconvert,
281 textout, logout);
282
283 text_t classification;
284 if (!is_classify) classification = "Document";
285 else get_top (args["cl"], classification);
286
287 int haschildren = section.metadata["haschildren"].values[0].getint();
288 const text_t &doctype = section.metadata["doctype"].values[0];
289 text_t classifytype = section.metadata["childtype"].values[0];
290 // HLists and DateLists are displayed as VLists when contents
291 // are expanded, Paged documents are displayed as HLists
292 if (classifytype == "HList" || classifytype == "DateList") classifytype = "VList";
293 if (classifytype == "Paged") classifytype = "HList";
294
295 // recurse through children
296 if ((haschildren == 1) && (!is_classify || fulltoc || doctype == "classify")) {
297
298 // get browser for displaying children
299 bptr = browsermap->getbrowser (classifytype);
300 bptr->load_metadata_defaults (metadata);
301
302 // get the formatstring if there is one
303 if (!get_formatstring (classification, classifytype,
304 formatinfo.formatstrings, formatstring))
305 formatstring = bptr->get_default_formatstring();
306
307 format_tmap::const_iterator it = formatlistmap.find (formatstring);
308 // check if formatlistptr is cached
309 if (it != formatlistmap.end()) formatlistptr = (*it).second;
310 else {
311 formatlistptr = new format_t();
312 parse_formatstring (formatstring, formatlistptr, metadata, getParents);
313 formatlistmap[formatstring] = formatlistptr;
314 }
315
316 FilterResponse_t tmp;
317 get_children (section.OID, args["c"], metadata, getParents, collectproto, tmp, logout);
318 ResultDocInfo_tarray::iterator thisdoc = tmp.docInfo.begin();
319 ResultDocInfo_tarray::iterator lastdoc = tmp.docInfo.end();
320
321 while (thisdoc != lastdoc) {
322 recurse_contents (*thisdoc, args, fulltoc, bptr, metadata, getParents,
323 formatlistptr, formatlistmap, formatinfo, browsermap,
324 tabcount, collectproto, disp, outconvert, textout, logout);
325 thisdoc ++;
326 }
327 }
328}
329
330
331// expanded_contents recurses through all contents. there's a special case
332// for an HList when contents are expanded (i.e. it's displayed as a VList)
333//
334// if we're inside a document we expand all contents from the top,
335// if we're at classification level we'll just expand out those contents below
336// the current one
337
338void expanded_contents (cgiargsclass &args, int tabcount, bool fulltoc,
339 browsermapclass *browsermap, formatinfo_t &formatinfo,
340 recptproto *collectproto, displayclass &disp,
341 outconvertclass &outconvert, ostream &textout,
342 ostream &logout) {
343
344 if (args["d"].empty() && args["cl"].empty()) return;
345 text_t OID;
346
347 FilterResponse_t response;
348 bool getParents = false;
349 text_tset metadata;
350 text_t classifytype, classification, formatstring;
351
352 if (!args["d"].empty()) {
353 // document level
354 if (fulltoc) {
355 get_top (args["cl"], OID);
356 classification = OID;
357 }
358 else {
359 // always expand document level from top
360 get_top (args["d"], OID);
361 classification = "Document";
362 }
363 } else {
364 // classification level
365 OID = args["cl"];
366 get_top (args["cl"], classification);
367 }
368
369 // get classifytype of this level
370 text_t tOID;
371 if (is_top(OID)) {
372 classifytype = "thistype";
373 tOID = OID;
374 } else {
375 classifytype = "childtype";
376 tOID = get_parent (OID);
377 }
378 metadata.insert (classifytype);
379
380 if (!get_info (tOID, args["c"], metadata, getParents, collectproto, response, logout))
381 return;
382 classifytype = response.docInfo[0].metadata[classifytype].values[0];
383 // if we still don't have a classifytype we'll use the default
384 if (classifytype.empty()) {
385 browserclass *bptr = browsermap->get_default_browser ();
386 classifytype = bptr->get_browser_name ();
387 }
388
389 // HLists are displayed as VLists when contents are expanded,
390 // Paged documents are displayed as HLists
391 if (classifytype == "HList") {
392 classifytype = "VList";
393 text_t pOID = get_parent (OID);
394 if (!pOID.empty()) {
395 OID = pOID;
396 // this is assuming that top levels are always 'Invisible' !!!
397 if (is_top (OID)) classifytype = "Invisible";
398 }
399 }
400 if (classifytype == "Paged") classifytype = "HList";
401
402 metadata.erase (metadata.begin(), metadata.end());
403
404 // metadata elements needed by recurse_contents
405 metadata.insert ("childtype");
406 metadata.insert ("doctype");
407 metadata.insert ("haschildren");
408
409 // load up metadata array with browser defaults
410 browserclass *bptr = browsermap->getbrowser (classifytype);
411 bptr->load_metadata_defaults (metadata);
412
413 // get the formatstring if there is one or use the browsers default
414 if (!get_formatstring (classification, classifytype,
415 formatinfo.formatstrings, formatstring))
416 formatstring = bptr->get_default_formatstring();
417
418 format_t *formatlistptr = new format_t();
419 parse_formatstring (formatstring, formatlistptr, metadata, getParents);
420
421 // protocol call
422 if (!get_info (OID, args["c"], metadata, getParents, collectproto, response, logout))
423 return;
424
425 format_tmap formatlistmap;
426 formatlistmap[formatstring] = formatlistptr;
427
428 recurse_contents (response.docInfo[0], args, fulltoc, bptr, metadata,
429 getParents, formatlistptr, formatlistmap, formatinfo, browsermap,
430 tabcount, collectproto, disp, outconvert, textout, logout);
431
432 // clean up format list pointers
433 format_tmap::const_iterator here = formatlistmap.begin();
434 format_tmap::const_iterator end = formatlistmap.end();
435 while (here != end) {
436 delete (*here).second;
437 here ++;
438 }
439}
440
441
442static void load_formatstring (const text_t &classifytype, text_tset &metadata,
443 bool &getParents, const text_t &classification,
444 browsermapclass *browsermap, formatinfo_t &formatinfo,
445 format_tmap &formatlistmap) {
446 text_t formatstring;
447
448 // load up metadata array with browser defaults
449 browserclass *bptr = browsermap->getbrowser (classifytype);
450 bptr->load_metadata_defaults (metadata);
451
452 // get the formatstring if there is one or use the browsers default
453 if (!get_formatstring (classification, classifytype,
454 formatinfo.formatstrings, formatstring))
455 formatstring = bptr->get_default_formatstring();
456
457 // see if it's cached
458 format_tmap::const_iterator it = formatlistmap.find (formatstring);
459 if (it == formatlistmap.end()) {
460 format_t *formatlistptr = new format_t();
461 parse_formatstring (formatstring, formatlistptr, metadata, getParents);
462 formatlistmap[formatstring] = formatlistptr;
463 }
464}
465
466static void load_formatstrings (FilterResponse_t &response, text_tset &metadata,
467 bool &getParents, const text_t &classification,
468 browsermapclass *browsermap, formatinfo_t &formatinfo,
469 format_tmap &formatlistmap) {
470
471 text_tset cache;
472
473 ResultDocInfo_tarray::iterator thisdoc = response.docInfo.begin();
474 ResultDocInfo_tarray::iterator lastdoc = response.docInfo.end();
475
476 while (thisdoc != lastdoc) {
477
478 if (is_top ((*thisdoc).OID))
479 load_formatstring ((*thisdoc).metadata["thistype"].values[0], metadata,
480 getParents, classification, browsermap, formatinfo,
481 formatlistmap);
482
483 text_t &childtype = (*thisdoc).metadata["childtype"].values[0];
484 text_tset::const_iterator it = cache.find (childtype);
485 if (it == cache.end()) {
486 load_formatstring (childtype, metadata, getParents, classification,
487 browsermap, formatinfo, formatlistmap);
488 cache.insert (childtype);
489 }
490 thisdoc ++;
491 }
492}
493
494static void output_parents (FilterResponse_t &response, cgiargsclass &args,
495 browsermapclass *browsermap, formatinfo_t &formatinfo,
496 format_tmap &formatlistmap, const text_t &classification,
497 int &tabcount, text_tset &metadata, bool &getParents,
498 recptproto *collectproto, displayclass &disp,
499 outconvertclass &outconvert, ostream &textout,
500 ostream &logout) {
501
502 format_t *formatlistptr = NULL;
503 text_t classifytype, formatstring;
504 bool use_table, first = true;
505 ResultDocInfo_tarray::iterator thisparent = response.docInfo.begin();
506 ResultDocInfo_tarray::iterator lastparent = response.docInfo.end();
507 while (thisparent != lastparent) {
508
509 // get classifytype of this level
510 if (is_top ((*thisparent).OID)) classifytype = (*thisparent).metadata["thistype"].values[0];
511 else if (!first) classifytype = (*(thisparent-1)).metadata["childtype"].values[0];
512
513 // if we still don't have a classifytype we'll use the default
514 if (classifytype.empty()) {
515 browserclass *bptr = browsermap->get_default_browser ();
516 classifytype = bptr->get_browser_name ();
517 }
518
519 browserclass *bptr = browsermap->getbrowser (classifytype);
520
521 // get the formatstring if there is one or use the browsers default
522 if (!get_formatstring (classification, classifytype,
523 formatinfo.formatstrings, formatstring))
524 formatstring = bptr->get_default_formatstring();
525
526 // see if it's cached
527 format_tmap::const_iterator it = formatlistmap.find (formatstring);
528 if (it != formatlistmap.end()) formatlistptr = (*it).second;
529 else {
530 logout << "browsetools error\n";
531 return;
532 }
533
534 use_table = is_table_content (formatlistptr);
535 tabcount += bptr->output_section_group (*thisparent, args, "", tabcount, formatlistptr,
536 use_table, metadata, getParents, collectproto,
537 disp, outconvert, textout, logout);
538 first = false;
539 thisparent ++;
540 }
541}
542
543void contracted_contents (cgiargsclass &args, int tabcount, bool fulltoc,
544 browsermapclass *browsermap, formatinfo_t &formatinfo,
545 recptproto *collectproto, displayclass &disp,
546 outconvertclass &outconvert, ostream &textout,
547 ostream &logout) {
548
549 FilterResponse_t response;
550 text_tset metadata;
551 bool getParents = false;
552 text_t formatstring;
553 text_tarray parents;
554 text_t OID = args["d"];
555 text_t classification = "Document";
556 if (OID.empty()) {
557 OID = args["cl"];
558 get_top (OID, classification);
559 } else if (fulltoc)
560 get_top (args["cl"], classification);
561
562 bool haschildren = has_children (OID, args["c"], collectproto, logout);
563
564 if ((!args["d"].empty()) && fulltoc)
565 get_parents_array (args["cl"] + ".fc", parents);
566 if (haschildren) get_parents_array (OID + ".fc", parents);
567 else get_parents_array (OID, parents);
568
569 if (!parents.empty()) {
570 // get classifytypes of each parent
571 metadata.insert ("thistype");
572 metadata.insert ("childtype");
573
574 if (!get_info (parents, args["c"], metadata, getParents, collectproto, response, logout))
575 return;
576
577 // get formatstrings for all parents
578 format_tmap formatlistmap;
579 load_formatstrings (response, metadata, getParents, classification,
580 browsermap, formatinfo, formatlistmap);
581
582 if (!get_info (parents, args["c"], metadata, getParents, collectproto, response, logout))
583 return;
584
585 // display each parent
586 output_parents (response, args, browsermap, formatinfo, formatlistmap,
587 classification, tabcount, metadata, getParents,
588 collectproto, disp, outconvert, textout, logout);
589
590 metadata.erase (metadata.begin(), metadata.end());
591
592 // clean up cached format list pointers
593 format_tmap::const_iterator here = formatlistmap.begin();
594 format_tmap::const_iterator end = formatlistmap.end();
595 while (here != end) {
596 delete (*here).second;
597 here ++;
598 }
599 }
600
601 // get childrens classifytype
602 text_t classifytype;
603 int numparents = response.docInfo.size();
604 if (!parents.empty())
605 classifytype = response.docInfo[numparents-1].metadata["childtype"].values[0];
606 else {
607 // use the default
608 browserclass *bptr = browsermap->get_default_browser ();
609 classifytype = bptr->get_browser_name ();
610 }
611
612 // load up metadata array with browser defaults
613 browserclass *bptr = browsermap->getbrowser (classifytype);
614 bptr->load_metadata_defaults (metadata);
615
616 // get the formatstring if there is one or use the browsers default
617 if (!get_formatstring (classification, classifytype,
618 formatinfo.formatstrings, formatstring))
619 formatstring = bptr->get_default_formatstring();
620
621 format_t *formatlistptr = new format_t();
622 parse_formatstring (formatstring, formatlistptr, metadata, getParents);
623
624 if (haschildren)
625 get_children (OID, args["c"], metadata, getParents,
626 collectproto, response, logout);
627 else if (!is_top(OID)) {
628 get_children (OID + ".pr", args["c"], metadata, getParents,
629 collectproto, response, logout);
630 haschildren = true;
631 }
632
633 // display children
634 if (haschildren) {
635 bool use_table = is_table_content (formatlistptr);
636 bptr->output_section_group (response, args, "", tabcount, formatlistptr, use_table,
637 metadata, getParents, collectproto, disp, outconvert,
638 textout, logout);
639 }
640
641 delete formatlistptr;
642}
643
644void output_toc (cgiargsclass &args, browsermapclass *browsermap,
645 formatinfo_t &formatinfo, recptproto *collectproto,
646 displayclass &disp, outconvertclass &outconvert,
647 ostream &textout, ostream &logout) {
648
649 int tabcount = 0;
650 bool havecontrols = false;
651 bool fulltoc = false;
652
653 if (args["cl"] != "search") {
654 // see if there's a FullTOC string
655 text_t cl_top, full_toc;
656 get_top (args["cl"], cl_top);
657 if (get_formatstring (cl_top, "FullTOC", formatinfo.formatstrings, full_toc))
658 if (full_toc == "true") fulltoc = true;
659 }
660
661 // get the cover image (if there is one) and the control buttons
662 // if we're inside a book
663 if ((!fulltoc) && (!args["d"].empty())) {
664 textout << "<p><table cellpadding=0 cellspacing=0><tr>\n";
665 textout << "<td valign=top";
666 if (formatinfo.DocumentContents) textout << " width=200>\n";
667 else textout << " width=100%>\n";
668 if (formatinfo.DocumentImages)
669 output_cover_image (args, collectproto, disp, outconvert, textout, logout);
670 else if (formatinfo.DocumentTitles)
671 output_titles (args, collectproto, formatinfo, disp, outconvert, textout, logout);
672 output_controls (args, formatinfo.DocumentButtons, collectproto, disp,
673 outconvert, textout, logout);
674 textout << "</td><td valign=top>\n";
675 havecontrols = true;
676 }
677
678 if (formatinfo.DocumentContents || args["d"].empty()) {
679 if (args.getintarg("gc") == 1) {
680
681 // expanded table of contents
682 expanded_contents (args, tabcount, fulltoc, browsermap, formatinfo,
683 collectproto, disp, outconvert, textout, logout);
684 } else {
685
686 // contracted table of contents
687 contracted_contents (args, tabcount, fulltoc, browsermap, formatinfo,
688 collectproto, disp, outconvert, textout, logout);
689 }
690 }
691
692 if (havecontrols) textout << "</td></tr></table>\n";
693}
694
695
696
Note: See TracBrowser for help on using the repository browser.