Changeset 2329


Ignore:
Timestamp:
2001-04-20T13:19:37+12:00 (23 years ago)
Author:
sjboddie
Message:

Added a "help" link to the default home page

Location:
trunk/gsdl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/base.dm

    r2231 r2329  
    209209_httppagehome_ {_gwcgi_?a=p&p=home}
    210210_httppagehelp_ {_httppagex_(help)}
     211_httppagehomehelp_ {_httppagex_(homehelp)}
    211212_httppagepref_ {_httppagex_(preferences)}
    212213_httpclearhistory_ {_gwcgi_?e=_compressedoptions_&a=dh}
  • trunk/gsdl/macros/home.dm

    r2244 r2329  
    3535_imageadmin_ {_gsimage_(_httppagestatus_,_httpimg_/cadminof.gif,_httpimg_/cadminon.gif,admin,Administration Page)}
    3636_imagegogreenstone_ {_gsimage_(_home:httppagegsdl_,_httpimg_/cabgsof.gif,_httpimg_/cabgson.gif,gogs,About Greenstone)}
     37_imagegohelp_ {_gsimage_(_home:httppagehomehelp_,_httpimg_/choheof.gif,_httpimg_/choheon.gif,hohe,Help)}
    3738
    3839#######################################################################
     
    6364</center>
    6465<p><table>
     66_textgohelp_
    6567_textgocollector_
    6668_textgoadmin_
     
    98100</tr>
    99101}
     102
     103_textgohelp_ {
     104<tr valign=top>
     105<td valign=top>_imagegohelp_</td>
     106<td>Help text about this Greenstone installation</td>
     107</tr>
     108}
     109
     110
     111
     112package homehelp
     113
     114_collectionlist_ {}
     115
     116_javalinks_ {_imagehome_}
     117_javalinks_ [v=1] {
     118_imagehome_<br>
     119}
     120
     121_content_ {
     122<center>
     123<p>_iconblankbar_
     124</center>
     125<p>
     126<table border=0 cellspacing=0 cellpadding=0>
     127 <tr>
     128  <td valign=top align=center>_imagegreenstone_</td>
     129  <td valign=top>
     130  Greenstone is a suite of software which has the ability to serve digital
     131  library collections and build new collections.  It provides a new way of
     132  organizing information and publishing it on the Internet or on CD-ROM.
     133  Greenstone is produced by the New Zealand Digital Library Project at the
     134  University of Waikato, and distributed in cooperation with UNESCO and the
     135  Humanities Library Project. It is open-source software, available from
     136  <i>http://nzdl.org</i> under the terms of the GNU General Public License.
     137  <br><br>
     138  </td>
     139 </tr>
     140</table>
     141
     142<center>
     143<p>_iconblankbar_
     144</center>
     145_If_(_collectionlist_,_collectionlist_,
     146<p>There are currently no collections available to this Greenstone installation.
     147To add some collections you may either
     148<ul><li>Use <a href="_httppagecollector_">The Collector</a> to build new collections
     149    <li>If you have a Greenstone cd-rom you may install collections from cd-rom
     150</ul>)
     151
     152<center>
     153<p>_iconblankbar_
     154</center>
     155<p>There are three further buttons on the home page
     156<p><table>
     157_home:textgocollector_
     158_home:textgoadmin_
     159_home:textgogreenstone_
     160</table>
     161<center>
     162<p>_iconblankbar_
     163</center>
     164}
  • trunk/gsdl/src/recpt/pageaction.cpp

    r2113 r2329  
    197197}
    198198
     199void pageaction::set_collectionlist_macro (displayclass &disp, recptprotolistclass *protos,
     200                       ostream &logout) {
     201
     202  text_t collectionlist;
     203  int count = 0;
     204 
     205  recptprotolistclass::iterator rprotolist_here = protos->begin();
     206  recptprotolistclass::iterator rprotolist_end = protos->end();
     207  while (rprotolist_here != rprotolist_end) {
     208    if ((*rprotolist_here).p != NULL) {
     209
     210      text_tarray collist;
     211      comerror_t err;
     212      (*rprotolist_here).p->get_collection_list (collist, err, logout);
     213      if (err == noError) {
     214    text_tarray::iterator collist_here = collist.begin();
     215    text_tarray::iterator collist_end = collist.end();
     216
     217    while (collist_here != collist_end) {
     218      ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
     219     
     220      if (cinfo != NULL) {
     221        if (cinfo->isPublic && (cinfo->buildDate > 0)) {
     222
     223          count ++;
     224
     225          text_t coll_type = "&ct=";
     226          if (cinfo->buildType == "mgpp") {
     227        coll_type += "1";
     228          }
     229          else {
     230        coll_type += "0";
     231          }
     232          FilterResponse_t response;
     233          text_tset metadata;
     234          metadata.insert ("collectionname");
     235          text_t collectionname = *collist_here;
     236
     237          if (get_info ("collection", *collist_here, metadata, false,
     238                (*rprotolist_here).p, response, logout)) {
     239        if (!response.docInfo[0].metadata["collectionname"].values[0].empty()) {
     240          collectionname = response.docInfo[0].metadata["collectionname"].values[0];
     241        }
     242          }
     243         
     244          comerror_t err;
     245          text_t optsite = "";
     246          text_t site_name = (*rprotolist_here).p->get_site_name (err);
     247          if (!site_name.empty()) { optsite = "site="+site_name+"&"; }
     248
     249          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type+"\">";
     250
     251          if (!cinfo->receptionist.empty())
     252        link = "<a href=\"" + cinfo->receptionist + "\">";
     253         
     254         collectionlist += "<li>" + link + collectionname + "</a>\n";
     255        }
     256      }
     257      collist_here ++;
     258    }
     259      }
     260    }
     261    rprotolist_here ++;
     262  }
     263
     264  if (count == 1) {
     265    collectionlist = "<p>This Greenstone installation contains 1 collection\n<ul>" +
     266      collectionlist + "</ul>\n";
     267  } else if (count > 1) {
     268    collectionlist = "<p>This Greenstone installation contains " + text_t(count) +
     269      " collections\n<ul>" + collectionlist + "</ul>\n";
     270  }
     271
     272  disp.setmacro ("collectionlist", "homehelp", collectionlist);
     273}
     274
    199275void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args,
    200276                     recptprotolistclass *protos, ostream &logout) {
     
    243319  // _textgoadmin_         set to "" if status is disabled in main.cfg
    244320
     321
     322  // if page is "homehelp"
     323  // _collectionlist_      list of available collections to be displayed on the homehelp page
    245324 
    246325  if (recpt == NULL) {
     
    475554      }
    476555    }
     556
     557  } else if (arg_p == "homehelp") {
     558   
     559    set_collectionlist_macro (disp, protos, logout);
     560
    477561  }
    478562}
  • trunk/gsdl/src/recpt/pageaction.h

    r1759 r2329  
    7070                ostream &logout);
    7171
     72  void set_collectionlist_macro (displayclass &disp, recptprotolistclass *protos,
     73                 ostream &logout);
     74
     75
    7276  bool status_disabled;
    7377  bool collector_disabled;
Note: See TracChangeset for help on using the changeset viewer.