Changeset 2767 for trunk/gsdl


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
Files:
4 edited

Legend:

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

    r2625 r2767  
    11package docs
    22
     3# set from within server
     4_documentation_ {}
    35
    46#######################################################################
     
    1820#######################################################################
    1921
    20 _icongsdocsgr_ {<img src="_httpimg_/gsdocsgr.gif">}
     22_icongsdocsgr_ {<img src="_httpicongsdocsgr_">}
    2123_httpiconpdf_ {_httpimg_/pdf.gif}
    2224_iconpdf_ {<img src="_httpiconpdf_" border=0>}
     
    2426_httpdocs_ {_httpprefix_/docs}
    2527
    26 _pagetitle_ {Greenstone Digital Library Software}
     28_pagetitle_ {_textimagegreenstone_}
    2729
    2830_content_ {
    2931_icongsdocsgr_
    30 
    31 <p>
    32 <table border=0>
    33 <tr valign=middle><td><a href="_httpdocs_/User.pdf">_iconpdf_</a></td><td>User's Guide</td></tr>
    34 <tr valign=middle><td><a href="_httpdocs_/Install.pdf">_iconpdf_</a></td><td>Installer's Guide</td></tr>
    35 <tr valign=middle><td><a href="_httpdocs_/Developer.pdf">_iconpdf_</a></td><td>Developer's Guide</td></tr>
    36 <tr valign=middle><td><a href="_httpdocs_/From_paper_to_collection.pdf">_iconpdf_</a></td><td>From Paper to Collection Guide</td></tr>
    37 </table>
     32_If_(_documentation_,_documentation_,_textnodocumentation_)
    3833
    3934_nzdlpagefooter_
  • trunk/gsdl/macros/english2.dm

    r2361 r2767  
    140140_textmessagestalekey_ {The link you have followed is now stale.
    141141Please enter your password to access this page.}
     142
     143
     144######################################################################
     145# 'docs' page
     146package docs
     147######################################################################
     148
     149
     150#------------------------------------------------------------
     151# text macros
     152#------------------------------------------------------------
     153
     154_textnodocumentation_ {
     155<p>This Greenstone installation does not include any documentation. This
     156may be because:
     157<ol>
     158 <li>Greenstone was installed from CD-ROM using a compact installation.
     159 <li>Greenstone was installed from a distribution downloaded from the
     160 internet.
     161</ol>
     162In either case you may obtain the documentation either from the <i>docs</i>
     163directory of a Greenstone CD-ROM or by visiting <a
     164href="http://www.greenstone.org">http://www.greenstone.org</a>.
     165}
     166
     167_textuserguide_ {User's Guide}
     168_textinstallerguide_ {Installer's Guide}
     169_textdeveloperguide_ {Developer's Guide}
     170_textpaperguide_ {From Paper to Collection Guide}
     171
     172#------------------------------------------------------------
     173# icons
     174#------------------------------------------------------------
     175
     176## "greenstone documentation" ## green_bar_left_aligned ## gsdocsgr ##
     177_httpicongsdocsgr_ {_httpimg_/gsdocsgr.gif}
     178_widthgsdocsgr_ {_pagewidth_}
     179_heightgsdocsgr_ {17}
     180
  • 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.