Changeset 2767 for trunk/gsdl/src


Ignore:
Timestamp:
2001-10-02T12:05:43+12:00 (23 years ago)
Author:
sjboddie
Message:

altered the docs page to avoid broken links when documentation isn't
installed along with Greenstone

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

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

    r2664 r2767  
    2727#include "pageaction.h"
    2828#include "receptionist.h"
     29#include "fileutil.h"
    2930#include <time.h>
    3031
     
    296297}
    297298
     299void pageaction::set_documentation_macro (displayclass &disp) {
     300
     301  text_t documentation;
     302  text_t docsdir = filename_cat(gsdlhome, "docs");
     303 
     304  if (file_exists(filename_cat(docsdir, "User.pdf"))) {
     305    documentation += "<tr valign=middle><td><a href=\"_httpdocs_/User.pdf\">_iconpdf_"
     306      "</a></td><td>_textuserguide_</td></tr>";
     307  }
     308 
     309  if (file_exists(filename_cat(docsdir, "Install.pdf"))) {
     310    documentation += "<tr valign=middle><td><a href=\"_httpdocs_/Install.pdf\">_iconpdf_"
     311      "</a></td><td>_textinstallerguide_</td></tr>";
     312  }
     313 
     314  if (file_exists(filename_cat(docsdir, "Develop.pdf"))) {
     315    documentation += "<tr valign=middle><td><a href=\"_httpdocs_/Develop.pdf\">_iconpdf_"
     316      "</a></td><td>_textdeveloperguide_</td></tr>";
     317  }
     318 
     319  if (file_exists(filename_cat(docsdir, "Paper.pdf"))) {
     320    documentation += "<tr valign=middle><td><a href=\"_httpdocs_/Paper.pdf\">_iconpdf_"
     321      "</a></td><td>_textpaperguide_</td></tr>";
     322  }
     323
     324  if (!documentation.empty()) {
     325    disp.setmacro("documentation", "docs", "<p>\n<table border=0>\n" + documentation + "\n</table>\n");
     326  }
     327}
     328
    298329void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args,
    299330                     recptprotolistclass *protos, ostream &logout) {
     
    348379  // if page is "homehelp"
    349380  // _collectionlist_      list of available collections to be displayed on the homehelp page
     381
     382 
     383  // if page is "docs"
     384  // _documentation_       links to PDF documents if they're available
     385
    350386 
    351387  if (recpt == NULL) {
     
    599635    set_collectionlist_macro (disp, protos, logout);
    600636
     637  } else if (arg_p == "docs") {
     638
     639    set_documentation_macro (disp);
     640
    601641  }
    602642}
  • trunk/gsdl/src/recpt/pageaction.h

    r2329 r2767  
    7373                 ostream &logout);
    7474
     75  void set_documentation_macro (displayclass &disp);
    7576
    7677  bool status_disabled;
Note: See TracChangeset for help on using the changeset viewer.