Ignore:
Timestamp:
2003-08-20T15:54:46+12:00 (21 years ago)
Author:
sjboddie
Message:

Fixed a couple of bugs in recent changes for building/displaying
collections that have no searchable indexes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/pageaction.cpp

    r4905 r5225  
    842842  } else if (arg_p == "about" || arg_p == "help") {
    843843    if (collectproto == NULL) return;
     844
     845    comerror_t err;
     846    bool has_search_button = true;
     847    collectproto->is_searchable(args["c"], has_search_button, err, logout);
     848    if (err != noError) has_search_button = true;
    844849   
    845850    // _textbrowseoptions_ and _numbrowseoptions_
     
    851856    get_children ("", args["c"], metadata, getParents, collectproto, response, logout);
    852857
    853     disp.setmacro ("numbrowseoptions", "help", response.docInfo.size()+1);
     858    int numbrowseoptions = response.docInfo.size();
     859    if (has_search_button) numbrowseoptions += 1;
     860    disp.setmacro ("numbrowseoptions", "help", numbrowseoptions);
    854861
    855862    ResultDocInfo_tarray::iterator here = response.docInfo.begin();
    856863    ResultDocInfo_tarray::iterator end = response.docInfo.end();
    857864
    858     // we're assuming that we've always got a search button
    859     text_t shorttext = "<ul><li>_textSearchshort_\n";
    860     text_t longtext = "_textSearchlong_";
     865    text_t shorttext;
     866    text_t longtext;
     867    if (has_search_button) {
     868      shorttext = "<ul><li>_textSearchshort_\n";
     869      longtext = "_textSearchlong_";
     870    }
    861871
    862872    while (here != end) {
Note: See TracChangeset for help on using the changeset viewer.